[mapserver-users] Which is fastest? finding nearest point, or polygon?

Mark Korver mwkorver at gmail.com
Tue May 17 09:48:32 EDT 2011


> 1. Can mapserver find the nearest point directly? If so, how do I set
>   it up?

normally this would be PostGIS query as in

http://osgeo-org.1803224.n2.nabble.com/get-the-closest-feature-in-a-point-query-td5819760.html

> 2. Is this faster than finding the polygon the click is inside?

I would expect the point based query to be a lot faster.  Tolerance
defines a bbox of what subset of points to calc distance from, then
just sorting by distance to get your answer.  You can do this with
just SQL and little code np.

On Tue, May 17, 2011 at 7:11 AM, Trond Michelsen
<trondmm-mapserver at crusaders.no> wrote:
> Hi.
>
> I have a pointlayer with about 10000 points (will probably become
> 25000 later), and I want to find the nearest point when I click in the
> map.
>
> To solve this, I've loaded the layer into qgis, and using the mmqgis
> plugin, I created a voronoi diagram layer. I'm now serving this layer
> with mapserver, and a click on the map will trigger a GetFeatureInfo
> request from this layer, which returns the metadata from the
> corresponding point.
>
> Everything works fine, but I get this nagging feeling that I've
> overcomplicated things, so I'm wondering:
>
> 1. Can mapserver find the nearest point directly? If so, how do I set
>   it up?
> 2. Is this faster than finding the polygon the click is inside?
>
> --
> Trond Michelsen
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>


More information about the mapserver-users mailing list