[netmod] Justification for decimal64 over string for floating point values in geo location data?

Christian Hopps <chopps@chopps.org> Tue, 07 July 2020 11:06 UTC

Return-Path: <chopps@chopps.org>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BD06C3A0B21 for <netmod@ietfa.amsl.com>; Tue, 7 Jul 2020 04:06:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y60JlQrHQuh3 for <netmod@ietfa.amsl.com>; Tue, 7 Jul 2020 04:06:22 -0700 (PDT)
Received: from smtp.chopps.org (smtp.chopps.org [54.88.81.56]) by ietfa.amsl.com (Postfix) with ESMTP id 95DEA3A0B1F for <netmod@ietf.org>; Tue, 7 Jul 2020 04:06:22 -0700 (PDT)
Received: from stubbs.int.chopps.org (047-050-069-038.biz.spectrum.com [47.50.69.38]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by smtp.chopps.org (Postfix) with ESMTPSA id 1236C60F05; Tue, 7 Jul 2020 11:06:21 +0000 (UTC)
From: Christian Hopps <chopps@chopps.org>
Content-Type: multipart/signed; boundary="Apple-Mail=_9234486F-6E4F-4DD9-B0B7-B7C55E9933FC"; protocol="application/pgp-signature"; micalg="pgp-sha512"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\))
Message-Id: <B548C4B4-2A97-4736-A6B2-358D1491D125@chopps.org>
Date: Tue, 07 Jul 2020 07:06:20 -0400
To: NetMod WG <netmod@ietf.org>
X-Mailer: Apple Mail (2.3608.80.23.2.2)
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/dA9olZfEVa3clGdfvNYEFXUEMJw>
Subject: [netmod] Justification for decimal64 over string for floating point values in geo location data?
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 07 Jul 2020 11:06:24 -0000

I received feedback in my YANG doctor review (thanks Mahesh) regarding the use of decimal64 for most of the values in the geo location grouping (https://tools.ietf.org/html/draft-ietf-netmod-geo-location-04). In my comparison sections I note that some precision (at the very extremes) may be lost when converting from other geo location formats that use string (or double for w3c) to decimal64. Given that mention of loss of extreme precision, the reviewer was asking if some justification for the decimal64 should be given in the document.

What are the advantages to using decimal64 for floating point numbers vs using a string with a pattern "[0-9]+(\.[0-9]+)?" (convert that to yang pattern language). The advantage of using a string is that the precision of the value is not restricted by the model. Does the YANG decimal64 values have a concise binary format that can be more efficiently transported or stored in binary form? If so is this the only advantage, and is it enough of one to limit the precision in the model?

It's definitely worth noting that the precision of the decimal64 values seem vastly adequate for geo location data (e.g., for Cartesian coordinates and height values which are measured in meters the fractional digits is 6 which means the surface could be up to 9 billion kilometers large (or away from for height) and the precision is to the micrometer. For ellipsoidal coordinates there are 12 fractional digits for the degrees.

Thanks,
Chris.