[postgis-devel] [PostGIS] #399: ST_CleanGeometry

PostGIS trac at osgeo.org
Sat Feb 13 10:53:31 PST 2010


#399: ST_CleanGeometry
----------------------+-----------------------------------------------------
  Reporter:  strk     |       Owner:  strk         
      Type:  task     |      Status:  assigned     
  Priority:  medium   |   Milestone:  PostGIS 2.0.0
 Component:  postgis  |     Version:               
Resolution:           |    Keywords:               
----------------------+-----------------------------------------------------
Comment (by kneufeld):

 It does sound like we're talking about requirements and expectations for
 different functions.

 Paul, I do like your idea of a tolerance.  I think this is common use case
 - users wanting to remove jitter from their geometries.  But how does one
 define jitter based on tolerance?  Jitter could be removed by running
 through Douglas-Peuker, except that it may not be desirable to also
 simplify the geometry.  So, having something that removes that small loop
 or collapsed portion of a polygon is good.  This sounds like it could be a
 wrapper for Sandro's proposed contract that never drops a vertex - a
 function that compares the input and resultant geometries, dropping all of
 lower dimension and proportional size.

 Sandro, if the functional contract is to never drop a vertex (which I
 think is a good idea) *and* never returns a collection, I think you're
 right, you'll be returning null an awful lot.  Nevertheless, this too
 could be a simple sql wrapper function.  IF geometrytype(resultant_geom) =
 'GEOMETRYCOLLECTION' return null;

 Personally, I like the proposed contract.  Same dimension, no dropped
 vertices, is_valid, (and maybe is_simple) - a function similar to
 buffer(0) that deconstructs all input geometries and rebuilds as best as
 it can.  Non-simple points and lines are made simple, non-valid polygons
 are made valid, collections are created where necessary.  Wrappers (or
 parameters I suppose) can then be used to filter the resultset.  My 2
 cents.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/399#comment:20>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list