<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rfc [
 <!ENTITY nbsp    "&#160;">
 <!ENTITY zwsp   "&#8203;">
 <!ENTITY nbhy   "&#8209;">
 <!ENTITY wj     "&#8288;">
]> 

<rfc ipr="trust200902" docName="draft-ietf-netmod-geo-location-11" number="9179" submissionType="IETF" category="std" consensus="true" updates="" obsoletes="" xmlns:xi="http://www.w3.org/2001/XInclude" tocInclude="true" sortRefs="true" symRefs="true" xml:lang="en" version="3">

  <front>
    <title abbrev="A YANG Grouping for Geographic Locations">A YANG Grouping for Geographic Locations</title>
<seriesInfo name="RFC" value="9179"/>
<author initials='C.' surname='Hopps' fullname='Christian Hopps'><organization>LabN Consulting, L.L.C.</organization><address><email>chopps@chopps.org</email></address></author>  

<date year="2022" month="February" />

<keyword>geolocation</keyword>

<abstract><t>This document defines a generic geographical location YANG grouping.
The geographical location grouping is intended to be used in YANG
data models for specifying a location on or in reference to Earth or any
other astronomical object.</t></abstract>  </front>  <middle>

<section title="Introduction">
<t>In many applications, we would like to specify the location of something
geographically. Some examples of locations in networking might be the location
of data centers, a rack in an Internet exchange point, a router, a firewall, a
port on some device, or it could be the endpoints of a fiber, or perhaps the
failure point along a fiber.</t>

<t>Additionally, while this location is typically relative to Earth,
it does not need to be. Indeed, it is easy to imagine a network or
device located on the Moon, on Mars, on Enceladus (the moon of
Saturn), or even on a comet (e.g., 67p/churyumov-gerasimenko).</t>

<t>Finally, one can imagine defining locations using different frames
of reference or even alternate systems (e.g., simulations or
virtual realities).</t>

<t>This document defines a '<tt>geo-location</tt>' YANG grouping that allows for
all the above data to be captured.</t>

<t>This specification conforms to <xref target="ISO.6709.2008"/>.</t>

<t>The YANG data model described in this document conforms to the
Network Management Datastore Architecture (NMDA) defined in <xref target="RFC8342"/>.</t>

<section title="Terminology">


        <t>
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
    NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>





</section>

</section>

<section title="The Geolocation Object">
<section title="Frame of Reference" anchor="sec-frame-of-reference">
<t>The frame of reference ('<tt>reference-frame</tt>') defines what the
location values refer to and their meaning. The referred-to
object can be any astronomical body. It could be a planet such as
Earth or Mars, a moon such as Enceladus, an asteroid such as
Ceres, or even a comet such as 1P/Halley. This value is specified
in '<tt>astronomical-body</tt>' and is defined by the <eref target="http://www.iau.org" brackets="angle">International
Astronomical Union</eref>. The default '<tt>astronomical-body</tt>' value is
'<tt>earth</tt>'.</t>

<t>In addition to identifying the astronomical body, we also need to define
the meaning of the coordinates (e.g., latitude and longitude) and the
definition of 0-height. This is done with a '<tt>geodetic-datum</tt>' value. The
default value for '<tt>geodetic-datum</tt>' is '<tt>wgs-84</tt>' (i.e., the World
Geodetic System <xref target="WGS84"/>), which is used by the Global
Positioning System (GPS) among many others. We define an IANA registry for
specifying standard values for the '<tt>geodetic-datum</tt>'.</t>

<t>In addition to the '<tt>geodetic-datum</tt>' value, we allow overriding the
coordinate and height accuracy using '<tt>coord-accuracy</tt>' and
'<tt>height-accuracy</tt>', respectively. When specified, these values
override the defaults implied by the '<tt>geodetic-datum</tt>' value.</t>

<t>Finally, we define an optional feature that allows for changing the system
for which the above values are defined. This optional feature adds an
'<tt>alternate-system</tt>' value to the reference frame.  This value is
normally not present, which implies the natural universe is the system. The use
of this value is intended to allow for creating virtual realities or perhaps
alternate coordinate systems. The definition of alternate systems is outside
the scope of this document.</t>

</section>

<section title="Location">
<t>This is the location on, or relative to, the astronomical object.  It is
specified using two or three coordinate values. These values are given either as
'<tt>latitude</tt>', '<tt>longitude</tt>', and an optional '<tt>height</tt>', or as
Cartesian coordinates of '<tt>x</tt>', '<tt>y</tt>', and '<tt>z</tt>'. For the
standard location choice, '<tt>latitude</tt>' and '<tt>longitude</tt>' are
specified as decimal degrees, and the '<tt>height</tt>' value is in fractions of
meters. For the Cartesian choice, '<tt>x</tt>', '<tt>y</tt>', and '<tt>z</tt>' are
in fractions of meters. In both choices, the exact meanings of all the values
are defined by the '<tt>geodetic-datum</tt>' value in <xref
target="sec-frame-of-reference"></xref>.</t>

</section>

