Credit where credit is due-the cleanGeometry function listed below is written by Horst Duester.
Best, Steve http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather Geographic Information Systems (GIS) Manager (216) 635-3243 s...@clevelandmetroparks.com <http://www.clemetparks.com/> clevelandmetroparks.com From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Stephen V. Mather Sent: Monday, April 16, 2012 12:33 PM To: postgis-users@postgis.refractions.net Subject: [postgis-users] ST_MakeValid Hi All, Has anyone done any performance tests on ST_MakeValid? I had been using Tim Sutton's cleanGeometry function from circa 2010 (http://linfiniti.com/2010/07/cleaning-geometries-inside-postgis/) to clean up geometries. Works most of the time-every now and then I throw it something too big and harry and it runs for weeks and weeks and never (AFAI have the patience for) completes. I've been looking forward to ST_MakeValid. Today, a new Postgis 2.0 instance in hand, I was playing with a dataset with 9106 invalid geometries-all self intersecting geometries from raster-->vector conversion in an un-named proprietary package. On a whim, I decided to compare the speed of ST_MakeValid to Tim's code, so first I needed the correct functions: psql -U postgres -d test -f "C:\Program Files\PostgreSQL\9.1\share\contrib\postgis-2.0\legacy.sql" Then a quick run through cleanGeometry: CREATE TABLE tpi_clean AS SELECT gid, id, gridcode, "class name", cleanGeometry(geom) FROM tpi; And I get back: Query returned successfully: 1004952 rows affected, 955444 ms execution time. If I run as ST_MakeValid, CREATE TABLE tpi_valid AS SELECT gid, id, gridcode, "class name", ST_MakeValid(geom) FROM tpi; At 2300000 milliseconds, it is still running. . This is PostgreSQL 9.1, PostGIS 2.0 USE_GEOS=1 USE_PROJ=1 USE_STATS=1, on Windows XP 32-bit. I have not yet tested on my Ubuntu box. . Thanks, Best, Steve http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather Geographic Information Systems (GIS) Manager (216) 635-3243 s...@clevelandmetroparks.com <http://www.clemetparks.com/> clevelandmetroparks.com
<<image002.png>>
_______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users