boostorg / geometry

Boost.Geometry - Generic Geometry Library | Requires C++14 since Boost 1.75
http://boost.org/libs/geometry
Boost Software License 1.0
455 stars 216 forks source link

Union strategies #477

Closed ghost closed 2 weeks ago

ghost commented 6 years ago

Hello,

I want to merge two polygon that should have one or several segment in common (or at least they should be very near). But they will never completely overlap. I tried union with the default strategy without any success, and didn't find anything about Union Strategy Concept. So I'm wondering how I should do that? If it's possible.

Thanks

awulkiew commented 6 years ago

Hi,

Union should merge them unless they were close but not overlapping, then both polygons should be in the output. Could you share the case which doesn't work for you? Have in mind that the orientation and closure of Polygons has to be correct (so the input has to be valid) and that the the output of union_() has to be MultiPolygon.

ghost commented 6 years ago

Sorry it's a bit hard to answer these days. So I wanted to show you the values, and them I tried again with a small test. And it was working... I just realized that given the .data() of a std::vector<point_2d>to assign_points wasn't a good idea... Anyway that doesn't answer my real question which is : is there any Union Strategy to apply a radius about if the polygon overlap or not? Where I can find the documentation about Union Strategies?

vissarion commented 2 weeks ago

Union strategies are undocumented (as most of the strategies).

The question it is not very clear to me, what I understand is that the user want to merge polygons only in the case they share one (or multiple edges), in other words their intersection is a set of linestrings and not polygons. It is very old but just for the history I am moving it to discussions.