<section title="Motion">
<t>Support is added for objects in relatively stable motion. For objects in
relatively stable motion, the grouping provides a three-dimensional vector
value. The components of the vector are '<tt>v-north</tt>', '<tt>v-east</tt>', and
'<tt>v-up</tt>', which are all given in fractional meters per second. The values
'<tt>v-north</tt>' and '<tt>v-east</tt>' are relative to true north as defined by
the reference frame for the astronomical body; '<tt>v-up</tt>' is perpendicular
to the plane defined by '<tt>v-north</tt>' and '<tt>v-east</tt>', and is pointed
away from the center of mass.</t>

<t>To derive the two-dimensional heading and speed, one would use the
following formulas:</t>

<artwork><![CDATA[
              ,------------------------------
    speed =  V  v_{north}^{2} + v_{east}^{2}

    heading = arctan(v_{east} / v_{north}) 
]]></artwork>
<t>For some applications that demand high accuracy and where the data is
infrequently updated, this velocity vector can track very slow movement such
as continental drift.</t>

<t>Tracking more complex forms of motion is outside the scope of
this work. The intent of the grouping being defined here is to
identify where something is located, and generally this is
expected to be somewhere on, or relative to, Earth (or another
astronomical body).

At least two options are available to YANG data models that wish to use this
grouping with objects that are changing location frequently in non-simple
ways.  A data model can either add additional motion data to its model
directly, or if the application allows, it can require more frequent queries
to keep the location data current.

</t>

</section>

<section title="Nested Locations">
<t>When locations are nested (e.g., a building may have a location that houses
routers that also have locations), the module using this grouping is free to
indicate in its definition that the '<tt>reference-frame</tt>' is inherited from
the containing object so that the '<tt>reference-frame</tt>' need not be
repeated in every instance of location data.</t>

</section>

<section title="Non-location Attributes">
<t>During the development of this module, the question of whether it
would support data such as orientation arose. These types of
attributes are outside the scope of this grouping because they do
not deal with a location but rather describe something more about
the object that is at the location. Module authors are free to
add these non-location attributes along with their use of this
location grouping.</t>

</section>

<section title="Tree">
<t>The following is the YANG tree diagram <xref target="RFC8340"/> for the
geo-location grouping.</t>

<sourcecode type="yangtree"><![CDATA[
  module: ietf-geo-location
    grouping geo-location:
      +-- geo-location
         +-- reference-frame
         |  +-- alternate-system?    string {alternate-systems}?
         |  +-- astronomical-body?   string
         |  +-- geodetic-system
         |     +-- geodetic-datum?    string
         |     +-- coord-accuracy?    decimal64
         |     +-- height-accuracy?   decimal64
         +-- (location)?
         |  +--:(ellipsoid)
         |  |  +-- latitude?    decimal64
         |  |  +-- longitude?   decimal64
         |  |  +-- height?      decimal64
         |  +--:(cartesian)
         |     +-- x?           decimal64
         |     +-- y?           decimal64
         |     +-- z?           decimal64
         +-- velocity
         |  +-- v-north?   decimal64
         |  +-- v-east?    decimal64
         |  +-- v-up?      decimal64
         +-- timestamp?         yang:date-and-time
         +-- valid-until?       yang:date-and-time
]]></sourcecode>

</section>

</section>

<section title="YANG Module">
<t>This model imports Common YANG Data Types <xref target="RFC6991"/>. It uses YANG
version 1.1 <xref target="RFC7950"/>.</t>

