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

G. Tiemens Gerben.Tiemens at grontmij.nl
Wed Oct 29 08:12:28 PDT 2008


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.




More information about the MapServer-users mailing list