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

Martin Davis mbdavis at refractions.net
Thu Apr 16 16:07:38 PDT 2009


This is a known bug with the SimplifyPreserveTopology in both JTS and 
GEOS.  Hopefully it will be fixed soon.  It's not a difficult fix, but 
it requires some resources (funding) to git 'er done.

pcreso at pcreso.com wrote:
> 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
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>   

-- 
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022




More information about the postgis-users mailing list