boostorg / boostorg/geometry

self-intersection aware simplify

Open
#880 2 comments 0 reactions 1 assignee Claimed by @barendgehrels View on GitHub
enhancement
Dominant language
C++
Stars
517
Forks
232
PR merge metrics
No merged PRs in 30d

Description

In case of a polygon and multi-polygon, the current implementation of simplify may generate self-intersecting polygons/multi-polygons. For the tilemaker project I have implemented a self-intersection aware simplify:

https://github.com/kleunen/boost_geometry_simplify

It makes sure that:
* The simplified inner and outer rings do not contain self-intersection
* The outer does not overlap the inners
* In case one inner overlaps another inner, it is combined into a single inner using union
* In case one polygon in a multipolygon overlaps another polygon, it is combined into a single polygon using a union

The simplification of the ring is performed using this algorithm:
https://www.jasondavies.com/simplify/

I believe this would be benificial for the boost geometry project and other projects as well.

Have a try here: https://godbolt.org/z/rhhxjenYP

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.