Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#1135 closed defect (fixed)

setPrecision crashes when collapsing linearring

Reported by: caspervdw Owned by: geos-devel@…
Priority: major Milestone: 3.10.1
Component: Default Version: main
Severity: Significant Keywords:
Cc:

Description

The following command (through pygeos) results in a segmentation fault:

pygeos.set_precision(pygeos.Geometry("LINEARRING (0 0, 0.1 0, 0.1 0.1, 0 0.1, 0 0)"), 1.0, flags="make_valid")

It is just the linearrings, linestrings and polygons with the same coordinates give correct results (empty geometries).

Change History (6)

comment:1 by caspervdw, 3 years ago

The same geometry with KEEP_COLLAPSED gives the surprising result LINESTRING (0 0, 0 0, 0 0)

comment:2 by Paul Ramsey <pramsey@…>, 2 years ago

In 5e44ec3/git:

Check for empty Sequence when collapsing linear ring. References #1135

comment:3 by Paul Ramsey <pramsey@…>, 2 years ago

In 14f0a69/git:

Check for empty Sequence when collapsing linear ring. References #1135

comment:4 by Paul Ramsey <pramsey@…>, 2 years ago

In b14c228/git:

Fix crasher reducing LinearRing precision, references #1135

comment:5 by pramsey, 2 years ago

Resolution: fixed
Status: newclosed

Yep, the algorithm feels that a valid linestring is "better" than a collapsed zero-area (self-intersecting) ring. Angels dance.

comment:6 by caspervdw, 2 years ago

Thanks for the fix!

Note: See TracTickets for help on using tickets.