[postgis-devel] [PostGIS] #1806: Extremely slow and CPU-intensive ST_MakeValid (ST_BuildArea) case

PostGIS trac at osgeo.org
Sat May 12 11:52:22 PDT 2012


#1806: Extremely slow and CPU-intensive ST_MakeValid (ST_BuildArea) case
----------------------+-----------------------------------------------------
  Reporter:  strk     |       Owner:  strk         
      Type:  defect   |      Status:  closed       
  Priority:  high     |   Milestone:  PostGIS 2.0.1
 Component:  postgis  |     Version:  2.0.x        
Resolution:  fixed    |    Keywords:               
----------------------+-----------------------------------------------------

Comment(by aperi2007):

 >@aperi2007: the polygon is actually invalid acc. to the OGC rules because
 the inner
 >ring (grey ring) separate the outer ring into 2 separate polygons. The
 rules of the
 >OGC state, among others, that the inteterior of a polygon must be
 connected.

 Sorry, I forgot the connected rule.
 The polygon is invalid.

 >The only solution is to split the polygon into 2 polygons (which means
 that the >inner ring disappears, indeed).

 Of course this is the only valid solution.

 >ST_MakeValid does not return per se a POLYGON, but a GEOMETRYCOLLECTION
 which can >contain a MULTIPOLYGON, to cope with these situations.

 Yes , the ST_MakeValid must try to maintain the original type when this is
 possible.
 In this sample this is not possible , so it will return a more complex
 type.

 Just as puntualize question:
 the st_makevalid never return a set of records, it return always one only
 record. If the geometry invalid is more complex, the MakeValid will
 produce an unique geometrycollection with as many polygon or multipolygons
 and/or lines and/or points to cover all the vertexs of the original
 geometry.
 The important is that is wll return always one only record.
 Is this the strategy you follow also ?

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1806#comment:19>
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