Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boost Library and closest points

I can find the distance between a point MyPoint and a polygon MyPolygon with

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

obviously the actual closest point on MyPolygon has to be computed somewhere. Is there an easy way to get that closest point? I can't find anything in the Boost Documentation and I'm sure others had that problem too.

like image 828
user3049681 Avatar asked Aug 13 '14 07:08

user3049681


1 Answers

According to source its iterating all points of polygon inside class distance_single_to_multi. Its not storing the iterator, so probably you should to the same.

You can find out how to do this in comparable_distance example.

like image 155
PSIAlt Avatar answered Oct 19 '22 22:10

PSIAlt