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

Paul Ramsey pramsey at cleverelephant.ca
Fri Oct 31 09:12:05 PDT 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