Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pramsey
Copy link
Member

@pramsey pramsey commented Feb 5, 2024

References GH-1031

@pramsey pramsey merged commit 6e15c6c into libgeos:main Feb 5, 2024
pramsey added a commit that referenced this pull request Feb 5, 2024
@pramsey pramsey deleted the main-1031 branch July 3, 2024 20:18
{}
{
for (const Geometry* g: m_input) {
if (!g->isPolygonal())
Copy link
Contributor

@jorisvandenbossche jorisvandenbossche Mar 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think isPolygonal can return true for GeometryCollections that contain polygons. But the simplifier code will still segfault for this as well (noticed while implementing the bindings in shapely in shapely/shapely#2241).

Using geosop:

# GeometryCollection of polygons -> fine
$ geosop -a "GEOMETRYCOLLECTION (POLYGON ((0 10, 10 10, 10 7, 10 3, 10 0, 0 0, 0 10)), POLYGON ((10 10, 20 10, 20 0, 10 0, 10 3, 10 7, 10 10)))" coverageSimplify 1.0
POLYGON ((10 10, 10 0, 0 0, 0 10, 10 10))
POLYGON ((10 10, 20 10, 20 0, 10 0, 10 10))
# GeometryCollection of polygon and collection -> segfaults
$ geosop -a "GEOMETRYCOLLECTION (POLYGON ((0 10, 10 10, 10 7, 10 3, 10 0, 0 0, 0 10)), GEOMETRYCOLLECTION (POLYGON ((10 10, 20 10, 20 0, 10 0, 10 3, 10 7, 10 10))))" coverageSimplify 1.0
Segmentation fault (core dumped)

(and using a nested GeometryCollection here because we first collect the array of input geometries (which can contain a collection) in a collection)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened a new issue to track this -> #1250

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants