[postgis-users] Problem getting started

Stephen Woodbridge woodbri at swoodbridge.com
Fri Mar 18 09:06:01 PST 2005


Hi all,

I created my database, used shp2pgsql to load some polygons, created the 
indexes, etc. But when I try to render the map I get the error below. 
Something is clearly broken as the table name is missing before the 
WHERE and some term is missing between the "WHERE   &&" so I'm open to 
suggestions at this point.

-Steve W.

PostgreSQL 7.4.7 on i386-portbld-freebsd5.3, compiled by GCC cc (GCC) 
3.4.2 [FreeBSD] 20040728
PostGIS 1.0RC3

shp2img -v
MapServer version 4.4.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP 
SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT 
INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE DEBUG=MSDEBUG

THE PROBLEM:

woodbri at linus:/u/data$ shp2img -m maps/zcta.map -o test.png
shp2img in free(): warning: chunk is already free
msDrawMap(): Image handling error. Failed to draw layer named 'zcta'.
prep_DB(): Query error. Error executing POSTGIS DECLARE (the actual 
query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT 
asbinary(force_collection(force_2d()),'NDR'),gid::text from  WHERE  && 
setSRID('BOX3D(-180 -14.825,-51.75 113.425)'::BOX3D, -1 )'

Postgresql reports the error as 'ERROR:  syntax error at or near "WHERE" 
at character 104
'

THE MAPFILE LAYER:

   LAYER
     NAME "zcta"
     STATUS DEFAULT
     TYPE POLYGON
     CONNECTIONTYPE postgis
     CONNECTION "user=pgsql dbname=census"
     DATA "the_geom FROM zcta using SRID=-1 using unique gid"
     LABELMAXSCALE 150000
     LABELITEM "name"
     CLASS
       COLOR 238 238 238
       OUTLINECOLOR 170 170 153
       LABEL
         TYPE TRUETYPE
         FONT "arial-bold"
         SIZE 12
         POSITION CC
         BUFFER 3
         COLOR 170 204 153
         ANTIALIAS TRUE
       END
     END
   END



More information about the postgis-users mailing list