Opened 12 years ago

Closed 11 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: master
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 by strk, 12 years ago

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 by strk, 12 years ago

Cc: mtnclimb@… added

This is likely a JTS bug

comment:4 by pramsey, 12 years ago

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 by strk, 12 years ago

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

comment:6 by strk, 12 years ago

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

comment:7 by strk, 11 years ago

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.