8

There are two different ways the polygon below can be represented:

polygon with hole touching shell

  • In ESRI-land, the polygon would be modeled as a single exterior ring that loops back on itself.
  • In the OGC world, it would be modeled as a polygon with an exterior ring and an interior ring.

Does the GeoJSON format require that either one of these approaches be used over the other?

1 Answer 1

7

Polygons are not simple to handle and there are more than two worlds. I recommend to read this article "About Invalid, Valid and Clean Polygons" http://www.springer.com/%3FSGWID%3D5-102-45-124048-p32597622

The GeoJSON specification https://www.rfc-editor.org/rfc/rfc7946 says that "GeoJSON comprises the seven concrete geometry types defined in the OpenGIS Simple Features Implementation Specification for SQL [SFSQL]". You can get that one from http://portal.opengeospatial.org/files/?artifact_id=829 and try to understand it. I couldn't really. However, the authors of the "About Invalid, Valid and Clean Polygons" have made a test with test polygon 4b (pages 10 and 11) and result was "R3". I guess that it means that by OGC Simple Feature Access the self-touching outer ring is invalid and therefore it should be invalid in GeoJSON as well. But somehow I fear that interpretations in real life may vary.

Given that GeoJSON is to large extent a MapBox driven standard, this ticket about MapBox vector tiles https://github.com/tilezen/mapbox-vector-tile/issues/63 suggest that it would be better to avoid writing self-touching outer boundaries. However, programs which read GeoJSON should probably accept both variants.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.