Wrong intersection of polygon and linestring
- Dominant language
- C++
- Stars
- 517
- Forks
- 232
- PR merge metrics
- No merged PRs in 30d
Description
The following code
```cpp
#include
#include
#include
namespace bg = boost::geometry;
int main() {
// Define the polygon
bg::model::polygon> polygon;
bg::read_wkt("POLYGON((1 1.5,3.5 4.5,4 6,2.5 4.5,1 1.5))", polygon);
// Define the linestring
bg::model::linestring> linestring;
bg::read_wkt("LINESTRING(1.5 1.5,0.5 1.5)", linestring);
// Compute the intersection
std::tuple<
bg::model::multi_point>,
bg::model::multi_linestring>>
> output;
bg::intersection(polygon, linestring, output);
// Print the results
auto linestrings = std::get<1>(output);
auto points = std::get<0>(output);
std::cout << "Intersection linestrings: " << bg::wkt(linestrings) << std::endl;
std::cout << "Intersection points: " << bg::wkt(points) << std::endl;
return 0;
}
```
Gives the following incorrect output:
```
Intersection linestrings: MULTILINESTRING((1 1.5,0.5 1.5))
Intersection points: MULTIPOINT()
```
on current develop with clang-15 on ubuntu 22.

Contributor guide
Assessment
This issue has not been assessed yet.