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. _______________________________________________ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users