[postgis-users] Problem displaying postgis data with maapserver

Fernão Lopes fernao at gmail.com
Wed Mar 9 19:43:18 PST 2005


I have had the same problem. Two possible solutions:

1) On a complex query, you must put "USING UNIQUE gid USING srid=-1",
where srid will be the value on your database (look at the the_geom
column).
So, a query will be like this:

DATA "the_geom from (select * from railroad where
intersects(urban_area.the_geom, railroad.the_geom) and urban_area.name
= 'São Paulo') as foo USING UNIQUE gid USING srid=-1"

(on this query, the map will show ONLY the railroads that intersects
the urban area called "São Paulo")
Note that the "USING UNIQUE...." is placed after the "as foo".


2) Other possibility:
It's said on this page:
http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0407/msg00567.html

that there is a Bug in mapserver that gives error when you execute a
query with a "from" in upper case.

For example:
DATA "the_geom FROM world"     
don't work

But:

DATA "the_geom from world"

works... it's a little bizarre, but it's serious!

Try these two!

Good luck!

Fernão

On Wed, 9 Mar 2005 15:52:19 -0700, Ethan Alpert
<ealpert at digitalglobe.com> wrote:
> 
> Have you tried upgrading to a current version of mapserver? June 2003 is
> like ancient.
> 
> -e
> 
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Shaq
> Gbadebo
> Sent: Wednesday, March 09, 2005 11:36 AM
> To: postgis-users at postgis.refractions.net
> Subject: [postgis-users] Problem displaying postgis data with maapserver
> 
> Hi!
> 
> I have sorted out an initial problem, which was my postgresql server was
> not
> not set for tcp/ip connections. But now here is the error I am getting.
> 
> msDrawMap(): Image handling error. Failed to draw layer named 'test'.
> prep_DB(): Query error. Error executing POSTGIS DECLARE (the actual
> query)
> statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
> asbinary(force_collection(force_2d()),'NDR'),OID::text from HBHB
> WHERE
> && setSRID('BOX3D(-1333332 -999999,1333332 999999)'::BOX3D,
> find_srid('','HBHB','') )'
> 
> Postgresql reports the error ''
> 
> More Help:
> 
> Error with POSTGIS data variable. You specified '<check your .map
> file>'. Standard ways of specifiying are :
> (1) 'geometry_column from geometry_table'
> (2) 'geometry_column from (<sub query>) as foo using unique <column
> name>
> using SRID=<srid#>'
> 
> Make sure you put in the 'using unique <column name>' and 'using SRID=#'
> 
> clauses in.
> 
> For more help, please see
> http://postgis.refractions.net/documentation.php
> 
> Mappostgis.c - version of June 12/2003.
> msPOSTGISLayerParseData(): Query error. Error parsing POSTGIS data
> variable.
> Must contain 'geometry_column from table_name' or 'geom from (subselect)
> as
> foo' (couldnt find ' from '). More help:
> 
> Error with POSTGIS data variable. You specified 'geom FROM test'.
> Standard ways of specifiying are :
> (1) 'geometry_column from geometry_table'
> (2) 'geometry_column from (<sub query>) as foo using unique <column
> name>
> using SRID=<srid#>'
> 
> Make sure you put in the 'using unique <column name>' and 'using SRID=#'
> 
> clauses in.
> 
> For more help, please see
> http://postgis.refractions.net/documentation.php
> 
> Mappostgis.c - version of June 12/2003.
> 
> Any sort of help would be appreciated.
> 
> Thanks
> 
> Shaq.
> 
> _______________________________________________
> postgis-users mailing list postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> _______________________________________________
> 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