[MAPSERVER-USERS] [Postgis] Intersection on requested data

Paul Ramsey pramsey at cleverelephant.ca
Fri Oct 31 12:12:05 EDT 2008


You need to understand the syntax of the DATA statement, which is not
pure SQL. It is:

[columntodraw] FROM [sourceofdata] USING UNIQUE [uniquekey] USING SRID=[srid]

columntodraw is always assumed to be a single word.

Write your data statement like this:

DATA  "the_geom FROM (SELECT gid,ST_Intersection(kl_l.the_geom ,
ST_GeomFromText('POLYGON((165607 387820 , 165651  387813 , 165672
387759 , 165598  387800 , 165607  387820))' , 28992)) AS the_geom FROM
kl_l) AS SUBQUERY USING UNIQUE gid USING SRID=28992"

Note that result of the intersection is aliased as "the_geom" so that
it matches the columntodraw cited at the front, and the unique id is
included in the subquery and cited in the using unique. Also the SRID
is cited.

P.


More information about the mapserver-users mailing list