[mapserver-users] Mapserver 5 migration & PostGIS

Ben Brehmer bbrehmer at refractions.net
Fri Jul 4 14:57:22 PDT 2008


Dear All,

I'm just in the process of changing all of my mapfiles to be 5.x 
compatible.

The PostGIS layer[1] which worked fine with 4.6 now throws an odd error 
[2] in 5.0.3.  If you look at the error, you will notice that the query 
has ""::text prepended to it although this is not in the DATA statement. 
It deosn't seem to matter how I manipulate the DATA statement, it always 
has an empty string prepended to it at runtime which causes this error.

Any ideas why an empty string is prepended to a PostGIS query at runtime 
in Mapserver 5?

Thanks,

Ben Brehmer



[1]
LAYER
  NAME "pointlayer"
  DATA "the_geom FROM points"
  CONNECTIONTYPE postgis
  CONNECTION "host=localhost user=postgres port=5432 dbname=xxx 
password=xxx"

...
..
.


[2]
msDrawMap(): Image handling error. Failed to draw layer named 
'pointlayer'. prepare_database(): Query error. Error declaring cursor: 
ERROR: zero-length delimited identifier at or near """" at character 43 
With query string: DECLARE mycursor BINARY CURSOR FOR SELECT 
""::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text 
from points WHERE the_geom && setSRID('BOX3D(-13692533.9246539 
5944251.98072804,-13537311.7862516 6063067.47212323)'::BOX3D, 
find_srid('','points','the_geom') )



More information about the MapServer-users mailing list