Opened 9 years ago

Closed 8 years ago

#1545 closed defect (fixed)

ST_SimplifyPreserveTopology creates invalid geometries [fixed by GEOS-3.3.4]

Reported by: strk Owned by: pramsey
Priority: medium Milestone: PostGIS GEOS
Component: postgis Version: main
Keywords: Cc: mtnclimb@…

Description

When simplifying a closed linestring by a tolerance higher than the max extent dimension such closed linestring becomes formed by 2 equal points, which makes it invalid.

I belive the whole point of preserving topology should be preventing such occurrences.

Change History (7)

comment:1 Changed 9 years ago by strk

Example:

=# select ST_AsText(geom), ST_IsValid(geom), st_astext(ST_SimplifyPreserveTopology(geom,200)), ST_IsValid(ST_SimplifyPreserveTopology(geom, 200)) from ( select 'LINESTRING(0 0, 5 0, 5 5, 0 0)'::geometry as geom ) as f;
NOTICE:  Too few points in geometry component at or near point 0 0
-[ RECORD 1 ]---------------------------
st_astext  | LINESTRING(0 0,5 0,5 5,0 0)
st_isvalid | t
st_astext  | LINESTRING(0 0,0 0)
st_isvalid | f

comment:2 Changed 9 years ago by strk

Cc: mtnclimb@… added

This is likely a JTS bug

comment:4 Changed 9 years ago by pramsey

Milestone: PostGIS 2.0.0PostGIS 2.1.0

A GEOS bug, not a blocker for 2.0 (it's not new, it's been around forever), so I'm pushing forward.

comment:5 Changed 9 years ago by strk

Martin fixed this in JTS. See the GEOS part of this here: http://trac.osgeo.org/geos/ticket/510

comment:6 Changed 9 years ago by strk

Milestone: PostGIS 2.1.0PostGIS GEOS
Summary: ST_SimplifyPreserveTopology creates invalid geometriesST_SimplifyPreserveTopology creates invalid geometries [fixed by GEOS-3.3.4]

comment:7 Changed 8 years ago by strk

Resolution: fixed
Status: newclosed

Nothing to do here, it's fixed by upgrading GEOS to 3.3.4+

Note: See TracTickets for help on using tickets.