Boost logo

Boost Users :

Subject: Re: [Boost-users] Enquiry on boost.geometry and intersection()
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2018-11-21 03:09:11


Please do not top-post.

Zhang Qun wrote:
> Hi Adam
> I think I have figured it out. Because of the precision, the two
> polygons are not the same.
>
> That also explains that why sometimes the intersection() gives me two
> intersection points looking "exactly" the same but if you look at the
> double precision, they are actually two different points. In reality,
> these two points can be safely considered the same point. I can solve
> this by comparing the two points distance. However, sometimes also
> because of the precision, the intersection() does not even give me any
> intersection points especially when the line is right across the
> vertex of the polygon. How do I solve this kind of problem?

Could you paste the WKTs of geometries (with sufficient precision) [1]
and say what do you get and what do you expect?

[1] e.g. std::cout << std::setprecision(20) << bg::wkt(polygon) <<
std::endl;

Adam



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