[geos-devel] geometry validation and simplfiy problem

Martin Davis mbdavis at VividSolutions.com
Fri Jul 14 12:32:42 EDT 2006


Not currently, but it would be nice to have.  I have done some work in
this direction, but it's not really in a releasable state.

When you "simplify" a polygon with a hole which crosses outside the
outer shell, what happens to the part that is outside?  Does it
disappear, or become another polygon?

One thing you can do which should work almost all the time is to run
buffer(0) on the invalid polygon.  Buffer is very tolerant of bad
topology, and will generally fix the polygon in the way I suspect you
are looking for.

Martin Davis, Senior Technical Architect
Vivid Solutions Inc.      www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046


> -----Original Message-----
> From: geos-devel-bounces at geos.refractions.net 
> [mailto:geos-devel-bounces at geos.refractions.net] On Behalf Of 
> zhangjing
> Sent: July 14, 2006 2:33 AM
> To: GEOS Development List
> Subject: [geos-devel] geometry validation and simplfiy problem
> 
> 
> hi, all
> 
> im developing a vector map editor using geos library as 
> spatial engine, and the user's input may not comform to 
> normalized geometry, ie the shell may cross holes. The input 
> are always multiple LineRing. and i wonder if there is any 
> method in geos to make these multiple LineRing a normalized 
> geometry (Multipolygon, or Polygon with correct shell/hole 
> relations). 
> 
> In ArcObjects, ITopologicalOperator->Simplify can do the job, 
> here is a description of the function.
> 
> Simplify permanently alters the input geometry so that the 
> geometry becomes topologically consistent.  For Point 
> Collections, this means that all duplicate Points (Points 
> with the same X and Y coordinates) are removed (unless they 
> are attribute aware and have different attributes).  For 
> Segment Collections, this means that all duplicate Segments 
> are removed, all Crossing Segments are split into 
> non-crossing segments (The crossing point becomes a vertex 
> for all of the connected segments), all overlapping segments 
> are broken into non-overlapping segments (the overlap becomes 
> a new Segment), and all non-connected Paths are connected.  
> For Polygons, this means that all overlapping Rings are split 
> into non-overlapping Rings, all Exterior and Interior Rings 
> have the proper orientation, and all non-closed Rings are closed. 
> 
> so, is there any way to do this in geos?
> 
> TIA
> Jing Zhang.
> 
> 
> 
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net 
> http://geos.refractions.net/mailman/listinfo/g> eos-devel
> 



More information about the geos-devel mailing list