I've been using MapServer with shapefiles for some time.  I'm trying to convert 
a site to PostGIS, and I'm having problems.

I've successfully installed PostGIS on my Ubunto 10.04 box, and copied a number 
of shapefiles into it, using shp2pgsql.  I can view the new tables using qGIS, 
so I'm sure the data is right.

So now I've copies a mapfile that was working against the original shapefiles, 
and I'm trying to convert it to use PostGIS.  I'm working on just one layer, 
and I'm trying to test that layer with shp2img.

I've added to the LAYER definition:

LAYER
                                NAME "countyboundaries"
                                CONNECTIONTYPE postgis
                                CONNECTION "host=localhost dbname=test_db 
user=gis password=xxxxx"
                                DATA "the_geom from gis_schema.county"
                                [...]
                END

As I said, I know the data is in the database, because I can load it as a 
PostGIS layer from qGIS.  Column and table names are right, because when I run 
"select the_geom from gis_schema.county" in the query tool I get the data.

But when I run shp2img from the commandline, I get an error:

$ shp2img -m test.map -o test.gif -i GIF -l countyboundaries
msDrawMap(): Image handling error. Failed to draw layer named 
'countyboundaries'.
msPostGISParseData(): Query error. Error parsing PostGIS DATA variable. Must 
contain 'geometry
from table' or 'geometry from (subselect) as foo'. County

shp2img is MapServer version 5.6.6, and the output from -v does contain 
"INPUT=POSTGIS".

Any ideas?  I'm trying to keep things simple, and it's frustrating when simple 
doesn't work.


_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to