Re: [Geojson] Position Clarification
Stefan Hagen <stefan@dilettant.eu> Wed, 03 August 2022 05:01 UTC
Return-Path: <stefan@dilettant.eu>
X-Original-To: geojson@ietfa.amsl.com
Delivered-To: geojson@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8427EC13CCE3 for <geojson@ietfa.amsl.com>; Tue, 2 Aug 2022 22:01:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.103
X-Spam-Level:
X-Spam-Status: No, score=-7.103 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=dilettant.eu header.b=Y6EAwce3; dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=dilettant.eu header.b=bOLRVqK1
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6R62Z3mSH4XB for <geojson@ietfa.amsl.com>; Tue, 2 Aug 2022 22:01:50 -0700 (PDT)
Received: from mailrelay4-3.pub.mailoutpod1-cph3.one.com (mailrelay4-3.pub.mailoutpod1-cph3.one.com [46.30.212.13]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5098EC13CCE2 for <geojson@ietf.org>; Tue, 2 Aug 2022 22:01:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dilettant.eu; s=rsa1; h=content-type:subject:reply-to:cc:from:to:message-id:mime-version:date: references:in-reply-to:from; bh=s/wXXDJUz4gGYnZhEra7HMn2xxwYB+USGFt5dNV8B/0=; b=Y6EAwce3z/ccB9MJ9ceWHcbeN5/6C5H0QAQGJ3KvKSdtAjr+OlDz+1XRIIZdUhHoupT+O23JeB93g BjJBNzy94fspDC6z8PJc/ygSCUrm9Rf2KuCOCvYsR9HcaWjgrt1M1KfubcZDOTS+4QtOMCGGdKA0xx o1dRb8f7/ndR/yomNTE9e94sZyvGME9jiSfNXCFb/SLZvjixuIlSTMAUC5iBt3vaZQkNLhEFf6hJWU kl9/W5lFE3cpg8aruzHb+hpQJ2FsHb5ETMSPlAnNTg+rwWMCKj0EleXL00xNmlLfA0w5moaIYPkC40 tNl56Iw81gm1GxvqnEoic2V0L/wxEMQ==
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=dilettant.eu; s=ed1; h=content-type:subject:reply-to:cc:from:to:message-id:mime-version:date: references:in-reply-to:from; bh=s/wXXDJUz4gGYnZhEra7HMn2xxwYB+USGFt5dNV8B/0=; b=bOLRVqK1HE5bd2EU0mwj2Ye+XXLLJVebcuyqsmensZs8ZPHBWygh0OOx1htdRpIFcBfDxfl+y0cjZ e10xQ1yCg==
X-HalOne-Cookie: 61954701db1822ce2a29f54018113fdd6a3a19a9
X-HalOne-ID: 5e65ecae-12e9-11ed-8243-d0431ea8bb10
Received: from onecom-webmail-backend-production-65bcc99cff-krfb6 (service.pub.live1-k8s-cph3.one.com [46.30.212.67]) by mailrelay4.pub.mailoutpod1-cph3.one.com (Halon) with ESMTPSA id 5e65ecae-12e9-11ed-8243-d0431ea8bb10; Wed, 03 Aug 2022 05:01:43 +0000 (UTC)
X-Originating-IP: 2a02:1210:8ad6:da00:4481:6eec:f940:320c
User-Agent: One.com webmail 44.0.8
In-Reply-To: <CAPrYNa=dEQCckZ=AkAgtjjDceW9B_rXA-p6zxw8JEOay6Vt3dw@mail.gmail.com>
References: <CAPrYNak4-9QqecJpG19t39mCkq_0sxYBuWAvaTkb7epTJi_LCg@mail.gmail.com> <CAPrYNa=MtPzJGG9j-asR4iFrisWxzLLKcAmER7cdTg8g_zOH2A@mail.gmail.com> <12EFB7A1-49C7-4065-856C-EDEAF75A264E@intl-interfaces.com> <CAPrYNa=dEQCckZ=AkAgtjjDceW9B_rXA-p6zxw8JEOay6Vt3dw@mail.gmail.com>
Date: Wed, 03 Aug 2022 07:01:43 +0200
MIME-Version: 1.0
Message-ID: <1659502903368.6.100116@webmail-backend-production-65bcc99cff-2p92w>
To: Erik Seglem <erik.seglem@gmail.com>
From: Stefan Hagen <stefan@dilettant.eu>
Cc: Allan Doyle <adoyle@intl-interfaces.com>, geojson@ietf.org
Reply-To: stefan@dilettant.eu
Content-Type: multipart/alternative; boundary="----------100114-1659502903368-1"
Archived-At: <https://mailarchive.ietf.org/arch/msg/geojson/3xnHlR1RcjaXEjrzatp6gbq7GEk>
Subject: Re: [Geojson] Position Clarification
X-BeenThere: geojson@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: IETF GeoJSON WG <geojson.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/geojson>, <mailto:geojson-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/geojson/>
List-Post: <mailto:geojson@ietf.org>
List-Help: <mailto:geojson-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/geojson>, <mailto:geojson-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 03 Aug 2022 05:01:56 -0000
On3. August 2022 at 03:41:43 +02:00, Erik Seglem <<erik.seglem@gmail.com>> wrote/cited:
> Thanks for the response. I know it's probably digging way too far into it, and probably doesn't matter all that much. Just trying to be precise.
>
> RFC 7159 uses the phrase "decimal digits" while defining a number. And RFC 7946 uses a different phrase "decimal numbers." It uses the word "number" which has been defined and adds what seems to be a modifier "decimal" to it.
>
> If a Position is just an array of numbers why would additional qualifications be added to the definition? If the intent was to say "base 10" that was already accomplished in the definition of an array of numbers. However it states "The first two elements are ...precisely in that order and using decimal numbers." This reads as if it is adding an additional requirement to be "decimal numbers". And it's not just me reading it this way.
>
> Looking at some other geo related RFCs they do have it as optional. So it is definitely not far-fetched to believe it can be ignored. But all of the examples in RFC 7946 have chosen not to ignore the `.0` for some reason. That could just be personal preference or something more meaningful. It just makes me wonder when taken in conjunction with the above.
>
> RFC 5870 (Geo URI) section 3 [1] defines num, latitude, and longitude as optional decimal and additional digits.
> RFC 5491 (GEOPRIV) section 5 [2] says they are expressed using the lexical representation for "double" [3] which has more options but is also still optional.
>
> [1] <https://www.rfc-editor.org/rfc/rfc5870#section-3.3>
>
> [2] <https://www.rfc-editor.org/rfc/rfc5491#section-5>
> [3] <https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#double>
>
> Thanks,
> Erik
>
>
>
> On Tue, Aug 2, 2022 at 7:36 PM Allan Doyle <<adoyle@intl-interfaces.com>> wrote:
>
> > Hi Erik,
> >
> >
> > I think the key sentence In RFC 7159, section 6 [1] is the one that says:
> >
> >
> > "A number is represented in base 10 using decimal digits"
> >
> >
> > Which is meant to make clear that numbers may not be binary, octal, hexadecimal, etc.
> >
> >
> > RFC 7946 section 1.4 [2] states:
> >
> >
> > "the terms object, member, name, value, array, number, true, false, and null, are to be
> > interpreted as defined in [RFC7159].
> >
> >
> > The use of "decimal number" in RFC 7946 section 3.1.1 [3] is consistent with the meaning "base 10", and is not implying that a decimal point must be present.
> >
> >
> > [1] <https://www.rfc-editor.org/rfc/rfc7159#section-6>
> > [2] <https://www.rfc-editor.org/rfc/rfc7946#section-1.4>
> > [3] <https://www.rfc-editor.org/rfc/rfc7946#section-3.1.1>
> >
> >
> > I hope this helps.
> >
> >
> > Allan
> >
> >
> > > On Aug 2, 2022, at 5:26 PM, Erik Seglem <<erik.seglem@gmail.com>> wrote:
> > >
> > > I was looking over the spec and came across a bit that seems open to some level of interpretation. In 3.1.1 it says "A position is an array of numbers." And then goes on to specify the order and "using decimal numbers."
> > >
> > > The JSON RFC says the fractional part of a "number" is optional. But, to me, stating they are "decimal numbers" is an additional requirement on top of a "number".
> > >
> > > This seems to be backed up by the examples all having decimals in them, but doesn't seem to be consistent across implementations across the community. Some appear to allow integers, and some stick with floats.
> > >
> > > In looking around for answers a Stack Exchange question came up with the same question as mine: <https://gis.stackexchange.com/questions/429184/are-positions-without-decimals-valid-geojson> but no definitive answer either. I figured the best thing to do would be ask this group.
> > >
> > > I guess it comes down to is this a valid GeoJSON Point?
> > > {
> > > "type": "Point",
> > > "coordinates": [100, 0]
> > > }
> > >
> > > If in fact they do require a decimal place. Does that also apply to the elevation or just the long / lat? It seems to only say the first two elements must be decimal numbers, and the third is optional without that clarification.
> > >
> > > Would this be valid?
> > > {
> > > "type": "Point",
> > > "coordinates": [100.0, 0.0, 124]
> > > }
> > >
> > > And what about bounding boxes? The spec says it's an array and specifies the length, but not the type of the values.
> > >
> > > Would this be valid?
> > > {
> > > "type": "Feature",
> > > "bbox": [-10, -10, 10, 10],
> > > "geometry": {
> > > "type": "Polygon",
> > > "coordinates": [
> > > [
> > > [-10.0, -10.0],
> > > [10.0, -10.0],
> > > [10.0, 10.0],
> > > [-10.0, -10.0]
> > > ]
> > > ]
> > > }
> > > //...
> > > }
> > >
> > > Thanks,
> > > Erik
> > > _______________________________________________
> >
> >
> >
> >
I like the scope for numbers in JSON as stated in the introduction of ISO/IEC-21778:217(en):
"JSON is agnostic about the semantics of numbers. In any programming language, there can
be a variety of number types of various capacities and complements, fixed or floating, binary
or decimal. That can make interchange between different programming languages difficult.
JSON instead offers only the representation of numbers that humans use: a sequence of digits.
All programming languages know how to make sense of digit sequences even if they disagree
on internal representations. That is enough to allow interchange." (and ECMA-404 of course)
JSON is a static representation part. The use case of GeoJSON is dynamic and focusing on
exchange, i.e. producing, transporting, and consuming the data through an intermediary host
processor. For example: the number 42 (as written here) is a completely valid member of the set
of the mathematical real numbers. Wun consumer may end up with an integer value in her
language, another may continue using 42.0 or even 42.000000000001. Who knows ...
JSON never even (hard-)limited the number of digits nor did the underlying cause for the
existence of JSON (the host language javascript) ever care about integers - in there, all such
numbers are stored as IEEE 754 floats.
In my experience, guaranteeing roundtrips preserving "nothingness" - like floats with a fractional
part of zero - is not possible without interpreting every number as a string on the processing side
(producer and consumer alike).
Also, specification prose is hard, esp. when sandwiched between a schema (explicit or not) and
code examples. How does one know, if a prose not stating "Decimal Numerals" but instead
"Decimal Numbers" really meant the former - or, like Alan wrote, instead the decimal base used
in representing? As an editor I would love to either convey some information in prose or use an
underlying computer constraint language, but often have to do both and risk inconsistency and misunderstanding.
I am sure we could have used ASN.1 to solve all ambiguities, but instead chose the pragmatic JSON
as vocabulary to formulate what the community (long before I joined) had found to be an optimal
format to exchange geographical feature data. Not ideal for everyone, but optimal.
All the best,
Stefan
- [Geojson] Position Clarification Erik Seglem
- Re: [Geojson] Position Clarification Allan Doyle
- Re: [Geojson] Position Clarification Erik Seglem
- Re: [Geojson] Position Clarification Stefan Hagen
- Re: [Geojson] Position Clarification Erik Seglem
- Re: [Geojson] Position Clarification Sean Gillies