boostorg / boostorg/geometry

Invalid result of intersection for MLs, MPo -> MLs

Open
#656 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
517
Forks
232
PR merge metrics
No merged PRs in 30d

Description

Geometry develop (1.72.0), with VS2017 x64.

![image](https://user-images.githubusercontent.com/1226951/71935978-78d96000-31a8-11ea-89d0-82bb5f6d8b5f.png)

```
typedef bg::model::point point;
typedef bg::model::linestring linestring;
typedef bg::model::polygon polygon;
typedef bg::model::multi_linestring multi_linestring;
typedef bg::model::multi_polygon multi_polygon;

multi_polygon mpo{ { { {0, 0}, {0, 1}, {1, 1}, {1, 0}, {0, 0} },
{ {0, 0}, {0.2, 0.1}, {0.1, 0.2}, {0, 0} } } };
multi_linestring mls{ { {0, 0}, {1, 0}, {1, 1}, {2, 0}, {3, 0} },
{ {-1, -1}, {0, 0}, {0, -1} } };
multi_linestring res_mls;

bg::intersection(mls, mpo, res_mls);
```

Result is: `MULTILINESTRING((0 0, 1 0, 1 1), (1.249e-16 2.498e-16, 0 0, 0 -1))`
should be: `MULTILINESTRING((0 0, 1 0, 1 1))`

Contributor guide

Open the contributing guide

Research direction

Start at the bg::intersection(mls, mpo, res_mls) entry point using the supplied multi_linestring and multi_polygon inputs. Compare the produced geometry with the expected MULTILINESTRING and trace why the second line is retained; done means the intersection excludes that outside segment while preserving the valid first segment.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.