[mapserver-users] Mapserver/PostGIS map file problem (double quotes in layer 'DATA' element)

Peter Willis peterw at borstad.com
Wed May 27 18:48:36 EDT 2009


Hello,

I am having a problem serving a PostGIS layer via mapserver
as WFS.

The problem arises from the generation/use of column names
in PostgreSQL that require double quotes.

ie:

  SELECT oid,gid, the_geom, "Area","Perimeter","PixelValue" FROM 
global_Land_poly WHERE "PixelValue"=1;



In the map file the 'DATA' member of the PostGIS layer is defined as:

DATA "the_geom from (select oid,gid, the_geom, Area,Perimeter,PixelValue 
FROM global_Land_poly WHERE PixelValue=1 ) AS FOO using SRID=4326"


<ERR>Mapserver relays a PostGIS error from PostgreSQL:
'ERROR:  column "area" does not exist...</ERR>

This is because the column name is actually "Area"
and requires quotes.

How do I define double quotes in my PostGIS query
within the 'DATA' element of my mapfile layer?

Thanks for any enlightenment,

Peter


More information about the mapserver-users mailing list