[mapserver-dev] Template driven output - issue with PostGIS connection

Havard Tveite havard.tveite at umb.no
Thu Jun 6 04:17:24 PDT 2013


I have a PostGIS connection, and want to provide GeoJSON
output.

After some stumbling (and updating of the Mapserver docs!),
I got it to work, except for the "using unique" part.

The interesting parts of my DATA string is like:
     DATA "geom from (select x.id as id, ...) as test using unique id using SRID=4326"

This works well for WFS with GML, but when I add
"&outputformat=geojson" (to get GeoJSON output), the returned
id is a very large number (for instance 137051404431549 - it
changes for each request), and it is the same number for all
the features.  The actual ids are between 1 and 1000.

I have the same issue when not using WFS (&mode=nquery&qformat=geojson).

My template for geojson output is according to the documentation
(and everything else is returned as it should).

Could this be a bug?

mapserv -v
MapServer version 6.2.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=GD SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=OPENGL SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

I have not checked trunk.


Håvard
-- 
Håvard Tveite
Department of Mathematical Sciences and Technology, UMB
Drøbakveien 31, POBox 5003, N-1432 Ås, NORWAY
Phone: +47 64965483 Fax: +47 64965401 http://www.umb.no/imt/


More information about the mapserver-dev mailing list