# [OSM-talk] Valid geometry for closed ways

Iván Sánchez Ortega ivan at sanchezortega.es
Fri Aug 20 13:02:53 BST 2010

```El día Friday 20 August 2010 13:00:08, Sebastian Klein dijo:
> what are valid geometries for closed ways that represent an area?

If you want polygons to behave as in "paleo" GIS, you should refer to the
industry standars. Specifically, to
http://www.opengeospatial.org/standards/sfa , version 1.2.1, page 26:

a) Polygons are topologically closed;
b) The boundary of a Polygon consists of a set of LinearRings that make up its
exterior and interior boundaries;
c) No two Rings in the boundary cross and the Rings in the boundary of a
Polygon may intersect at a Point but only as a tangent, e.g.
∀ P ∈ Polygon, ∀ c1,c2∈P.Boundary(), c1≠c2,
∀ p, q ∈Point, p, q ∈ c1, p ≠ q ,
[p ∈ c2] ⇒ [∃ δ > 0 ∍ [|p-q|<δ] ⇒ [q ∉ c2] ];
d) A Polygon may not have cut lines, spikes or punctures e.g.:
∀ P ∈ Polygon, P = P.Interior.Closure;
e) The interior of every Polygon is a connected point set;
f) The exterior of a Polygon with 1 or more holes is not connected. Each hole
defines a connected component of the exterior.

Pay attention to "e": The interior of a polygon is a connected point set. In
your example, the polygon is two connected point sets.

BTW: please refer to Wikipedia about those tricky topological operators. I'm
not an expert in topology anyway :-)

P.S.: Don't you just love all those UTF-8 math operators?

Best,
--
Iván Sánchez Ortega <ivan at sanchezortega.es>

Un ordenador no es una televisión ni un microondas: es una herramienta
compleja.

```