Subject: Re: [geometry] distance_info function
From: Claus Christmann (hcc_at_[hidden])
Date: 2013-10-02 09:37:56
On Monday, September 30, 2013 22:32:44 Adam Wulkiewicz wrote:
> Claus Christmann wrote:
> > Hi boost::geometry
> > I only recently started to read this email list after I found
> > http://boost-geometry.203548.n3.nabble.com/distance-between-geometries-tp
> > 4025549p4025550.html , which google dug up for me when searching for a
> > method to find the closes point on a geometry.
> > (When I say closest point, I mean the green point in
> > http://boost-geometry.203548.n3.nabble.com/attachment/4025550/1/ffgdbgcd.
> > png when asking for what is the point of the blue polygon closest to the
> > red point.)
> > >From what I understand from that post there currently is no "easy" way to
> > >get>
> > the point distance found as being the closest, i.e. something like
> > "point green = bg::closest(point red, polygon blue);"
> > My question(s) at this point are whether there is a chance to get access
> > to
> > the mentioned distance_info function, or if somebody could point me to
> > another function that is able to get the closest (potentially projected)
> > point in another geometry or whether I should start to hack distance.hpp
> > and distance_projected_point.hpp to get me access to the closest point.
> > Thank you very much for any and all hints and pointers.
> AFAIK there isn't any "official" way of obtaining the closest point. For
> now, as you've written, you probably can modify
> (boost/geometry/strategies/cartesian/distance_projected_point.hpp) to
> return also the projected point, not only the distance. And above this
> build your version of distance() using one or all of those structs:
> bg::detail::distance::point_to_polygon ->
> bg::detail::distance::point_to_ring ->
> bg::detail::distance::point_to_range defined in
> To get more detailed answer about the distance_info you probably should
> wait for Barend.
thanks for the hints. I'll see what I can do myself, especially as I (at this
point) only need point_to_ring, i.e. less hacking needed. I'll keep reading
the list for any updates from Barend on the distance_info function.
-- Claus Christmann UAV Research Facility Georgia Institute of Technology http://uav.ae.gatech.edu
Geometry list run by mateusz at loskot.net