[postgis-users] subselect on DATA tag
Heitzso
heitzso at growthmodels.com
Mon Jul 14 05:29:06 PDT 2003
You need to read "Developing Applications with PostGIS Mapserver User
Meeting"
by Refractions Research, Inc. That document goes into details of
setting up the
SQL statements. I've successfully used their examples. One of my
SELECT in DATA
that workds follows.
DATA "the_geom from
(SELECT gid, the_geom, white * 100 / totalpop AS whiteper FROM
ga_blk
where totalpop > 0)
as foo using srid=-1 using unique gid"
GOOGLE for that document and read it. It's very useful.
John Hagstrand wrote:
>Hi,
>
>I'm using a subselect on the DATA statement in my mapserv mapfile, and it
>gives me an error. It works fine without the subselect. Can anyone explain
>this error to me?
>
>Here is the DATA statement (with the subselect clause simplified for
>debugging):
>DATA "geo from (select id, geo, dtime from tstory) as foo using srid=4326
>using unique id"
>
>Here is the call to mapserv:
>http://www.globalscoop.com/cgi-bin/mapserv?mode=map&map=/home/virtual/global
>scoop.com/var/www/html/gs/map/gs.map&layers=countries+lakes+rivers+stories&m
>ap_size=553+277&mapEXT=-180+-90+180+90&map_stories_filter=dtime+between+2003
>.187+and+2003.194
>
>And here is the error:
>msPOSTGISLayerWhichShapes(): Query error. prep_DB:Error executing POSTGIS
>DECLARE statement (0.6 failed - retried 0.5 and it failed too). DECLARE
>mycursor BINARY CURSOR FOR SELECT
>dtime::text,asbinary(force_collection(force_2d(geo)),'NDR'),id::text from
>(select id, geo, dtime from tstory) as foo using srid=4326 WHERE (dtime
>between 2003.187 and 2003.194) and (geo && setSRID( 'BOX3D(-180 -90,180
>90)'::BOX3D,find_srid('','tstory','geo') ))
>
>Thanks very much.
>John
>
>John Hagstrand
>Interage Research, Inc.
>18733 State Line Road
>Antioch, IL 60002
>847 838 5371
>
>
>
>_______________________________________________
>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