Subject: [Geojson] [Technical Errata Reported] RFC7946 (5069)

From: RFC Errata System <[email-masked]>
Date: Fri, 14 Jul 2017 08:44:33 -0700 (PDT)

The following errata report has been submitted for RFC7946,
"The GeoJSON Format".

--------------------------------------
You may review the report below and at:
http://www.rfc-editor.org/errata/eid5069

--------------------------------------
Type: Technical
Reported by: Clark Archer <[email-masked]>

Section: 3.1.6

Original Text
-------------
3.1.6.  Polygon

   To specify a constraint specific to Polygons, it is useful to
   introduce the concept of a linear ring:

   o  A linear ring is a closed LineString with four or more positions.

   o  The first and last positions are equivalent, and they MUST contain
      identical values; their representation SHOULD also be identical.

   o  A linear ring is the boundary of a surface or the boundary of a
      hole in a surface.

   o  A linear ring MUST follow the right-hand rule with respect to the
      area it bounds, i.e., exterior rings are counterclockwise, and
      holes are clockwise.

   Note: the [GJ2008] specification did not discuss linear ring winding
   order.  For backwards compatibility, parsers SHOULD NOT reject
   Polygons that do not follow the right-hand rule.

   Though a linear ring is not explicitly represented as a GeoJSON
   geometry type, it leads to a canonical formulation of the Polygon
   geometry type definition as follows:

   o  For type "Polygon", the "coordinates" member MUST be an array of
      linear ring coordinate arrays.

   o  For Polygons with more than one of these rings, the first MUST be
      the exterior ring, and any others MUST be interior rings.  The
      exterior ring bounds the surface, and the interior rings (if
      present) bound holes within the surface.

Corrected Text
--------------
3.1.6.  Polygon

   To specify a constraint specific to Polygons, it is useful to
   introduce the concept of a linear ring:

   o  A linear ring is a closed LineString with four or more positions.

   o  The first and last positions are equivalent, and they MUST contain
      identical values; their representation SHOULD also be identical.

   o  A linear ring is the boundary of a surface or the boundary of a
      hole in a surface.

   o  A linear ring MUST follow the right-hand rule with respect to the
      area it bounds, i.e., exterior rings are clockwise, and holes are
      counterclockwise.

   Note: the [GJ2008] specification did not discuss linear ring winding
   order.  For backwards compatibility, parsers SHOULD NOT reject
   Polygons that do not follow the right-hand rule.

   Though a linear ring is not explicitly represented as a GeoJSON
   geometry type, it leads to a canonical formulation of the Polygon
   geometry type definition as follows:

   o  For type "Polygon", the "coordinates" member MUST be an array of
      linear ring coordinate arrays.

   o  For Polygons with more than one of these rings, the first MUST be
      the exterior ring, and any others MUST be interior rings.  The
      exterior ring bounds the surface, and the interior rings (if
      present) bound holes within the surface.

Notes
-----
This is only for the bullet point describing the right-hand rule for linear rings. It seems like the clockwise/counterclockwise descriptions are the opposite of the right-hand rule. Walking an exterior ring in a counterclockwise direction would have the exterior of the ring to the right of the observer.

Instructions:
-------------
This erratum is currently posted as "Reported". If necessary, please
use "Reply All" to discuss whether it should be verified or
rejected. When a decision is reached, the verifying party  
can log in to change the status and edit the report, if necessary. 

--------------------------------------
RFC7946 (draft-ietf-geojson-04)
--------------------------------------
Title               : The GeoJSON Format
Publication Date    : August 2016
Author(s)           : H. Butler, M. Daly, A. Doyle, S. Gillies, S. Hagen, T. Schaub
Category            : PROPOSED STANDARD
Source              : Geographic JSON
Area                : Applications and Real-Time
Stream              : IETF
Verifying Party     : IESG

---

From: Martin Thomson <[email-masked]>
Date: Sat, 15 Jul 2017 03:42:38 +1000

My understanding is that the polygon definition follows the accepted
norms for point order. GML defines the shape this way.  Section 5.1 of
RFC 5491: https://tools.ietf.org/html/rfc5491#section-5.1 also uses
counter-clockwise point order: the upward normal points up!  See also
Appendix B of RFC 7459 https://tools.ietf.org/html/rfc7459#appendix-B

My understanding of the right hand rule being curled fingers on the
right hand follow the points and the thumb becomes the upward normal.

I think that we should reject this erratum, but can someone else
double-check that I'm not off base?

---

From: James Winterbottom <[email-masked]>
Date: Sat, 15 Jul 2017 03:57:08 +1000

+1 for Martin's position

Sent from my iPhone

> On 15 Jul 2017, at 3:42 am, Martin Thomson <[email-masked]> wrote:
> 
> _______________________________________________
> GeoJSON mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/geojson

---

From: Martin Thomson <[email-masked]>
Date: Sat, 15 Jul 2017 04:09:41 +1000

(Admin note: the number of recipients on this thread is
extraordinarily high, so I've trimmed the number of recipients so that
I don't have to play mailman on every message.  Back to your scheduled
programming.)

---

From: Carl Reed <[email-masked]>
Date: Fri, 14 Jul 2017 14:38:32 -0600

Martin -

+1

With some more background information. GML version 3.0 and later is
agnostic as to the order of the coordinates used to defined the exterior
and/or interior rings of a polygon. I did not check GML 2.x.

That said, Evan Rouault wrote an extensive technical blog on all of the
different ways that a developer can code a polygon as GML:
http://erouault.blogspot.com/2014/04/gml-madness.html . As one quickly see,
GML (and the ISO standard GML is based on - 19107) leaves a rather large
amount of wiggle room on how polygons can be encoded. The assumption is
that profiles and application schemas (such as 5491) will specify
additional implementation requirements such as winding order for polygons.

Therefore, any guidance on how to consistently define a polygon in GeoJSON
(or GML) is a good thing. This is why RFC 5491 Clause 5.1 clearly specifies
the order. Any reduction in ambiguity in cases such as this is a good idea
and helps interoperability. I suspect that the addition of gml:Polygon in
GML 3.2 and later was partly in response to this issue (along with having a
more compact encoding for polygons).

Hope this helps. My sense is that the winding order specified in GeoJSON
should be consistent with other IETF RFCs - specifically RFC 5491. One last
consideration. The OGC KML standard is also agnostic on winding order. The
keywords "exterior" and "interior" are used - just as in GML.

Regards

Carl

On Fri, Jul 14, 2017 at 11:42 AM, Martin Thomson <[email-masked]>
wrote:

> > This is only for the bullet point describing the right-hand rule for
> linear rings. It seems like the clockwise/counterclockwise descriptions are
> the opposite of the right-hand rule. Walking an exterior ring in a
> counterclockwise direction would have the exterior of the ring to the right
> of the observer.
> >
> > Instructions:
> > -------------

-- 
Carl Reed, PhD
Carl Reed and Associates

Mobile: 970-402-0284

“Our liberty depends on the freedom of the press, and that cannot be
limited without being lost.”

— Thomas Jefferson, U.S. Founding Father