[postgis-users] PostGIS bugs? (ST_SimplifyPreserveTopology/isvalid)

pcreso at pcreso.com pcreso at pcreso.com
Thu Apr 16 14:31:09 PDT 2009


Hi,

I have just created a multipolygon column & populated it with a ST_SimplifyPreserveTopology SQL.

I checked the resulting geometries with isvalid() and found some errors.

I fixed these by editing the geometries with QGIS. The errors were small islands outside the major polygons in the original multipolygon, or small holes near the edge. When the geometry was simplified, these small polygons finished up as holes outside the polygon, or islands inside it, which I could find using isvalid(). I'm assuming any topological error found by isvalid() in a geometry produced by ST_SimplifyPreserveTopology() indicates a bug in ST_SimplifyPreserveTopology().


I exported the now validated column to shapefile with pgsql2shp which worked fine, but ogr2ogr failed to process this shapefile, with several errors of:

ERROR 1: Corrupted .shp file : shape 17 : panPartStart[0] = 0, nVertices = 0

I can skip these errors, but I'd hoped that ST_SimplifyPreserveTopology() & isvalid() would ensure my simplified geometries were free of such errors.

Ideally PostGIS should not generate such things, and isvalid() should identify such errors.

If it helps, the geometries are US ZCTA 5 digit polygons, & the version of PostGIS I'm using is:
postgis_full_version                            
-------------------------------------------------------------------------------------
 POSTGIS="1.3.5" GEOS="3.0.2-CAPI-1.4.2" PROJ="Rel. 4.6.1, 21 August 2008" USE_STATS




Thanks,

   Brent Wood




More information about the postgis-users mailing list