<sourcecode name="ietf-geo-location@2022-02-11.yang" type="yang" markers="true"><![CDATA[
module ietf-geo-location {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-geo-location";
  prefix geo;
  import ietf-yang-types {
    prefix yang;
    reference "RFC 6991: Common YANG Data Types";
  }

  organization
    "IETF NETMOD Working Group (NETMOD)";
  contact
   "WG Web:   <https://datatracker.ietf.org/wg/netmod/>
    WG List:  <mailto:netmod@ietf.org>

    Editor:   Christian Hopps
              <mailto:chopps@chopps.org>";

  description
    "This module defines a grouping of a container object for
     specifying a location on or around an astronomical object (e.g.,
     'earth').

     The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
     NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED',
     'MAY', and 'OPTIONAL' in this document are to be interpreted as
     described in BCP 14 (RFC 2119) (RFC 8174) when, and only when,
     they appear in all capitals, as shown here.

     Copyright (c) 2022 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, 
     with or without modification, is permitted pursuant to, 
     and subject to the license terms contained in, the 
     Revised BSD License set forth in Section 4.c of the 
     IETF Trust's Legal Provisions Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC 9179 
     (https://www.rfc-editor.org/info/rfc9179); see the RFC itself
     for full legal notices.";

  revision 2022-02-11 {
    description
      "Initial Revision";
    reference 
      "RFC 9179: A YANG Grouping for Geographic Locations";
  }

  feature alternate-systems {
    description
      "This feature means the device supports specifying locations
       using alternate systems for reference frames.";
  }

  grouping geo-location {
    description
      "Grouping to identify a location on an astronomical object.";

    container geo-location {
      description
        "A location on an astronomical body (e.g., 'earth')
         somewhere in a universe.";

      container reference-frame {
        description
          "The Frame of Reference for the location values.";

        leaf alternate-system {
          if-feature "alternate-systems";
          type string;
          description
            "The system in which the astronomical body and
             geodetic-datum is defined.  Normally, this value is not
             present and the system is the natural universe; however,
             when present, this value allows for specifying alternate
             systems (e.g., virtual realities).  An alternate-system
             modifies the definition (but not the type) of the other
             values in the reference frame.";
        }
        leaf astronomical-body {
          type string {
            pattern '[ -@\[-\^_-~]*';
          }
          default "earth";
          description
            "An astronomical body as named by the International
             Astronomical Union (IAU) or according to the alternate
             system if specified.  Examples include 'sun' (our star),
             'earth' (our planet), 'moon' (our moon), 'enceladus' (a
             moon of Saturn), 'ceres' (an asteroid), and
             '67p/churyumov-gerasimenko (a comet).  The ASCII value
             SHOULD have uppercase converted to lowercase and not
             include control characters (i.e., values 32..64, and
             91..126).  Any preceding 'the' in the name SHOULD NOT be
             included.";
          reference 
            "https://www.iau.org/";
        }
        container geodetic-system {
          description
            "The geodetic system of the location data.";
          leaf geodetic-datum {
            type string {
              pattern '[ -@\[-\^_-~]*';
            }
            description
              "A geodetic-datum defining the meaning of latitude,
               longitude, and height.  The default when the
               astronomical body is 'earth' is 'wgs-84', which is
               used by the Global Positioning System (GPS).  The
               ASCII value SHOULD have uppercase converted to
               lowercase and not include control characters
               (i.e., values 32..64, and 91..126).  The IANA registry
               further restricts the value by converting all spaces
               (' ') to dashes ('-').
               The specification for the geodetic-datum indicates
               how accurately it models the astronomical body in
               question, both for the 'horizontal'
               latitude/longitude coordinates and for height
               coordinates.";
            reference
              "RFC 9179: A YANG Grouping for Geographic Locations,
               Section 6.1";
          }
          leaf coord-accuracy {
            type decimal64 {
              fraction-digits 6;
            }
            description
              "The accuracy of the latitude/longitude pair for
               ellipsoidal coordinates, or the X, Y, and Z components
               for Cartesian coordinates.  When coord-accuracy is
               specified, it indicates how precisely the coordinates
               in the associated list of locations have been
               determined with respect to the coordinate system
               defined by the geodetic-datum.  For example, there
               might be uncertainty due to measurement error if an
               experimental measurement was made to determine each
               location.";
          }
          leaf height-accuracy {
            type decimal64 {
              fraction-digits 6;
            }
            units "meters";
            description
              "The accuracy of the height value for ellipsoidal
               coordinates; this value is not used with Cartesian
               coordinates.  When height-accuracy is specified, it
               indicates how precisely the heights in the
               associated list of locations have been determined
               with respect to the coordinate system defined by the
               geodetic-datum.  For example, there might be
               uncertainty due to measurement error if an
               experimental measurement was made to determine each
               location.";
          }
        }
      }
      choice location {
        description
          "The location data either in latitude/longitude or 
           Cartesian values";
        case ellipsoid {
          leaf latitude {
            type decimal64 {
              fraction-digits 16;
            }
            units "decimal degrees";
            description
              "The latitude value on the astronomical body.  The
               definition and precision of this measurement is
               indicated by the reference-frame.";
          }
          leaf longitude {
            type decimal64 {
              fraction-digits 16;
            }
            units "decimal degrees";
            description
              "The longitude value on the astronomical body.  The
               definition and precision of this measurement is
               indicated by the reference-frame.";
          }
          leaf height {
            type decimal64 {
              fraction-digits 6;
            }
            units "meters";
            description
              "Height from a reference 0 value.  The precision and
               '0' value is defined by the reference-frame.";
          }
        }
        case cartesian {
          leaf x {
            type decimal64 {
              fraction-digits 6;
            }
            units "meters";
            description
              "The X value as defined by the reference-frame.";
          }
          leaf y {
            type decimal64 {
              fraction-digits 6;
            }
            units "meters";
            description
              "The Y value as defined by the reference-frame.";
          }
          leaf z {
            type decimal64 {
              fraction-digits 6;
            }
            units "meters";
            description
              "The Z value as defined by the reference-frame.";
          }
        }
      }
      container velocity {
        description
          "If the object is in motion, the velocity vector describes
           this motion at the time given by the timestamp.  For a
           formula to convert these values to speed and heading, see
           RFC 9179.";
        reference
          "RFC 9179: A YANG Grouping for Geographic Locations";

        leaf v-north {
          type decimal64 {
            fraction-digits 12;
          }
          units "meters per second";
          description
            "v-north is the rate of change (i.e., speed) towards
             true north as defined by the geodetic-system.";
        }

        leaf v-east {
          type decimal64 {
            fraction-digits 12;
          }
          units "meters per second";
          description
            "v-east is the rate of change (i.e., speed) perpendicular
             to the right of true north as defined by
             the geodetic-system.";
        }

        leaf v-up {
          type decimal64 {
            fraction-digits 12;
          }
          units "meters per second";
          description
            "v-up is the rate of change (i.e., speed) away from the
             center of mass.";
        }
      }
      leaf timestamp {
        type yang:date-and-time;
        description
          "Reference time when location was recorded.";
      }
      leaf valid-until {
        type yang:date-and-time;
        description
          "The timestamp for which this geo-location is valid until.
           If unspecified, the geo-location has no specific 
           expiration time.";
      }
    }
  }
}
]]></sourcecode>

</section>

<section title="ISO 6709:2008 Conformance">
<t><xref target="ISO.6709.2008"/> provides an appendix with a set of tests for
conformance to the standard. The tests and results are given in the
following table along with an explanation of inapplicable tests.</t>

<table>
<name>Conformance Test Results</name>
<thead><tr><th>Test</th><th>Description</th><th>Pass Explanation</th></tr>
</thead>
<tbody><tr><td>A.1.2.1</td><td>elements required for a geographic point location</td><td>CRS is always indicated</td></tr>
<tr><td>A.1.2.2</td><td>description of a CRS from a register</td><td>CRS register is defined</td></tr>
<tr><td>A.1.2.3</td><td>definition of CRS</td><td>N/A - Don't define CRS</td></tr>
<tr><td>A.1.2.4</td><td>representation of horizontal position</td><td>latitude/longitude values conform</td></tr>
<tr><td>A.1.2.5</td><td>representation of vertical position</td><td>height value conforms</td></tr>
<tr><td>A.1.2.6</td><td>text string representation</td><td>N/A - No string format</td></tr>
</tbody>
</table>

<t>For test '<tt>A.1.2.1</tt>', the YANG geo-location object either includes a
Coordinate Reference System (CRS) ('<tt>reference-frame</tt>') or has a
default defined <xref target="WGS84"/>.</t>

<t>For '<tt>A.1.2.3</tt>', we do not define our own CRS, and doing so is not
required for conformance.</t>

<t>For '<tt>A.1.2.6</tt>', we do not define a text string representation, which is
also not required for conformance.</t>

</section>

<section title="Usability">
<t>The geo-location object defined in this document and YANG module has
been designed to be usable in a very broad set of applications.
This includes the ability to locate things on astronomical bodies
other than Earth, and to utilize entirely different coordinate
systems and realities.</t>

<section title="Portability">
<t>In order to verify portability while developing this module, the
following standards and standard APIs were considered.</t>

<section title="IETF URI Value">
<t><xref target="RFC5870"/> defines a standard URI value for geographic
location data. It includes the ability to specify the '<tt>geodetic-value</tt>'
(it calls this '<tt>crs</tt>') with the default being '<tt>wgs-84</tt>' <xref
target="WGS84"/>. For the location data, it allows two to three coordinates defined
by the '<tt>crs</tt>' value. For accuracy, it has a single '<tt>u</tt>' parameter
for specifying uncertainty. The '<tt>u</tt>' value is in fractions of meters and
applies to all the location values. As the URI is a string, all values are
specified as strings and so are capable of as much precision as required.</t>

<t>URI values can be mapped to and from the YANG grouping with the
caveat that some loss of precision (in the extremes) may occur due to
the YANG grouping using decimal64 values rather than strings.</t>

</section>

<section title="W3C">
<t>W3C defines a geolocation API in <xref target="W3CGEO"/>. We show a snippet of
code below that defines the geolocation data for this API. This is
used by many applications (e.g., Google Maps API).</t>

<figure><name>Snippet Showing Geolocation Definition</name><sourcecode type=""><![CDATA[
interface GeolocationPosition {
  readonly attribute GeolocationCoordinates coords;
  readonly attribute DOMTimeStamp timestamp;
};

interface GeolocationCoordinates {
  readonly attribute double latitude;
  readonly attribute double longitude;
  readonly attribute double? altitude;
  readonly attribute double accuracy;
  readonly attribute double? altitudeAccuracy;
  readonly attribute double? heading;
  readonly attribute double? speed;
};
]]></sourcecode></figure>

<section title="Comparison with YANG Data Model">
<table>

<thead><tr><th>Field</th><th>Type</th><th>YANG</th><th>Type</th></tr>
</thead>
<tbody><tr><td>accuracy</td><td>double</td><td>coord-accuracy</td><td>dec64 fr 6</td></tr>
<tr><td>altitude</td><td>double</td><td>height</td><td>dec64 fr 6</td></tr>
<tr><td>altitudeAccuracy</td><td>double</td><td>height-accuracy</td><td>dec64 fr 6</td></tr>
<tr><td>heading</td><td>double</td><td>v-north, v-east</td><td>dec64 fr 12</td></tr>
<tr><td>latitude</td><td>double</td><td>latitude</td><td>dec64 fr 16</td></tr>
<tr><td>longitude</td><td>double</td><td>longitude</td><td>dec64 fr 16</td></tr>
<tr><td>speed</td><td>double</td><td>v-north, v-east</td><td>dec64 fr 12</td></tr>
<tr><td>timestamp</td><td>DOMTimeStamp</td><td>timestamp</td><td>string</td></tr>
</tbody>
</table>

<dl>
<dt>accuracy (double):</dt><dd><t>Accuracy of '<tt>latitude</tt>' and
'<tt>longitude</tt>' values in meters.</t></dd>
<dt>altitude (double):</dt><dd><t>Optional height in meters above the <xref target="WGS84"/> ellipsoid.</t></dd>
<dt>altitudeAccuracy (double):</dt><dd><t>Optional accuracy of '<tt>altitude</tt>' value
in meters.</t></dd>
<dt>heading (double):</dt><dd><t>Optional direction in decimal degrees from true
north increasing clockwise.</t></dd>
<dt>latitude, longitude (double):</dt><dd><t>Standard latitude/longitude values in decimal degrees.</t></dd>
<dt>speed (double):</dt><dd><t>Speed along the heading in meters per second.</t></dd>
<dt>timestamp (DOMTimeStamp):</dt><dd><t>Specifies milliseconds since the UNIX
Epoch in a 64-bit unsigned integer. The YANG data model defines the
timestamp with arbitrarily large precision by using a string
that encompasses all representable values of this timestamp
value.</t></dd>
</dl>

<t>W3C API values can be mapped to the YANG grouping with the caveat
that some loss of precision (in the extremes) may occur due to the
YANG grouping using decimal64 values rather than doubles.</t>

<t>Conversely, only YANG values for Earth using the default '<tt>wgs-84</tt>'
<xref target="WGS84"/> as the '<tt>geodetic-datum</tt>' can be directly mapped
to the W3C values as W3C does not provide the extra features necessary to map
the broader set of values supported by the YANG grouping.</t>

</section>

</section>

<section title="Geography Markup Language (GML)">

<t>ISO adopted the Geography Markup Language (GML) defined by OGC 07-036 <xref target="OGC"/>
as <xref target="ISO.19136.2007"/>. GML defines, among many other things, a position
type '<tt>gml:pos</tt>', which is a sequence of '<tt>double</tt>' values. This sequence
of values represents coordinates in a given CRS. The CRS is either
inherited from containing elements or directly specified as
attributes '<tt>srsName</tt>' and optionally '<tt>srsDimension</tt>' on the '<tt>gml:pos</tt>'.</t>

<t>GML defines an Abstract CRS type from which Concrete CRS types are derived.
This allows for many types of CRS definitions. We are concerned
with the Geodetic CRS type, which can have either ellipsoidal or
Cartesian coordinates. We believe that other non-Earth-based CRSs as
well as virtual CRSs should also be representable by the GML CRS types.</t>

<t>Thus, GML '<tt>gml:pos</tt>' values can be mapped directly to the YANG
grouping with the caveat that some loss of precision (in the
extremes) may occur due to the YANG grouping using decimal64 values
rather than doubles.</t>

<t>
Conversely, mapping YANG grouping values to GML is fully supported for
Earth-based geodetic systems.</t>

<t>GML also defines an observation value in '<tt>gml:Observation</tt>', which
includes a timestamp value '<tt>gml:validTime</tt>' in addition to other
components such as '<tt>gml:using</tt>', '<tt>gml:target</tt>', and
'<tt>gml:resultOf</tt>'. Only the timestamp is mappable to and from the YANG
grouping. Furthermore, '<tt>gml:validTime</tt>' can either be an instantaneous
measure ('<tt>gml:TimeInstant</tt>') or a time period
('<tt>gml:TimePeriod</tt>'). The instantaneous '<tt>gml:TimeInstant</tt>' is
mappable to and from the YANG grouping '<tt>timestamp</tt>' value, and values
down to the resolution of seconds for '<tt>gml:TimePeriod</tt>' can be mapped
using the '<tt>valid-until</tt>' node of the YANG grouping.</t>

</section>

<section title="KML">
<t>KML 2.2 <xref target="KML22"/> (formerly Keyhole Markup Language) was
submitted by Google to the <eref target="https://www.opengeospatial.org/">Open
Geospatial Consortium</eref> and was adopted. The latest version as of this
writing is KML 2.3 <xref target="KML23"/>. This schema includes geographic
location data in some of its objects (e.g., '<tt>kml:Point</tt>' or
'<tt>kml:Camera</tt>' objects). This data is provided in string format and
corresponds to the values specified in <xref target="W3CGEO"/>. The timestamp value is also
specified as a string as in our YANG grouping.</t>

<t>KML has some special handling for the height value that is useful for
visualization software, '<tt>kml:altitudeMode</tt>'.

The values for '<tt>kml:altitudeMode</tt>' include '<tt>clampToGround</tt>', which
indicates the height is ignored; '<tt>relativeToGround</tt>', which indicates the
height value is relative to the location's ground level; or '<tt>absolute</tt>', which
indicates the height value is an absolute value within the geodetic datum.


The YANG grouping can directly map the ignored and
absolute cases but not the relative-to-ground case.</t>

<t>In addition to the '<tt>kml:altitudeMode</tt>', KML also defines two seafloor
height values using '<tt>kml:seaFloorAltitudeMode</tt>'. One value is to
ignore the height value ('<tt>clampToSeaFloor</tt>') and the other is relative
('<tt>relativeToSeaFloor</tt>'). As with the '<tt>kml:altitudeMode</tt>' value, the
YANG grouping supports the ignore case but not the relative case.</t>


<t>
The KML location values use a geodetic datum defined in Annex A of                           
<xref target="ISO.19136.2007"/> with identifier '<tt>LonLat84_5773</tt>'. 

The altitude value for KML absolute height
mode is measured from the vertical datum specified by <xref
target="WGS84"/>.</t>

<t>Thus, the YANG grouping and KML values can be directly mapped in both
directions (when using a supported altitude mode) with the caveat
that some loss of precision (in the extremes) may occur due to the
YANG grouping using decimal64 values rather than strings. For the
relative height cases, the application doing the transformation is
expected to have the data available to transform the relative height
into an absolute height, which can then be expressed using the YANG
grouping.</t>

</section>

</section>

</section>

<section title="IANA Considerations">
<section title="Geodetic System Values Registry">
<t>IANA has created the "Geodetic System Values" registry under
the "YANG Geographic Location Parameters" registry.</t>

<t>This registry allocates names for standard geodetic systems. Often, these
values are referred to using multiple names (e.g., full names or multiple
acronyms). The intent of this registry is to provide a single standard value
for any given geodetic system.</t>

<t>The values <bcp14>SHOULD</bcp14> use an acronym when available, they
<bcp14>MUST</bcp14> be converted to lowercase, and spaces <bcp14>MUST</bcp14>
be changed to dashes "-".</t>

<t>Each entry should be sufficient to define the two coordinate values and to
define height if height is required. So, for example, the '<tt>wgs-84</tt>' is
defined as WGS-84 with the geoid updated by at least <xref target="EGM96"/>
for height values. Specific entries for <xref target="EGM96"/> and <xref
target="EGM08"/> are present if a more precise definition of the data is
required.</t>

<t>It should be noted that <xref target="RFC5870"/> also created a registry
for geodetic systems (the "'geo' URI 'crs' Parameter Values" registry); however, this registry has a very strict
modification policy. The authors of <xref target="RFC5870"/> have the stated
goal of making CRS registration hard to avoid proliferation of CRS values. As
our module defines alternate systems and has a broader scope (i.e., beyond Earth),
the registry defined below is meant to be more easily modified.</t>

<t>The allocation policy for this registry is First Come First Served <xref
target="RFC8126"/>, as the intent is simply to avoid duplicate values.</t>

<t>The Reference value can either be a document or a contact person as
defined in <xref target="RFC8126"/>. The Change Controller (i.e., Owner) is also defined
by <xref target="RFC8126"/>.</t>

<t>The initial values for this registry are as follows. They include the
non-Earth-based geodetic-datum value for the Moon based on <xref target="MEAN-EARTH"/>.</t>

<table>

<thead><tr><th>Name</th><th>Description</th><th>Reference</th><th>Change Controller</th></tr>

</thead>

<tbody><tr><td>me</td><td>Mean Earth/Polar Axis (Moon)</td><td>RFC 9179</td><td>IETF</td></tr>
<tr><td>wgs-84-96</td><td>World Geodetic System 1984</td><td>RFC 9179</td><td>IETF</td></tr>
<tr><td>wgs-84-08</td><td>World Geodetic System 1984</td><td>RFC 9179</td><td>IETF</td></tr>
<tr><td>wgs-84</td><td>World Geodetic System 1984</td><td>RFC 9179</td><td>IETF</td></tr>
</tbody>
</table>

</section>

<section title="Updates to the IETF XML Registry">
<t>This document registers a URI in the "IETF XML Registry" <xref target="RFC3688"/>.
Following the format in <xref target="RFC3688"/>, the following registration has been
made:</t>

<dl spacing="compact">
<dt>URI:</dt><dd><t>urn:ietf:params:xml:ns:yang:ietf-geo-location</t></dd>
<dt>Registrant Contact:</dt><dd><t>The IESG.</t></dd>
<dt>XML:</dt><dd><t>N/A; the requested URI is an XML namespace.</t></dd>
</dl>

</section>

<section title="Updates to the YANG Module Names Registry">
<t>This document registers one YANG module in the "YANG Module Names"
registry <xref target="RFC6020"/>. Following the format in <xref target="RFC6020"/>, the following
registration has been made:</t>

<dl spacing="compact">
<dt>Name:</dt><dd><t>ietf-geo-location</t></dd>
<dt>Maintained by IANA:</dt><dd><t>N</t></dd>
<dt>Namespace:</dt><dd><t>urn:ietf:params:xml:ns:yang:ietf-geo-location</t></dd>
<dt>Prefix:</dt><dd><t>geo</t></dd>
<dt>Reference:</dt><dd><t>RFC 9179</t></dd>
</dl>

</section>

</section>

<section title="Security Considerations">
<t>The YANG module specified in this document defines a schema for data that
is designed to be accessed via network management protocols such as the
Network Configuration Protocol (NETCONF) <xref target="RFC6241"/> or RESTCONF
<xref target="RFC8040"/>.  The lowest NETCONF layer is the secure transport
layer, and the mandatory-to-implement secure transport is Secure Shell (SSH)
<xref target="RFC6242"/>.  The lowest RESTCONF layer is HTTPS, and the
mandatory-to-implement secure transport is TLS <xref target="RFC8446"/>.</t>

<t>The NETCONF access control model <xref target="RFC8341"/> provides the means to
restrict access for particular NETCONF or RESTCONF users to a
preconfigured subset of all available NETCONF or RESTCONF protocol
operations and content.</t>

<t>Since the modules defined in this document only define groupings,
these considerations are primarily for the designers of other modules
that use these groupings.</t>

<t>All the data nodes defined in this YANG module are
writable/creatable/deletable (i.e., "config true", which is the
default).</t>

<t>None of the writable/creatable/deletable data nodes in the YANG
module defined in this document are by themselves considered more
sensitive or vulnerable than standard configuration.</t>

<t>Some of the readable data nodes in this YANG module may be considered
sensitive or vulnerable in some network environments.  It is thus
important to control read access (e.g., via get, get-config, or
notification) to these data nodes.</t>

<t>Since the grouping defined in this module identifies locations,
authors using this grouping <bcp14>SHOULD</bcp14> consider any privacy issues
that may arise when the data is readable (e.g., customer device
locations, etc).</t>

</section>

</middle>
<back>
<references title="Normative References">

<reference anchor="EGM08">
<front>
<title>An Earth Gravitational Model to Degree 2160: EGM08.</title>
<author initials='N.' surname='Pavlis' fullname='N. Pavlis'><organization/></author>
<author initials='S.' surname='Holmes' fullname='S. Holmes'><organization/></author>
<author initials='S.' surname='Kenyon' fullname='S. Kenyon'><organization/></author>
<author initials='J.' surname='Factor' fullname='J. Factor'><organization/></author>
<date year="2008" month="April"/>
</front><refcontent>Presented at the 2008 General Assembly of the European Geosciences Union, Vienna</refcontent>
</reference>

<reference anchor="EGM96">
<front>
<title>The Development of the Joint NASA GSFC and the National Imagery and Mapping Agency (NIMA) Geopotential Model EGM96.</title>
<author initials='F.' surname='Lemoine' fullname='F. Lemoine'><organization/></author>
<author initials='S.' surname='Kenyon' fullname='S. Kenyon'><organization/></author>
<author initials='J.' surname='Factor' fullname='J. Factor'><organization/></author>
<author initials='R.' surname='Trimmer' fullname='R. Trimmer'><organization/></author>
<author initials='N.' surname='Pavlis' fullname='N. Pavlis'><organization/></author>
<author initials='D.' surname='Chinn' fullname='D. Chinn'><organization/></author>
<author initials='C.' surname='Cox' fullname='C. Cox'><organization/></author>
<author initials='S.' surname='Klosko' fullname='S. Klosko'><organization/></author>
<author initials='S.' surname='Luthcke' fullname='S. Luthcke'><organization/></author>
<author initials='M.' surname='Torrence' fullname='M. Torrence'><organization/></author>
<author initials='Y.' surname='Wang' fullname='Y. Wang'><organization/></author>
<author initials='R.' surname='Williamson' fullname='R. Williamson'><organization/></author>
<author initials='E.' surname='Pavlis' fullname='E. Pavlis'><organization/></author>
<author initials='R.' surname='Rapp' fullname='R. Rapp'><organization/></author>
<author initials='T.' surname='Olson' fullname='T. Olson'><organization/></author>
<date year="1998" month="July"/>
</front><refcontent>NASA/TP-1998-206861</refcontent>
</reference>

<reference anchor="ISO.6709.2008">
<front>
<title>Standard representation of geographic point location by coordinates</title>
<author><organization>International Organization for Standardization</organization></author>
<date year="2008"/>
</front>
<seriesInfo name="ISO" value="6709:2008"/>
</reference>

<reference anchor="MEAN-EARTH">
<front>
<title>A Standardized Lunar Coordinate System for the Lunar Reconnaissance Orbiter</title>
<author><organization>NASA</organization></author>
<date month="May" year="2008"/>
</front>
<refcontent>Version 4, Goddard Space Flight Center</refcontent>
</reference>

<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6241.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6242.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6991.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8341.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8040.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8342.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8446.xml"/>




<reference anchor="WGS84">
<front>
<title>Department of Defense World Geodetic System 1984</title>
<author><organization>National Imagery and Mapping Agency</organization></author>
<date  month="January" year="2000"/>
</front>
<refcontent>NIMA TR8350.2, Third Edition</refcontent>
</reference>
</references>


<references title="Informative References">


<reference anchor="OGC" target="https://portal.ogc.org/files/?artifact_id=20509">
<front>
<title>OpenGIS Geography Markup Language (GML) Encoding Standard</title>
<author><organization>OpenGIS</organization></author>
<date month="August" year="2007"/>
</front>
<refcontent>Version: 3.2.1</refcontent>
<refcontent>OGC 07-036</refcontent>

</reference>


<reference anchor="ISO.19136.2007">
<front>
<title>Geographic information -- Geography Markup Language (GML)</title>
<author><organization>International Organization for Standardization</organization></author>
<date/>
</front>
<seriesInfo name="ISO" value="19136:2007"/>
</reference>

<reference anchor="KML22" target='https://portal.opengeospatial.org/files/?artifact_id=27810' >
<front>
<title>OGC KML</title>
<author role='editor' initials='T.' surname='Wilson' fullname='Tim Wilson'><organization>Open Geospatial Consortium Inc.</organization></author>
<date  month="April" year="2008"/>
</front>
<refcontent>Version 2.2</refcontent>
</reference>

<reference anchor="KML23" target='https://docs.opengeospatial.org/is/12-007r2/12-007r2.html'>
<front>
<title>OGC KML</title>
<author role='editor' initials='D.' surname='Burggraf' fullname='David Burggraf'><organization>Open Geospatial Consortium Inc.</organization></author>
<date month="August" year="2015"/>
</front>
<refcontent>Version 2.3</refcontent>
</reference>

<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3688.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5870.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6020.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7950.xml"/>

<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8340.xml"/>


<reference anchor="W3CGEO" target='https://www.w3.org/TR/2016/REC-geolocation-API-20161108/'>
<front>
<title>Geolocation API Specification</title>
<author initials='A.' surname='Popescu' fullname='Andrei Popescu'><organization/></author>
<date  month="November" year="2016"/>
</front>
<refcontent>2nd Edition</refcontent>
</reference>

</references>
<section title="Examples">
<t>Below is a fictitious module that uses the geo-location grouping.</t>

<figure><name>Example YANG Module Using Geolocation</name><sourcecode type="yang"><![CDATA[
module example-uses-geo-location {
  namespace
    "urn:example:example-uses-geo-location";
  prefix ugeo;
  import ietf-geo-location { prefix geo; }
  organization "Empty Org";
  contact "Example Author <eauthor@example.com>";
  description
    "Example use of geo-location";
  revision 2022-02-11 { reference "None"; }
  container locatable-items {
    description
      "The container of locatable items";
    list locatable-item {
      key name;
      description
        "A locatable item";
      leaf name {
        type string;
        description
          "The name of locatable item";
      }
      uses geo:geo-location;
    }
  }
}
]]></sourcecode></figure>

<t>Below is the YANG tree for the fictitious module that uses the
geo-location grouping.</t>
<figure><name>Example YANG Tree Using Geolocation</name>
<sourcecode type="yangtree"><![CDATA[
  module: example-uses-geo-location
    +--rw locatable-items
       +--rw locatable-item* [name]
          +--rw name            string
          +--rw geo-location
             +--rw reference-frame
             |  +--rw alternate-system?    string
             |  |       {alternate-systems}?
             |  +--rw astronomical-body?   string
             |  +--rw geodetic-system
             |     +--rw geodetic-datum?    string
             |     +--rw coord-accuracy?    decimal64
             |     +--rw height-accuracy?   decimal64
             +--rw (location)?
             |  +--:(ellipsoid)
             |  |  +--rw latitude?    decimal64
             |  |  +--rw longitude?   decimal64
             |  |  +--rw height?      decimal64
             |  +--:(cartesian)
             |     +--rw x?           decimal64
             |     +--rw y?           decimal64
             |     +--rw z?           decimal64
             +--rw velocity
             |  +--rw v-north?   decimal64
             |  +--rw v-east?    decimal64
             |  +--rw v-up?      decimal64
             +--rw timestamp?         yang:date-and-time
             +--rw valid-until?       yang:date-and-time
]]></sourcecode>
</figure>
<t>Below is some example YANG XML data for the fictitious module that
uses the geo-location grouping.</t>

<figure><name>Example XML Data of Geolocation Use</name><sourcecode type="xml"><![CDATA[
<locatable-items xmlns="urn:example:example-uses-geo-location">
  <locatable-item>
    <name>Gaetana's</name>
    <geo-location>
      <latitude>40.73297</latitude>
      <longitude>-74.007696</longitude>
    </geo-location>
  </locatable-item>
  <locatable-item>
    <name>Pont des Arts</name>
    <geo-location>
      <timestamp>2012-03-31T16:00:00Z</timestamp>
      <latitude>48.8583424</latitude>
      <longitude>2.3375084</longitude>
      <height>35</height>
    </geo-location>
  </locatable-item>
  <locatable-item>
    <name>Saint Louis Cathedral</name>
    <geo-location>
      <timestamp>2013-10-12T15:00:00-06:00</timestamp>
      <latitude>29.9579735</latitude>
      <longitude>-90.0637281</longitude>
    </geo-location>
  </locatable-item>
  <locatable-item>
    <name>Apollo 11 Landing Site</name>
    <geo-location>
      <timestamp>1969-07-21T02:56:15Z</timestamp>
      <reference-frame>
        <astronomical-body>moon</astronomical-body>
        <geodetic-system>
          <geodetic-datum>me</geodetic-datum>
        </geodetic-system>
      </reference-frame>
      <latitude>0.67409</latitude>
      <longitude>23.47298</longitude>
    </geo-location>
  </locatable-item>
  <locatable-item>
    <name>Reference Frame Only</name>
    <geo-location>
      <reference-frame>
        <astronomical-body>moon</astronomical-body>
        <geodetic-system>
          <geodetic-datum>me</geodetic-datum>
        </geodetic-system>
      </reference-frame>
    </geo-location>
  </locatable-item>
</locatable-items>
]]></sourcecode></figure>

</section>

<section title="Acknowledgments" numbered="false">
<t>We would like to thank <contact fullname="Jim Biard"/> and <contact
fullname="Ben Koziol"/> for their reviews and suggested improvements. We would
also like to thank <contact fullname="Peter Lothberg"/> for the motivation as
well as help in defining a broadly useful geographic location object as well
as <contact fullname="Acee Lindem"/> and <contact fullname="Qin Wu"/> for
their work on a geographic location object that led to this document's
creation. We would also like to thank the Document Shepherd <contact
fullname="Kent Watsen"/>.</t>

</section>
  </back>
</rfc>
