Boost Library and nearest point

I can find the distance between MyPoint and MyPolygon using

 double dist = boost::geometry::distance(MyPoint, MyPolygon) 

obviously, the closest point to MyPolygon to be calculated somewhere. Is there an easy way to get this closest point? I cannot find anything in the Boost Documentation, and I am sure that others had this problem too.

+6
source share
1 answer

According to source, its iterating over all the points of the polygon inside the distance_single_to_multi class. It does not store an iterator, so you probably should.

You can learn how to do this in comparable_distance .

+2
source

Source: https://habr.com/ru/post/973748/


All Articles