Boost Users :
Subject: Re: [Boost-users] measuring distance between a point and a segment
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2016-04-20 21:51:44
Juliette Pera wrote:
> Dear all,
> I am currently trying to use the boost library in order to measure the
> shortest distance between a point and a list of segments.
> I am declaring a segment to which I append the two points of my
> segment and the I calculate the distance from my point P to the segment.
> xsegment_t segment;
> double distance2 = geom::distance(segment,geom::make_point(P,P));
> The issue is that I measure every time the same distance even if the
> segment is different.
> Does anyone knows from where that issue can come from?
Sorry, but I don't have enough data to say what's the problem. It'd be
the best if you could share some small but complete example showing this
Does the algorithm return this result when geometries of types
bg::model::segment and bg::model::point are passed?
What coordinate system do you use?
Or do you use your own types adapted to Segment and Point concepts?
If the answer is yes, then I'd start from checking if the adaptation was
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net