[postgis-users] PostGis/MapServer ... Query-Problem

chodgson at refractions.net chodgson at refractions.net
Fri Sep 12 08:59:22 PDT 2003


You don't need to use the complete sysntax. "using unique oid using SRID=-1" is 
only necessary if you are doing a sub-select, which you are not. Therefore, you 
can use the ultra-easy syntax:

DATA the_geom from punkte_tabelle

That's it. the oid is automatically used to identify individual features, and 
the srid is taken from the geometry_columns table (the SRID you set when you 
called AddGeometryColumn() ).

HTH.
Chris

Quoting "Elstermann, Mike" <Mike.Elstermann at itc-halle.de>:

> hi folks,
> 
> we need your help.
> we wnt to query a postgis-layer with mapserver, but we get this error.
> we have made the oid an the sql-statement is: "the_geom from punkte_tabelle
> using unique oid using SRID=-1"
> 
> The Error:
> -------------------------
> 
> <!-- MapServer version 3.6.6 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
> SUPPORTS=TTF INPUT=TIFF INPUT=EPPL7 INPUT=JPEG INPUT=POSTGIS
> INPUT=SHAPEFILE --> <BODY BGCOLOR="#FFFFFF">
> msPOSTGISLayerGetShape(): Query error. Error executing POSTGIS  SQL
> statement (in FETCH ALL): EXPLAIN VERBOSE SELECT * FROM punkte_tabelle
> -
> Error with POSTGIS data variable. You specified ''.<br> Standard ways of
> specifiying are : <br>
> (1) 'geometry_column from geometry_table' <br>
> (2) 'geometry_column from (<sub query>) as foo using unique
> <column name> using SRID=<srid#>' <br><br>
> 
> Make sure you put in the 'using unique  <column name>' and 'using
> SRID=#' clauses in.
> 
> Table punkte_tabelle with index punkte_tabelle_oid_idx (oid).
> 
> The Layer-Definition:
> ------------------------
> 
> LAYER
>   CONNECTIONTYPE postgis
>   NAME pers_punkte
>   CONNECTION "user=postgres password=ppp dbname=test_db"
>   DATA 'the_geom from punkte_tabelle using unique oid using SRID=-1'
>   TYPE POINT
>   STATUS ON
>   HEADER
> "/srv/www/htdocs/mapserver/test_mapplet/java/mapplet/halgis_pers_pkt_hea
> der.html"
>   FOOTER "halgis_alle_footer.html"
>   CLASS
>     NAME 'Punkte'
>     TEMPLATE
> "/srv/www/htdocs/mapserver/test_mapplet/java/mapplet/halgis_pers_pkt.htm
> l"
>     OUTLINECOLOR 0 0 220
>     COLOR 0 0 220
>     SYMBOL 'circle'
>     size 12
>   END
> END
> 
> Thanks very much!
> 
> ::: mfg. Mike Elstermann [mikeE.], Teamleiter GIS/RIS, e-Solutions
> ::: IT-Consult Halle GmbH, Bornknechtstraße 5, 06108 Halle (Saale)
> ::: Sitz: Große Nikolaistraße 8
> ::: Tel.: +49 345 221 4237, Fax: +49 345 221 4236, mobil: +49 160 71 545 02
> ::: mike.elstermann at itc-halle.de ::: http://www.itc-halle.de
> ::: GeoDaten Online? -> http://www.itcgis.de
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 







More information about the postgis-users mailing list