[mapserver-users] Clipping returned WFS data to the requesting bounding box

mattmendick matt.mendick at pictometry.com
Tue Nov 23 17:27:17 EST 2010


Hi list-

I have some data that I'm getting at in MapServer via WFS that spans over
large areas, and my requesting region is always a bounding box that is
fairly small.  I would like to clip the returned data to the bounding box
that requested it in the first place and I have been successful in getting
back the proper clipped geometries, following the suggestions in this post:

http://osgeo-org.1803224.n2.nabble.com/Postgis-Intersection-on-requested-data-td1973165.html

The only problem is that the "describeFeatureType" and "getFeature" calls to
this layer do not return any record attributes.   I tried specifying them
using propertyName, but they still don't show up.  My DATA entry looks like
this:

DATA "the_geom FROM (SELECT ST_Intersection(f.wkb_geometry, !BOX!) AS
the_geom, f.* FROM flood as f) AS subquery USING UNIQUE ogc_fid USING SRID =
4326"

I've also tried specifying each attribute individually instead of using f.*
which yields the same results.  I understand that the form of the DATA entry
should be: 

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

as was mentioned by Paul Ramsey in the previous post.

My understanding is that [sourceofdata] should be a dataset (either table
name or complete query like I've specified above) that has a geometry column
specified with [columntodraw] and then any attributes.  What am I missing?

Our fallback is to do clipping later when processing the data, but better to
use the very fast ST_Intersection() method I would say, if it's possible. 
Thanks!

-Matt
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Clipping-returned-WFS-data-to-the-requesting-bounding-box-tp5768616p5768616.html
Sent from the Mapserver - User mailing list archive at Nabble.com.


More information about the mapserver-users mailing list