Friday, September 16, 2005

Mapserver virtualspatialdata

It's a long time ago since i posted something here... (got married in the meantime). These days we are working on an application in which users can insert point-data in an mysql-table. The data is displayed in the map afterwards.

The application is based on chameleon/mapserver. To present the data virtualspatialdata is used. The mapserver Wiki gives a clear description on how to implement is. However i'd like to point you on a single issue.

When i first tested my virtual ogr file using ogrinfo (on a windows 2000 sp3 server), I recieved messages that the file gcs.csv could not be opened, containing the projection information.

ERROR 4: Unable to open EPSG support file gcs.csv. Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.
ERROR 1: Failed to import LayerSRS `EPSG:28992'.

The reason was that i hadn't run setenv.bat.

Later when i tried to view the virtualdatalayer in mapserver i got the same messages. Apparently mapserver/apache/ogr also didn't know where to look for the projection-files. After introducing the parameter gdal_data in apache config the layer was displayed properly.

SetEnv gdal_data "/ms4w/tools/ogr-utils/data"

Good luck trying out yourself.

No comments: