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

Tiemens, Gerben Gerben.Tiemens at grontmij.nl
Wed Oct 29 12:31:15 EDT 2008


To add to my previous post:

This is the error given by MapServer:



Greetings

Gerben

-----Oorspronkelijk bericht-----
Van: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] Namens G. Tiemens
Verzonden: Wednesday, October 29, 2008 4:12 PM
Aan: mapserver-users at lists.osgeo.org
Onderwerp: [MAPSERVER-USERS] [Postgis] Intersection on requested data


Hello all,

Is it possible to do an intersection on the requested data?

I want to make a data query to the postgis, where the data will be intersected and delivered to mapserver for display process.

Here is what i already reached:

CONNECTIONTYPE postgis
CONNECTION 'host=127.0.0.1 user=postgres password=postgres dbname=OM'
DATA  "the_geom FROM kl_l  USING UNIQUE gid USING SRID = 28992"
FILTER "ST_Intersects(kl_l.the_geom , ST_GeomFromText('POLYGON((165607 387820 , 165651  387813 , 165672  387759 , 165598  387800 , 165607  387820 ))' , 28992) )"

This works fine. The data returned is the features that intersect. But this returns the whole feature, instead of the intersection part itself.

So i tried to get the intersection:

CONNECTIONTYPE postgis
CONNECTION 'host=127.0.0.1 user=postgres password=postgres dbname=OM'
DATA  "ST_Intersection(kl_l.the_geom , ST_GeomFromText('POLYGON((165607 387820 , 165651  387813 , 165672  387759 , 165598  387800 , 165607  387820 ))' , 28992) ) FROM kl_l USING UNIQUE gid USING SRID = 28992"
FILTER "ST_Intersects(kl_l.the_geom , ST_GeomFromText('POLYGON((165607 387820 , 165651  387813 , 165672  387759 , 165598  387800 , 165607  387820 ))' , 28992) )"


The full query works fine on the postgis database:

select ST_Intersection(kl_l.the_geom , ST_GeomFromText('POLYGON((165607 387820 , 165651  387813 , 165672  387759 , 165598  387800 , 165607  387820 ))' , 28992) ) FROM kl_l where ST_Intersects(kl_l.the_geom ,
ST_GeomFromText('POLYGON((165607  387820 , 165651  387813 , 165672  387759 ,
165598  387800 , 165607  387820 ))' , 28992) )


The part where mapserver is complaining is the single quote just before POLYGON in the DATA statement.
I tried single quotes inside double quotes, tried double quotes inside single quotes,  both give the same error.

Is there any way of retrieving the intersected features?

Greets

Gerben

--
View this message in context: http://www.nabble.com/-Postgis--Intersection-on-requested-data-tp20229230p20229230.html
Sent from the Mapserver - User mailing list archive at Nabble.com.

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

<< Please read our E-mail Disclaimer at the Grontmij Corporate website >>


More information about the mapserver-users mailing list