postgis

Stéphane RIFF stephane.riff at CERENE.FR
Thu Jul 21 02:23:00 PDT 2005


Look in you geometry_columns table,
Does your table is in because it seems that mapserver cannot find your 
geom column and the srid....


Jachym Cepicky wrote:

>Hallo,
>I have following problem with mapserver: I can not load vector file
>stored in postgis.
>
>I use Debain (testing), with mapserver from official repository and
>postgis from the Debian-Gis project
>(http://pkg-grass.alioth.debian.org/cgi-bin/wiki.pl). 
>
>I stored vector shape file with help of shp2pgsql apparently without
>problems. I can acces the file e.g. usin Qgis and I can load it to
>GRASS GIS.
>
>However mapserver gives me quite long report, about that he is not able
>to display the map. 
>
>[...]
>msDrawMap(): Image handling error. Failed to draw layer named 'obrys'.
>prep_DB(): Query error. Error executing POSTGIS DECLARE (the actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT kod::text,popis::text,asbinary(force_collection(force_2d()),'NDR'),OID::text from WHERE && setSRID('BOX3D(-599514.328920447 -1159983.83918495,-581875.449556553 -1142344.95982105)'::BOX3D, find_srid('','','') )'
>
>Postgresql reports the error as 'ERROR: syntax error at or near "WHERE" at character 126 '
>[...]
>(I posted the whole file to http://les-ejk.cz/tmp/mapserver.html)
>
>The mapfile part for the layer follows:
>LAYER
>    NAME obrys
>    TYPE polygon
>    METADATA
>        "title" "LH SLP Krtiny"
>    END
>    CONNECTIONTYPE POSTGIS
>    CONNECTION "host=10.0.0.24 dbname=krtiny user=jachym"
>    DATA "the_geom FROM obrys"
>    CLASSITEM kod
>    LABELITEM popis
>    MINSCALE 50000
>    CLASS
>        EXPRESSION '1'
>        NAME 'PUPFL "SLP Krtiny"'
>        COLOR 49 135 32
>    END
>    CLASS
>        EXPRESSION '2'
>        NAME 'Sidlo'
>        COLOR 190 190 190
>        LABEL
>            TYPE truetype
>            FONT arialce
>            SIZE 7
>            COLOR 0 0 0
>            BACKGROUNDCOLOR 255 255 255
>        END
>    END
>END
>
>In /etc/postgresql/pg_hba.conf is:
>host    krtiny  jachym       10.0.0.24       255.255.255.0  trust
>
>
>What to do?
>
>Thank you
>
>Jachym
>  
>



More information about the MapServer-users mailing list