[mapserver-users] Getteing the intersection of two layers

Tiemens, Gerben Gerben.Tiemens at grontmij.nl
Fri Nov 7 04:13:49 EST 2008


Another aproach is to do it by SLD.

WMS and WFS supports delivering a sld to it with a intersects filter. Both work generic on whatever datasource.

   http://yourwmsurl/wms?yourwmsparameters&sld=http://sldurl.sld



Greetings

Gerben

-----Oorspronkelijk bericht-----
Van: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] Namens Steve Lime
Verzonden: Thursday, November 06, 2008 8:43 PM
Aan: Christian Jauvin; mapserver-users at lists.osgeo.org
Onderwerp: Re: [mapserver-users] Getteing the intersection of two layers

You could try a feature query in MapServer/MapScript. First step is to do a query that selects the polygons (probably by attribute) and then do a queryByFeatures() query on the point layer. The result would be a set of points that are contained in your polygon features. Be sure to set the TOLERANCE in the point layer to 0 if you want the points to be in the selection polygons.

The advantage here is that you don't have to do any up front geometry computations on your polygons. It boils down to a bunch of point-in-polygon computations which are relatively fast.

Steve

>>> On 11/6/2008 at 10:19 AM, in message
<aa5471510811060819t5ec5d06tba2476c5650f022 at mail.gmail.com>, "Christian Jauvin"
<cjauvin at gmail.com> wrote:
> Hi Everyone,
>
> I have two layers that I want to intersect: one with points, and one
> with multiple polygons representing the regions of a territory.
>
> The first approach I just tried is doing it programmatically, through
> Python/MS:
>
> I first union all the region polygons, and then get the convex hull of
> this super-shape. I then restrict the points to those inside this
> convex hull.
>
> The problem is that it is really too slow.. I'm aware that I could do
> it through PostGIS, and that performance would surely much better, but
> I'd rather stay with a more generic solution, that is applicable to
> shapefile data sources as well.
>
> Would someone be aware of a better method, maybe one involving only
> mapfile directives?
>
> Thank you,
>
> Christian
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users

_______________________________________________
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