Boost logo

Geometry :

Subject: [ggl] nearest neighbor/segment
From: Matt Anderson (matt)
Date: 2011-08-16 22:06:07


   Hi Barend,

   Any news on the "nearest neighbor" function? (see below)

   Or alternatively is there a way to get this information from the
intersect algorithm? (which I have to run anyways...)

   thanks,

   Matt

---------------------------------------------------------------------------
http://relativity.phys.lsu.edu/~matt/

On Fri, 10 Sep 2010, Barend Gehrels wrote:

> hi Matt,
>
> Welcome to the list.
>
>>
>> When a point is found to be within a polygon, is there a GGL method
>> already in place to find the polygon segment and corresponding anchor nodes
>> closest to that point within the polygon?
>>
>> [...] Does a method similar to above illustrated 'unkown_method' exist
>> which would return the nodes in question?
>>
>>
>
> I once created a "nearest_neighbor" function which calculates exactly this
> point. Because it was in draft and not completely finished, I didn't add it
> yet. For this function it is not important if it lies inside or outside, and
> can be used for a linestring, or even multi-point, as well.
> I was not sure about the name, and I believe in PostGIS it is called
> ST_ClosestPoint, which is better. But (AFAIK) in PostGIS it will return zero
> for a point within a polygon, so it is not completely similar. So if anyone
> has a suggestion for the best name, it is welcome.
>
> I'll try to add it next weekend to the sandbox.
>
> Regards, Barend
>
>
> _______________________________________________
> ggl mailing list
> ggl_at_[hidden]
> http://lists.osgeo.org/mailman/listinfo/ggl
>


Geometry list run by mateusz at loskot.net