One document matched: draft-thomson-geopriv-uncertainty-00.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC3688 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3688.xml">
<!ENTITY RFC3693 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3693.xml">
<!ENTITY RFC3694 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3694.xml">
<!ENTITY RFC3825 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3825.xml">
<!ENTITY RFC4119 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4119.xml">
<!ENTITY I-D.ietf-geopriv-revised-civic-lo PUBLIC ""
"http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-geopriv-revised-civic-lo.xml">
<!ENTITY I-D.ietf-geopriv-policy PUBLIC ""
"http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-geopriv-policy.xml">
<!ENTITY I-D.ietf-ecrit-lost PUBLIC ""
"http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-ecrit-lost.xml">
<!ENTITY I-D.ietf-geopriv-pdif-lo-profile PUBLIC ""
"http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-geopriv-pdif-lo-profile.xml">
]>
<?rfc symrefs="yes"?>
<?rfc sortrefs="no"?>
<?rfc iprnotified="yes"?>
<?rfc strict="yes"?>
<?rfc toc="yes"?>
<?rfc tocindent="yes"?>
<rfc category="std" ipr="full3978" updates="3693" docName="draft-thomson-geopriv-uncertainty-00.txt">
<front>
<title abbrev="Uncertainty & Confidence">
Representation of Uncertainty and Confidence in PIDF-LO
</title>
<author initials="M." surname="Thomson"
fullname="Martin Thomson">
<organization>Andrew</organization>
<address>
<postal>
<street>PO Box U40</street>
<city>Wollongong University Campus</city>
<region>NSW</region>
<code>2500</code>
<country>AU</country>
</postal>
<phone>+61 2 4221 2915</phone>
<email>martin.thomson@andrew.com</email>
<uri>http://www.andrew.com/</uri>
</address>
</author>
<author initials="J." surname="Winterbottom"
fullname="James Winterbottom">
<organization>Andrew</organization>
<address>
<postal>
<street>PO Box U40</street>
<city>Wollongong University Campus</city>
<region>NSW</region>
<code>2500</code>
<country>AU</country>
</postal>
<phone>+61 2 4221 2938</phone>
<email>james.winterbottom@andrew.com</email>
<uri>http://www.andrew.com/</uri>
</address>
</author>
<date month="November" year="2007"/>
<area>Application</area>
<workgroup>GEOPRIV</workgroup>
<keyword>Internet-Draft</keyword>
<keyword>Uncertainty</keyword>
<keyword>Confidence</keyword>
<keyword>Location</keyword>
<keyword>PIDF-LO</keyword>
<keyword>Accuracy</keyword>
<keyword>Precision</keyword>
<abstract>
<t>The key concepts of uncertainty and confidence as they pertain to location information are defined. A form for the representation of confidence in Presence Information Data Format - Location Object (PIDF-LO) is described, optionally including the form of the uncertainty. Suggested methods for the manipulation of location estimates that include uncertainty information are outlined.
</t>
</abstract>
</front>
<middle>
<section anchor="intro" title="Introduction">
<t>Location information represents an estimation of the position of a Target. Under ideal circumstances, a location estimate precisely reflects the actual location of the Target. In reality, there are many factors that introduce errors into the measurements that are used to determine location estimates.
</t>
<t>The process by which measurements are combined to generate a location estimate is outside of the scope of work within the IETF. However, the results of such a process are carried in IETF data formats and protocols. This document outlines how uncertainty, and its associated datum, confidence, are expressed and interpreted.
</t>
<t>The goal of this document is to provide a common nomenclature for discussing uncertainty. An xml format for expressing confidence, a datum previously inexpressible in the Presence Information Data Format - Location Object (PIDF-LO), is defined.
</t>
<t>This document also provides guidance on how to use location information that includes uncertainty. Methods for expanding or reducing uncertainty to obtain a required level of confidence are described. Methods for determining the probability that a Target is within a specified region based on their location estimate are described. These methods are simplified by making certain assumptions about the location estimate and are designed to be applicable to location estimates in a relatively small area.
</t>
<section anchor="terminology" title="Conventions and Terminology">
<t>This document assumes a basic understanding of the principles of mathematics, particularly statistics and geometry.
</t>
<t>Some terminology is borrowed from <xref target="RFC3693"/>.</t>
<t>Mathematical formulae are presented using the following notation: add <spanx style="verb">+</spanx>, subtract <spanx style="verb">-</spanx>, multiply <spanx style="verb">*</spanx>, divide <spanx style="verb">/</spanx>, power <spanx style="verb">^</spanx> and absolute value <spanx style="verb">|x|</spanx>. Precedence is indicated using parentheses. Mathematical functions are represented by common abbreviations: square root <spanx style="verb">sqrt</spanx>, sine <spanx style="verb">sin</spanx>, cosine <spanx style="verb">cos</spanx>, inverse cosine <spanx style="verb">acos</spanx>, tangent <spanx style="verb">tan</spanx>, inverse tangent <spanx style="verb">atan</spanx>, inverse error function <spanx style="verb">erfinv</spanx>.
</t>
<t> The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in <xref target="RFC2119"/>.
</t>
</section>
</section>
<section anchor="general" title="A General Definition of Uncertainty and Confidence">
<t>Uncertainty, as a general concept, is a product of the limitations of measurement. In measuring any observable quantity, errors from a range of sources affect the result.
</t>
<t>When quantifying the impact of measurement errors, two values are used. The first value expresses the magnitude of the possible error, which is the estimated <spanx style="emph">uncertainty</spanx> value. Uncertainty is most often expressed as a range in the same units as the result. The second value is <spanx style="emph">confidence</spanx>, which estimates the probability that the true value lies within the extents defined by the uncertainty.
</t>
<t>In the following example, the result is shown with a range specified by a nominal value and an uncertainty value.
<list style="empty">
<t>e.g. x = 1.00742 +/- 0.0043 meters at 95% confidence
</t>
</list>
In other words, the true value of <spanx style="verb">x</spanx> is 95% likely to be between 1.00312 and 1.01172 meters.
</t>
<t>Uncertainty and confidence for location estimates can be derived in a number of ways. It is out of the scope of this document to describe methods for determining uncertainty. <xref target="ISO.GUM"/> and <xref target="NIST.TN1297"/> provide guidelines for managing and manipulating measurement uncertainty.
</t>
<section title="Uncertainty as a Probability Distribution">
<t>It is helpful to think of the uncertainty and confidence as defining a probability density function (PDF). The probability density indicates the probability that the true value lies at any one point. The shape of the probability distribution depends on the method that is used to determine the result. Two probability density functions are considered in this document:
<list style="symbols">
<t>The normal PDF (also referred to as a Gaussian PDF) is used where a large number of small random factors contribute to errors. The value used for uncertainty in a normal PDF is related to the standard deviation of the distribution.
</t>
<t>A rectangular PDF is used where the errors are known to be consistent across a limited range. The value used for uncertainty where a rectangular PDF is known is the half-width of the distribution; that is, half the width of the distribution.
</t>
</list>
</t>
<t>Each of these probability density functions can be characterized by its center point, or mean, and its width. For a normal distribution, uncertainty and confidence together are related to the standard deviation (see <xref target="scaling"/>). For a rectangular distribution, half of the width of the distribution is used.
</t>
<t><xref target="pdf"/> shows a normal and rectangular probability density function with the mean (m) and standard deviation (s) labelled. The half-width (h) of the rectangular distribution is also indicated.
</t>
<figure anchor="pdf" title="Normal and Rectangular Probability Density Functions">
<!-- gnuplot instructions:
set terminal dumb 70 20
set output "normal.txt"
set tics out
# normal PDF with stddev = 1
f(x) = exp(x**2/-2)/sqrt(2*pi)
# rectangular PDF with stddev = 1 (i.e. sqrt(3) half-width)
g(x) = (abs(x) < sqrt(3)) ? 1 / sqrt(3) / 2 : 0
plot [-3:3] f(x), g(x)
-->
<artwork><![CDATA[
***** *** Normal PDF
** : ** --- Rectangular PDF
** : **
** : **
,---------*---------------*---------.
| ** : ** |
| ** : ** |
| * <-- s -->: * |
| * : : : * |
| ** : ** |
| * : : : * |
| * : * |
|** : : : **|
** : **
*** | : : : | ***
***** | :<------ h ------>| *****
.****-------+.......:.........:.........:.......+-------*****.
m
]]></artwork>
</figure>
<t>In relation to a PDF, uncertainty represents a certain range of values and confidence is the probability that the true value is found within that range. Confidence is defined as the integral of the PDF over the range represented by the uncertainty.
<list style="empty">
<t>The probability of the actual value falling between two points is found by finding the area under the curve between the points (that is, the integral of the curve between the points). For any given PDF, the area under the curve for the entire range from negative infinity to positive infinity is 1 or (100%). Therefore, the confidence over any interval of uncertainty is always less than 100%.
</t>
</list>
<xref target="pdfintegral"/> shows how confidence is determined for a normal distribution. The area of the shaded region gives the confidence (c) for the interval between <spanx style="verb">m-u</spanx> and <spanx style="verb">m+u</spanx>.
</t>
<figure anchor="pdfintegral" title="Confidence as the Integral of a PDF">
<artwork><![CDATA[
*****
**:::::**
**:::::::::**
**:::::::::::**
*:::::::::::::::*
**:::::::::::::::**
**:::::::::::::::::**
*:::::::::::::::::::::*
*:::::::::::::::::::::::*
**:::::::::::::::::::::::**
*:::::::::::: c ::::::::::::*
*:::::::::::::::::::::::::::::*
**|:::::::::::::::::::::::::::::|**
** |:::::::::::::::::::::::::::::| **
*** |:::::::::::::::::::::::::::::| ***
***** |:::::::::::::::::::::::::::::| *****
.****..........!:::::::::::::::::::::::::::::!..........*****.
| | |
(m-u) m (m+u)
]]></artwork>
</figure>
<t>It can be seen from these diagrams that, when expressing uncertainty, the value for uncertainty is the range of values and confidence is the probability that the true value is found within that range.
</t>
<t>In <xref target="scaling"/>, methods are described for manipulating uncertainty and confidence if the shape of the PDF is known.
</t>
</section>
<section title="Deprecation of the Terms Precision and Resolution">
<t>The terms <spanx style="emph">Precision</spanx> and <spanx style="emph">Resolution</spanx> are defined in <xref target="RFC3693">RFC 3693</xref>. These definitions were intended to provide a common nomenclature for discussing uncertainty; however, these particular terms have many different uses in other fields and their definitions are not sufficient to avoid confusion about their meaning. These terms MUST NOT be used in relation to quantitative concepts when discussing uncertainty and confidence in relation to location information.
</t>
</section>
<section title="Accuracy as a Qualitative Concept">
<t>Uncertainty and confidence are quantitative concepts. The term <spanx style="emph">Accuracy</spanx> is useful in describing, qualitatively, the general concepts of location information. Accuracy MAY be used as a general term when describing location estimates. Accuracy MUST NOT be used in a quantitative context.
</t>
<t>For instance, it could be appropriate to say that a location estimate with uncertainty <spanx style="verb">X</spanx> is more accurate than a location estimate with uncertainty <spanx style="verb">2X</spanx> at the same confidence. It is not appropriate to assign a number to "accuracy", nor is it appropriate to refer to any component of uncertainty or confidence as "accuracy". That is, to say that the "accuracy" for the first location estimate is <spanx style="verb">X</spanx> would be an erroneous use of this term.
</t>
</section>
</section>
<section anchor="location" title="Uncertainty in Location">
<t>A <spanx style="emph">location estimate</spanx> is the result of location determination. A location estimate is subject to uncertainty like any other observation. However, unlike a simple measure of a one dimensional property like length, a location estimate is specified in two or three dimensions.
</t>
<t>Uncertainty in a single dimension is expressed as a range; that is, a length of uncertainty in one dimension. Locations in two or three dimensional space are expressed as a subset of that space, either an area or volume of uncertainty. In simple terms, areas or volumes can be formed by the combination of two or three ranges, or more complex shapes could be described.
</t>
<t>This document uses the term <spanx style="emph">region of uncertainty</spanx> to refer to the uncertainty of a location estimate expressed either as an area or volume.
</t>
<section title="Representation of Uncertainty and Confidence in PIDF-LO">
<t>A set of shapes that can be used for the expression of uncertainty in location estimates are described in <xref target="GeoShape"/>. These shapes are the recommended form for the representation of uncertainty in <xref target="RFC4119">PIDF-LO</xref> documents. However, these shapes do not include an indication of confidence.
</t>
<t>A schema defining a confidence element is included in <xref target="schema"/>. This element also includes an optional parameter that defines the PDF.
</t>
<t>Absence of uncertainty information in a PIDF-LO document does not indicate that there is no uncertainty in the location estimate. Uncertainty might not have been calculated for the estimate, or it may be withheld for privacy purposes.
</t>
<t>The confidence element is included within the <spanx style="verb">location-info</spanx> element of the PIDF-LO. The PIDF-LO document in <xref target="ex-pidflo"/> includes a representation of uncertainty as a circular area. The confidence element (on the line marked with a comment) indicates that the confidence is 67% and that it follows a normal distribution.
</t>
<figure anchor="ex-pidflo" title="Example PIDF-LO with Confidence and Uncertainty">
<artwork><![CDATA[
<pidf:presence
xmlns:pidf="urn:ietf:params:xml:ns:pidf"
xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model"
xmlns:gp="urn:ietf:params:xml:ns:pidf:geopriv10"
xmlns:gs="http://www.opengis.net/pidflo/1.0"
xmlns:gml="http://www.opengis.net/gml"
xmlns:con="urn:ietf:params:xml:ns:pidf:geopriv:conf"
entity="pres:alice@example.com">
<dm:device id="sg89ab">
<pidf:status>
<gp:geopriv>
<gp:location-info>
<gs:Circle srsName="urn:ogc:def:crs:EPSG::4326">
<gml:pos>42.5463 -73.2512</gml:pos>
<gs:radius uom="urn:ogc:def:uom:EPSG::9001">
850.24
</gs:radius>
</gs:Circle>
<!-- c --> <con:confidence pdf="normal">67</con:confidence>
</gp:location-info>
<gp:usage-rules/>
</gp:geopriv>
</pidf:status>
<dm:deviceID>mac:010203040506</dm:deviceID>
</dm:device>
</pidf:presence>
]]></artwork>
</figure>
<t>Where uncertainty information is provided, but the confidence element is not, the confidence is assumed to be 95% <xref target="I-D.ietf-geopriv-pdif-lo-profile"/>. If only a point is included, confidence is 0% and the confidence element SHOULD be omitted.
</t>
<t>Three probability distribution functions can be described using the confidence parameter. The <spanx style="verb">pdf</spanx> attribute value SHOULD only be included if known, but it is acknowledged that each PDF is an approximation only - as are all values relating to uncertainty. The PDF is normal if there are a large number of small, independent sources of error; and rectangular if all points within the area have roughly equal probability of being the actual location of the Target; otherwise, the PDF MUST be set to unknown.
</t>
<t>In order to support the functions provided in this document, Location Generators MUST ensure that confidence is equal in each dimension when generating location information. See <xref target="scaling"/> for more details.
</t>
</section>
<section title="Uncertainty and Confidence for Civic Addresses">
<t><xref target="I-D.ietf-geopriv-revised-civic-lo">Civic addresses</xref> inherently include uncertainty, based on the area of the most precise element that is specified. Uncertainty is effectively defined by the presence or absence of elements -- elements that are not present are deemed to be uncertain. Indicating confidence for a civic address is useful, however values of other than the default (95%) are not expected and manipulation of a civic address based on confidence is difficult.
</t>
<t>It is RECOMMENDED that confidence not be indicated for civic addresses and that the default of 95% is always assumed. The methods described in <xref target="scaling"/> for manipulating uncertainty do not apply to civic location information. Uncertainty MAY be increased by removing elements, but unless additional confidence information is available, confidence MUST NOT be increased as a consequence.
</t>
</section>
<section title="DHCP Location Configuration Information and Uncertainty">
<t>Location information is often measured in two or three dimensions; expressions of uncertainty in one dimension only are rare. The "resolution" parameters in <xref target="RFC3825"/> provide an indication of uncertainty in one dimension.
</t>
<t><xref target="RFC3825"/> defines a means for representing uncertainty, but a value for confidence is not specified. A default value of 95% confidence can be assumed for the combination of the uncertainty on each axis. That is, the confidence of the resultant rectangular polygon or prism is 95%. The PDF for a DHCP result is unknown.
</t>
</section>
</section>
<section anchor="manipulation" title="Manipulation of Uncertainty">
<t>This section deals with manipulation of location information that contains uncertainty.
</t>
<t>The following rules generally apply when manipulating location information:
<list style="symbols">
<t>Where calculations are performed on coordinate information, these should be performed in Cartesian space and the results converted back to latitude, longitude and altitude. A method for converting to and from Cartesian coordinates is included in <xref target="ecef2geo"/>.
</t>
<t>Normal rounding rules do not apply when rounding uncertainty. When rounding, uncertainty is always rounded up and confidence is always rounded down (see <xref target="NIST.TN1297"/>). Note that manipulating uncertainty uses non-reversible operations and that each manipulation can result in the loss of some information.
</t>
</list></t>
<section anchor="nominal" title="Reduction of a Location Estimate to a Point">
<t>Manipulating location estimates that include uncertainty information requires additional complexity in systems. In some cases, systems only operate on definitive values, that is, a single point.
</t>
<t>This section describes algorithms for reducing location estimates to a simple form without uncertainty information. Having a consistent means for reducing location estimates allows for interaction between applications that are able to use uncertainty information and those that cannot.
</t>
<t>
<list style="empty">
<t>Note: Reduction of a location estimate to a point constitutes a reduction in information. Removing uncertainty information can degrade results in some applications. Also, there is a natural tendency to misinterpret a point location as representing a location without uncertainty. This could lead to more serious errors. Therefore, these algorithms should only be applied where necessary.
</t>
</list>
</t>
<t>Several different approaches can be taken when reducing a location estimate to a point; each method is equally valid, depending on the assumptions that are made. For any given region of uncertainty, selecting an arbitrary point within the area could be considered valid; however, given the aforementioned problems with point locations, a more rigorous approach is appropriate.
</t>
<t>Given a result with a known distribution, selecting the point within the area that has the highest probability is a more rigorous method. Alternatively, a point could be selected that minimizes the probable error. For a rectangular distribution, the centroid of the area or volume minimizes error. Minimizing the error for a normal distribution is more difficult, but assuming that the normal distribution is centered in the region, the centroid is also the point with highest probability.
</t>
<t>In order to reduce a region of uncertainty to a single point, the centroid of the region is found. A location estimate that is represented as a point has a confidence of 0%, so no confidence information is retained if this conversion is performed.
</t>
<section anchor="centroid" title="Centroid Calculation">
<t>For regular shapes, such as Circle, Sphere, Ellipse and Ellipsoid, this approach equates to the center point of the region. For regions of uncertainty that are expressed as regular (for instance, rectangular) Polygons and Prisms the center point is also the most appropriate selection.
</t>
<t>For the Arc-Band shape and non-regular Polygons and Prisms, selecting the centroid of the area or volume minimizes the overall error. This assumes a rectangular distribution; the difference arising from different distributions is considered acceptable.
</t>
<t>Note that the centroid of a Polygon or Arc-Band shape is not necessarily within the region of uncertainty.
</t>
<section title="Arc-Band Centroid">
<t>The centroid of the Arc-Band shape is found along a line that bisects the arc. The centroid can be found at the following distance from the starting point of the arc-band (assuming an arc-band with an inner radius of <spanx style="verb">r</spanx>, outer radius <spanx style="verb">R</spanx>, start angle <spanx style="verb">a</spanx>, and opening angle <spanx style="verb">o</spanx>):
<list style="empty">
<t>d = 4 * sin(o/2) * (R*R + R*r + r*r) / (3*o*(R + r))
</t>
</list>
This point can be found along the line that bisects the arc; that is, the line at an angle of <spanx style="verb">a + (o/2)</spanx>. Negative values are possible if the angle of opening is greater than 180 degrees; negative values indicate that the centroid is found along the angle <spanx style="verb">a + (o/2) + 180</spanx>.
</t>
</section>
<section anchor="centroid-polygon" title="Polygon Centroid">
<!-- 2d: http://local.wasp.uwa.edu.au/~pbourke/geometry/polyarea/ -->
<!-- three is too many dimensions for the standard equations. Need to find upward normal and convert x, y, z into an x and y on a plane perpindicular to the normal. then convert back -->
<t>Calculating a centroid for the Polygon and Prism shapes is more complex. Polygons that are specified using geodetic coordinates are not necessarily coplanar. For Polygons that are specified without an altitude, choose a value for altitude before attempting this process; an altitude of 0 is acceptable.
<list style="empty">
<t>The method described in this section is simplified by assuming that the surface of the earth is locally flat. This method degrades as polygons become larger; see <xref target="GeoShape"/> for recommendations on polygon size.
</t>
</list>
</t>
<t>The polygon is translated to a new coordinate system that has an x-y plane roughly parallel to the polygon. This enables the elimination of z-axis values and calculating a centroid can be done using only x and y coordinates. This requires that the upward normal for the polygon is known.
</t>
<t>To translate the polygon coordinates, apply the process described in <xref target="polygonupnormal"/> to find the normal vector <spanx style="verb">N = [Nx,Ny,Nz]</spanx>. From this vector, select two vectors that are perpendicular to this vector and combine these into a transformation matrix. If <spanx style="verb">Nx</spanx> and <spanx style="verb">Ny</spanx> are non-zero, the vectors in <xref target="transformmatrices"/> can be used, given <spanx style="verb">p = sqrt(Nx^2 + Ny^2)</spanx>. More transformations are provided later in this section for cases where <spanx style="verb">Nx</spanx> or <spanx style="verb">Ny</spanx> are zero.
</t>
<figure anchor="transformmatrices" title="Recommended Transformation Matrices">
<artwork><![CDATA[
[ -Ny/p Nx/p 0 ] [ -Ny/p -Nx*Nz/p Nx ]
T = [ -Nx*Nz/p -Ny*Nz/p p ] T' = [ Nx/p -Ny*Nz/p Ny ]
[ Nx Ny Nz ] [ 0 p Nz ]
(Transform) (Reverse Transform)
]]></artwork>
</figure>
<t>To apply a transform to each point in the polygon, form a matrix from the ECEF coordinates and use matrix multiplication to determine the translated coordinates.
</t>
<figure anchor="transform" title="Transformation">
<artwork><![CDATA[
[ -Ny/p Nx/p 0 ] [ x[1] x[2] x[3] ... x[n] ]
[ -Nx*Nz/p -Ny*Nz/p p ] * [ y[1] y[2] y[3] ... y[n] ]
[ Nx Ny Nz ] [ z[1] z[2] z[3] ... z[n] ]
[ x'[1] x'[2] x'[3] ... x'[n] ]
= [ y'[1] y'[2] y'[3] ... y'[n] ]
[ z'[1] z'[2] z'[3] ... z'[n] ]
]]></artwork>
</figure>
<t>Alternatively, direct multiplication can be used to achieve the same result:
<list style="empty">
<t>x'[i] = -Ny * x[i] / p + Nx * y[i] / p
</t>
<t>y'[i] = -Nx * Nz * x[i] / p - Ny * Nz * y[i] / p + p * z[i]
</t>
<t>z'[i] = Nx * x[i] + Ny * y[i] + Nz * z[i]
</t>
</list>
</t>
<t>The first and second rows of this matrix (<spanx style="verb">x'</spanx> and <spanx style="verb">y'</spanx>) contain the values that are used to calculate the centroid of the polygon. To find the centroid of this polygon, first find the area using:
<list style="empty">
<t>A = sum from i=1..n of (x'[i]*y'[i+1]-x'[i+1]*y'[i]) / 2
</t>
</list>
For these formulae, treat each set of coordinates as circular, that is <spanx style="verb">x'[0] == x'[n]</spanx> and <spanx style="verb">x'[n+1] == x'[1]</spanx>. Based on the area, the centroid along each axis can be determined by:
<list style="empty">
<t>Cx' = sum (x'[i]+x'[i+1]) * (x'[i]*y'[i+1]-x'[i+1]*y'[i]) / (6*A)
</t>
<t>Cy' = sum (y'[i]+y'[i+1]) * (x'[i]*y'[i+1]-x'[i+1]*y'[i]) / (6*A)
</t>
</list>
The third row contains a distance from a plane parallel to the polygon. If the polygon is coplanar, then the values for <spanx style="verb">z'</spanx> are identical; however, the constraints recommended in <xref target="I-D.ietf-geopriv-pdif-lo-profile"/> mean that this is rarely the case. To determine <spanx style="verb">Cz'</spanx>, average these values:
<list style="empty">
<t>Cz' = sum z'[i] / n
</t>
</list>
</t>
<t>Once the centroid is known in the transformed coordinates, these can be transformed back to the original coordinate system. The reverse transformation is shown in <xref target="reversetransform"/>.
</t>
<figure anchor="reversetransform" title="Reverse Transformation">
<artwork><![CDATA[
[ -Ny/p -Nx*Nz/p Nx ] [ Cx' ] [ Cx ]
[ Nx/p -Ny*Nz/p Ny ] * [ Cy' ] = [ Cy ]
[ 0 p Nz ] [ sum of z'[i] / n ] [ Cz ]
]]></artwork>
</figure>
<t>The reverse transformation can be applied directly as follows:
<list style="empty">
<t>Cx = -Ny * Cx' / p - Nx * Nz * Cy' / p + Nx * Cz'</t>
<t>Cy = Nx * Cx' / p - Ny * Nz * Cy' / p + Ny * Cz'</t>
<t>Cz = p * Cy' + Nz * Cz'</t>
</list>
</t>
<t>The ECEF value <spanx style="verb">[Cx,Cy,Cz]</spanx> can then be converted back to geodetic coordinates. Given a polygon that is defined with no altitude or equal altitudes for each point, the altitude of the result is reset after converting back to a geodetic value.
</t>
<t>The centroid of the Prism shape is found by finding the centroid of the base polygon and raising the point by half the height of the prism. This can be added to altitude of the final result; alternatively, this can be added to <spanx style="verb">Cz'</spanx>, which ensures that negative height is correctly applied to polygons that are defined in a "clockwise" direction.
</t>
<t>The recommended transforms only apply if <spanx style="verb">Nx</spanx> and <spanx style="verb">Ny</spanx> are non-zero. If the normal vector is <spanx style="verb">[0,0,1]</spanx> (that is, along the z-axis), then no transform is necessary. Similarly, if the normal vector is <spanx style="verb">[0,1,0]</spanx> or <spanx style="verb">[1,0,0]</spanx>, avoid the transformation and use the x and z coordinates or y and z coordinates (respectively) in the centroid calculation phase. If either <spanx style="verb">Nx</spanx> or <spanx style="verb">Ny</spanx> are zero, the alternative transform matrices in <xref target="alternativetransform"/> can be used. The reverse transform is the transpose of this matrix.
</t>
<figure anchor="alternativetransform" title="Alternative Transformation Matrices">
<artwork><![CDATA[
if Nx == 0: | if Ny == 0:
[ 0 -Nz Ny ] [ 0 1 0 ] | [ -Nz 0 Nx ]
T = [ 1 0 0 ] T' = [ -Nz 0 Ny ] | T = [ 0 1 0 ] = T'
[ 0 Ny Nz ] [ Ny 0 Nz ] | [ Nx 0 Nz ]
]]></artwork>
</figure>
</section>
<section anchor="circle" title="Conversion to Circle or Sphere">
<t>The Circle or Sphere are simple shapes that suit a range of applications. A circle or sphere contains fewer units of data to manipulate, which simplifies operations on location estimates.
</t>
<t>The simplest method for converting a location estimate to a Circle or Sphere shape is to select a center point and find the longest distance to any point in the region of uncertainty to that point. This distance can be determined based on the shape type:
<list style="hanging">
<t hangText="Circle/Sphere:">No conversion necessary.
</t>
<t hangText="Ellipse/Ellipsoid:">The greater of either semi-major axis or altitude uncertainty.
</t>
<t hangText="Polygon/Prism:">The distance to the furthest vertex of the polygon (for a Prism, only check points on the base).
</t>
<t hangText="Arc-Band:">The furthest length from the centroid to the points where the inner and outer arc end. This distance can be calculated by finding the larger of the two following formulae:
<list style="empty">
<!-- if R == r && t = o/2:
fun graph == sqrt((sin(t)./t - cos(t)).^2 + sin(t).^2)-->
<t>X = sqrt( ( d - R*cos(o/2) )^2 + R*sin(o/2)^2 )</t>
<t>x = sqrt( ( d - r*cos(o/2) )^2 + r*sin(o/2)^2 )</t>
</list>
</t>
</list>
</t>
<t>Once the Circle or Sphere shape is found, the associated confidence can be increased if the result is known to follow a normal distribution. However, this is a complicated process and provides limited benefit. In many cases it also violates the constraint that confidence in each dimension be the same. It is RECOMMENDED that confidence is unchanged when performing this conversion.
</t>
<t>Two dimensional shapes are converted to a Circle; three dimensional shapes are converted to a Sphere. The PDF for a converted shape SHOULD be set to <spanx style="verb">unknown</spanx>.
</t>
<t>A Sphere shape can be easily converted to a Circle shape by removing the altitude component. The altitude is unspecified for a Circle and therefore has unlimited uncertainty. Therefore, the confidence for the Circle is higher than the Sphere. If desired, the confidence of the circle can be increased using the following approximate formula:
<list style="empty">
<t>C[circle] >= C[sphere] ^ (2/3)</t>
</list>
<spanx style="verb">C[circle]</spanx> is the confidence of the circle and <spanx style="verb">C[sphere]</spanx> is the confidence of the sphere. For example, a Sphere with a confidence of 95% is simplified to a Circle of equal radius with confidence of 96.6%.
</t>
</section>
</section>
</section>
<section anchor="scaling" title="Increasing and Decreasing Uncertainty and Confidence">
<t>The combination of uncertainty and confidence provide a great deal of information about the nature of the data that is being measured. If both uncertainty, confidence and PDF are known, certain information can be extrapolated. In particular, the uncertainty can be scaled to meet a certain confidence or the confidence for a particular region of uncertainty can be found.
</t>
<t>In general, confidence decreases as the region of uncertainty decreases in size and confidence increases as the region of uncertainty increases in size. However, this depends on the PDF. If the region of uncertainty is increased, confidence might increase as result, but only if the PDF is normal. If the region of uncertainty is increased during the process of obfuscation (see <xref target="obfuscation"/>), then the confidence MUST NOT be increased. If the region of uncertainty is reduced in size, then the confidence MUST be decreased accordingly.
</t>
<t>If the PDF is not known, uncertainty and confidence cannot be modified. Uncertainty can be increased, but only if confidence is not increased.
</t>
<section anchor="scale-rectangular" title="Rectangular Distributions">
<t>Uncertainty that follows a rectangular distribution can only be decreased in size. Since the PDF is constant over the region of uncertainty, the resulting confidence is determined by the following formula:
<list style="empty">
<t>Cr = Co * Ur / Uo</t>
</list>
Where <spanx style="verb">Uo</spanx> and <spanx style="verb">Ur</spanx> are the sizes of the original and reduced regions of uncertainty (either the area or the volume of the region); <spanx style="verb">Co</spanx> and <spanx style="verb">Cb</spanx> are the confidence values associated with each region.
</t>
<t>Information is lost by decreasing the region of uncertainty for a rectangular distribution. Once reduced in size, the uncertainty region cannot subsequently be increased in size.
</t>
</section>
<section anchor="scale-normal" title="Normal Distributions">
<t>Uncertainty and confidence can be both increased and decreased for a normal distribution. However, the process is more complicated.
</t>
<t>For a normal distribution, uncertainty and confidence are related to the standard deviation of the function. The following function defines the relationship between standard deviation, uncertainty and confidence along a single axis:
<list style="empty">
<t>S[x] = U[x] / ( sqrt(2) * erfinv(C[x]) )</t>
</list>
Where <spanx style="verb">S[x]</spanx> is the standard deviation, <spanx style="verb">U[x]</spanx> is the uncertainty and <spanx style="verb">C[x]</spanx> is the confidence along a single axis. <spanx style="verb">erfinv</spanx> is the inverse error function.
</t>
<t>Scaling a normal distribution in two dimensions requires several assumptions. Firstly, it is assumed that the distribution along each axis is independent. Secondly, the confidence for each axis is the same. Therefore, the confidence along each axis can be assumed to be:
<list style="empty">
<t>C[x] = Co ^ (1/n)</t>
</list>
Where <spanx style="verb">C[x]</spanx> is the confidence along a single axis and <spanx style="verb">Co</spanx> is the overall confidence and <spanx style="verb">n</spanx> is the number of dimensions in the uncertainty.
</t>
<t>Therefore, to find the uncertainty for each axis at a desired confidence, <spanx style="verb">Cd</spanx>, apply the following formula:
<list style="empty">
<t>Ud[x] <= U[x] * (erfinv(Cd ^ (1/n)) / erfinv(Co ^ (1/n)))</t>
</list>
For regular shapes, this formula can be applied as a scaling factor in each dimension to reach a required confidence.
</t>
</section>
</section>
<section anchor="inarea" title="Determining Whether a Location is Within a Given Region">
<t>A number of applications require that a judgement be made about whether a Target is within a given region of interest. Given a location estimate with uncertainty, this judgement can be difficult. A location estimate represents a probability distribution, and the true location of the Target cannot be definitively known. Therefore, the judgement relies on determining the probability that the Target is within the region.
</t>
<t>The probability that the Target is within a particular region is found by integrating the PDF over the region. For a normal distribution, there are no analytical methods that can be used to determine the integral of the two or three dimensional PDF over an arbitrary region. The complexity of numerical methods is also too great to be useful in many applications; for example, finding the integral of the PDF in two or three dimensions across the overlap between the uncertainty region and the target region. If the PDF is unknown, no determination can be made. When judging whether a location is within a given region, uncertainties using these PDFs MAY be assumed to be rectangular. If this assumption is made, the confidence SHOULD be scaled to 95%, if possible.
<list style="empty">
<t>Note: The selection of confidence has a significant impact on the final result. Only use a different confidence if an uncertainty value for 95% confidence cannot be found.
</t>
</list>
</t>
<t>Given the assumption of a rectangular distribution, the probability that a Target is found within a given region is found by first finding the area (or volume) of overlap between the uncertainty region and the region of interest. This is multiplied by the confidence of the location estimate to determine the probability. <xref target="overlap"/> shows an example of finding the area of overlap between the region of uncertainty and the region of interest.
</t>
<figure anchor="overlap" title="Area of Overlap Between Two Circular Regions">
<artwork><![CDATA[
_.-""""-._
.' `. _ Region of
/ \ / Uncertainty
..+-"""--.. |
.-' | :::::: `-. |
,' | :: Ao ::: `. |
/ \ :::::::::: \ /
/ `._ :::::: _.X
| `-....-' |
| |
| |
\ /
`. .' \_ Region of
`._ _.' Interest
`--..___..--'
]]></artwork>
</figure>
<t>Once the area of overlap, <spanx style="verb">Ao</spanx>, is known, the probability that the Target is within the region of interest, <spanx style="verb">Pi</spanx>, is:
<list style="empty">
<t>Pi = Co * Ao / Au</t>
</list>
Given that the area of the region of uncertainty is <spanx style="verb">Au</spanx> and the confidence is <spanx style="verb">Co</spanx>.
</t>
<t>Specific applications SHOULD make recommendations about the probability required for conditions. Without specific recommendations, it is RECOMMENDED that the probability be greater than 50% before a decision is made. If a choice of regions of interest is necessary, as is required by <xref target="I-D.ietf-ecrit-lost"/>, then the region with the highest probability is selected.
</t>
<section title="Determining the Area of Overlap for Two Circles">
<t>Determining the area of overlap between two arbitrary shapes is a non-trivial process. Reducing areas to circles (see <xref target="circle"/>) enables the application of the following process.
</t>
<t>Given the radius of the first circle <spanx style="verb">r</spanx>, the radius of the second circle <spanx style="verb">R</spanx> and the distance between their center points <spanx style="verb">d</spanx>, the following set of formulas provide the area of overlap <spanx style="verb">Ao</spanx>.
<list style="symbols">
<t>If the circles don't overlap, that is <spanx style="verb">d >= r+R</spanx>, <spanx style="verb">Ao</spanx> is zero.
</t>
<t>If one of the two circles is entirely within the other, that is <spanx style="verb">d <= |r-R|</spanx>, the area of overlap is the area of the smaller circle.
</t>
<t>Otherwise, if the circles partially overlap, that is <spanx style="verb">d < r+R</spanx> and <spanx style="verb">d > |r-R|</spanx>, find <spanx style="verb">Ao</spanx> using:
<list style="empty">
<t>a = (r^2 - R^2 + d^2)/(2*d)</t>
<t>Ao = r^2*acos(a/r) + R^2*acos((d - a)/R) - d*sqrt(r^2 - a^2)</t>
</list>
</t>
</list>
A value for <spanx style="verb">d</spanx> can be determined by converting the center points to Cartesian coordinates. However, given the inherent imprecision of this method, approximate techniques based on unconverted values MAY be used.
</t>
</section>
</section>
<section anchor="obfuscation" title="Obfuscation of Location Estimates for Privacy Reasons">
<t><xref target="RFC3693"/> and <xref target="RFC3694"/> describe operations on location information that obscure the real location of a Target to protect privacy. Typically, obfuscation methods operate on a single point and don't allow for the associated region of uncertainty. This section describes a method that extends single point methods, while the confidence is retained by increasing the size of the region of uncertainty.
</t>
<t>Single point obfuscation methods rely on moving the point by a constrained distance. The maximum distance is set by preference, but the actual distance chosen varies randomly, or, as in <xref target="I-D.ietf-geopriv-policy"/>, the distance is set by finding the nearest multiple of the inverse of the input value.
</t>
<t> To obfuscate a location estimate that contains uncertainty information the following procedure can be used:
<list style="numbers">
<t>Optionally, the shape could be translated to a Circle or Sphere shape. This simplifies later steps, but could be considered additional obfuscation.
</t>
<t>Any single point within the region of uncertainty is chosen. This could be the centroid, but any point can be selected.
</t>
<t>That point is moved using the chosen method of obfuscation.
</t>
<t>Based on the movement of the point, the entire region of uncertainty is moved in the same direction and by the same distance. For most shapes, this only requires the movement of a single point to achieve; whereas each point of a Polygon needs to be moved in the same direction and by the same distance to ensure that the shape is retained.
</t>
<t>The region of uncertainty is expanded. In each dimension, the region of uncertainty is expanded by the maximum distance that the point could have moved. This expansion is done in both directions for each axis. The expanded region therefore includes the original region of uncertainty.
</t>
<t>The PDF is changed to unknown; the confidence is unchanged.
</t>
</list>
This process ensures that no information about the original region of uncertainty is revealed but the confidence for the final estimate is the same as the original.
</t>
<t>For the method described in <xref target="I-D.ietf-geopriv-policy"/>, the maximum distance SHOULD be calculated at the equator. That is, the maximum distance is given for two-dimensional and three-dimensional coordinates is:
<list style="empty">
<t>2dmax = sqrt(2)*(6378137*pi) /(r*180)
</t>
<t>3dmax = sqrt(2 * ((6378137*pi) / (r*180))^2 + (1/r)^2)
</t>
</list>
</t>
<t>This method is functionally equivalent to civic address obfuscation that relies on removing the most specific elements, thereby increasing uncertainty.
</t>
</section>
</section>
<section anchor="examples" title="Examples">
<t>This section presents some examples of how to apply the methods described in <xref target="manipulation"/>.
</t>
<section title="Reduction to a Point or Circle">
<t>Alice receives a location estimate from her LIS that contains a ellipsoidal region of uncertainty. This information is provided at 19% confidence with a normal PDF. A PIDF-LO extract for this information is shown in <xref target="ex-ellipse"/>.
</t>
<figure anchor="ex-ellipse">
<artwork><![CDATA[
<gp:geopriv>
<gp:location-info>
<gs:Ellipsoid srsName="urn:ogc:def:crs:EPSG::4979">
<gml:pos>-34.407242 150.882518 34</gml:pos>
<gs:semiMajorAxis uom="urn:ogc:def:uom:EPSG::9001">
7.7156
</gs:semiMajorAxis>
<gs:semiMinorAxis uom="urn:ogc:def:uom:EPSG::9001">
3.31
</gs:semiMinorAxis>
<gs:verticalAxis uom="urn:ogc:def:uom:EPSG::9001">
28.7
</gs:verticalAxis>
<gs:orientation uom="urn:ogc:def:uom:EPSG::9102">
43
</gs:orientation>
</gs:Ellipsoid>
<con:confidence pdf="normal">19</con:confidence>
</gp:location-info>
<gp:usage-rules/>
</gp:geopriv>
]]></artwork>
</figure>
<t>This information can be reduced to a point simply by extracting the center point, that is [-34.407242, 150.882518, 34]. Confidence is not applicable to values without uncertainty, so this information is no longer useful.
</t>
<t>If some limited uncertainty were required, the estimate could be converted into a circle or sphere. To convert to a sphere, the radius is the largest of the semi-major, semi-minor and vertical axes; in this case, 28.7 meters. The confidence remains at 19%; and the PDF becomes unknown.
</t>
<t>However, if only a circle is required, the altitude can be dropped as can the altitude uncertainty (the vertical axis of the ellipsoid), resulting in a circle at [-34.407242, 150.882518] of radius 7.7156 meters. The confidence of the circle can be expanded to 33%.
</t>
<t>Bob receives a location estimate with a Polygon shape. This information is shown in <xref target="ex-polygon"/>. No confidence element is present in the PIDF-LO, so Bob can assume 95% confidence with an unknown distribution.
</t>
<figure anchor="ex-polygon">
<artwork><![CDATA[
<gml:Polygon srsName="urn:ogc:def:crs:EPSG::4326">
<gml:exterior>
<gml:LinearRing>
<gml:posList>
-33.856625 151.215906 -33.856299 151.215343
-33.856326 151.214731 -33.857533 151.214495
-33.857720 151.214613 -33.857369 151.215375
-33.856625 151.215906
</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
]]></artwork>
</figure>
<t>To convert this to a polygon, each point is firstly assigned an altitude of zero and converted to ECEF coordinates (see <xref target="ecef2geo"/>). Then a normal vector for this polygon is found (see <xref target="polygonupnormal"/>). The results of each of these stages is shown in <xref target="ex-poly-convert"/>. Note that the numbers shown are all rounded; no rounding is possible during this process since rounding would contribute significant errors.
</t>
<figure anchor="ex-poly-convert">
<artwork><![CDATA[
Polygon in ECEF coordinate space
(repeated point omitted and transposed to fit):
[ -4.6470e+06 2.5530e+06 -3.5333e+06 ]
[ -4.6470e+06 2.5531e+06 -3.5332e+06 ]
pecef = [ -4.6470e+06 2.5531e+06 -3.5332e+06 ]
[ -4.6469e+06 2.5531e+06 -3.5333e+06 ]
[ -4.6469e+06 2.5531e+06 -3.5334e+06 ]
[ -4.6469e+06 2.5531e+06 -3.5333e+06 ]
Normal Vector: n = [ -0.72782 0.39987 -0.55712 ]
Transformation Matrix:
[ -0.48152 -0.87643 0.00000 ]
t = [ -0.48828 0.26827 0.83043 ]
[ -0.72782 0.39987 -0.55712 ]
Transformed Coordinates:
[ 8.3206e+01 1.9809e+04 6.3715e+06 ]
[ 3.1107e+01 1.9845e+04 6.3715e+06 ]
pecef' = [ -2.5528e+01 1.9842e+04 6.3715e+06 ]
[ -4.7367e+01 1.9708e+04 6.3715e+06 ]
[ -3.6447e+01 1.9687e+04 6.3715e+06 ]
[ 3.4068e+01 1.9726e+04 6.3715e+06 ]
Two dimensional polygon area: A = 12600 m^2
Two-dimensional polygon centroid: C' = [ 8.8184e+00 1.9775e+04 ]
Average of pecef' z coordinates: 6.3715e+06
Reverse Transformation Matrix:
[ -0.48152 -0.48828 -0.72782 ]
t' = [ -0.87643 0.26827 0.39987 ]
[ 0.00000 0.83043 -0.55712 ]
Polygon centroid (ECEF): C = [ -4.6470e+06 2.5531e+06 -3.5333e+06 ]
Polygon centroid (Geo): Cg = [ -33.856926 151.215102 -4.9537e-04 ]
]]></artwork>
</figure>
<t>The point conversion for the polygon uses the final result, <spanx style="verb">Cg</spanx>, ignoring the altitude since the original shape did not include altitude.
</t>
<t>To convert this to a circle, take the maximum distance in ECEF coordinates from the center point to each of the points. This results in a radius of 99.1 meters. Confidence for this shape follows the original confidence of 95%.
</t>
</section>
<section title="Increasing and Decreasing Confidence">
<t>The confidence associated with Alice's location estimate is quite low for many applications. Since the estimate is known to follow a normal distribution, the method in <xref target="scale-normal"/> can be used. Each axis can be scaled by:
<list style="empty">
<t>scale = erfinv(0.95^(1/3)) / erfinv(0.19^(1/3)) = 2.9937
</t>
</list>
Ensuring that rounding always increases uncertainty, the location estimate at 95% includes a semi-major axis of 23.1, a semi-minor axis of 10 and a vertical axis of 86.
</t>
<t>Bob's location estimate covers an area of approximately 12600 square meters. If the estimate follows a rectangular distribution, the region of uncertainty can be reduced in size. To find the confidence that he is within the smaller area of the concert hall, given by the polygon [-33.856473, 151.215257; -33.856322, 151.214973; -33.856424, 151.21471; -33.857248, 151.214753; -33.857413, 151.214941; -33.857311, 151.215128]. To use this new region of uncertainty, find its area using the same translation method described in <xref target="centroid-polygon"/>, which is 4566.2 square meters. The confidence associated with the smaller area is therefore 95% * 4566.2 / 12600 = 34%.
</t>
</section>
<section title="Matching Location Estimates to Regions of Interest">
<t>Suppose than a circular area is defined centered at [-33.872754, 151.20683] with a radius of 1950 meters. To determine whether Bob is found within this area, we apply the method in <xref target="inarea"/>. Using the converted Circle shape for Bob's location, the distance between these points is found to be 1915.26 meters. The area of overlap between Bob's location estimate and the region of interest is therefore 2209 square meters and the area of Bob's location estimate is 30853 square meters. This gives the probability that Bob is less than 1950 meters from the selected point as 67.8%.
</t>
<t>Note that if 1920 meters were chosen for the distance from the selected point, the area of overlap is only 16196 square meters and the confidence is 49.8%. Therefore, it is more likely that Bob is outside the region of interest, despite the center point of his location estimate being within the region.
</t>
<!-- Need to show how choosing confidence can affect the outcome of a comparison result -->
<!-- Need to show that if the center point of the uncertainty is within the region of interest, this doesn't imply that the probability is high -->
</section>
<section title="Obfuscating Location Estimates">
<t>Alices's Location Server (LS, see <xref target="RFC3693"/>) provides her location estimate to a Location Recipient (LR), but the ruleset (see <xref target="I-D.ietf-geopriv-policy"/>) that Alice has provided includes an geodetic transformation. The rule states that the location information is obscured by <spanx style="verb">r = 100</spanx>.
</t>
<t>Too apply this rule, a single point is chosen. In this case the center point, [-34.407242, 150.882518, 34], is used. The result of applying the transformation is the point [-34.41, 150.88, 34]. The maximum distance that this transform could shift a three dimensional point is 1574.3 meters. The actual distance moved is 383.7 meters, but including this information could reveal too more about the Alice's position than she might desire. Therefore, the transformed location estimate (given with a confidence of 95%) is shown in <xref target="ex-shifted"/>.
</t>
<figure anchor="ex-shifted">
<artwork><![CDATA[
<gs:Ellipse srsName="urn:ogc:def:crs:EPSG::4979">
<gml:pos>-34.41 150.88 34</gml:pos>
<gs:semiMajorAxis uom="urn:ogc:def:uom:EPSG::9001">
1597.4
</gs:semiMajorAxis>
<gs:semiMinorAxis uom="urn:ogc:def:uom:EPSG::9001">
1584.3
</gs:semiMinorAxis>
<gs:verticalAxis uom="urn:ogc:def:uom:EPSG::9001">
1660.3
</gs:verticalAxis>
<gs:orientation uom="urn:ogc:def:uom:EPSG::9102">
43
</gs:orientation>
</gs:Ellipse>
]]></artwork>
</figure>
<!--
<t>Bob's Location Server (LS, see <xref target="RFC3693"/>) provides Bob's location estimate to a Location Recipient (LR), but the ruleset (see <xref target="I-D.ietf-geopriv-policy"/>) that Bob has provided includes an geodetic transformation. The rule states that the location information is obscured by <spanx style="verb">r = 100</spanx>.
</t>
<t>Too apply this rule, a single point is chosen. In this case the centroid, [-33.856926, 151.215102], is used. The result of applying the transformation is the point [-33.86, 151.22].
</t>
<t>Since the rules do not instruct the LS to convert to a point, the polygon shape is retained. To still provide the location as a polygon, the entire polygon is first shifted in that direction, then expanded in size by 1574.3 meters.
</t>
<t>Converting the old and new centroid to ECEF coordinates (assuming zero altitude for both) and finding the difference between these results in a vector of [-51.735, -488.719, -283.145]. This means that the distance moved is 567.18 meters. The new set of points is shown in <xref target="ex-shifted-points"/>.
</t>
<figure anchor="ex-shifted-points">
<artwork><![CDATA[
Shifted Coordinates:
[ -4.6471e+06, 2.5525e+06, -3.5335e+06 ]
[ -4.6470e+06, 2.5526e+06, -3.5335e+06 ]
pecefs = [ -4.6470e+06, 2.5526e+06, -3.5335e+06 ]
[ -4.6469e+06, 2.5526e+06, -3.5336e+06 ]
[ -4.6469e+06, 2.5526e+06, -3.5336e+06 ]
[ -4.6470e+06, 2.5526e+06, -3.5336e+06 ]
]]></artwork>
</figure>
!!! Offsetting the polygon is a little to tricky to cover here.
-->
</section>
</section>
<section anchor="schema" title="Confidence Schema">
<figure>
<artwork><![CDATA[
<?xml version="1.0"?>
<xs:schema
xmlns:conf="urn:ietf:params:xml:ns:geopriv:conf"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:ietf:params:xml:ns:geopriv:conf"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:annotation>
<xs:appinfo
source="urn:ietf:params:xml:schema:geopriv:conf">
PIDF-LO Confidence
</xs:appinfo>
<xs:documentation source="http://www.ietf.org/rfc/rfcXXXX.txt">
<!-- [[NOTE TO RFC-EDITOR: Please replace above URL with URL of
published RFC and remove this note.]] -->
This schema defines an element that is used for indicating
confidence in PIDF-LO documents.
</xs:documentation>
</xs:annotation>
<xs:element name="confidence" type="conf:confidenceType"/>
<xs:complexType name="confidenceType">
<xs:simpleContent>
<xs:extension base="conf:confidenceBase">
<xs:attribute name="pdf" type="conf:pdfType" default="unknown"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="confidenceBase">
<xs:restriction base="xs:decimal">
<xs:minExclusive value="0.0"/>
<xs:maxExclusive value="100.0"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="pdfType">
<xs:restriction base="xs:token">
<xs:enumeration value="unknown"/>
<xs:enumeration value="normal"/>
<xs:enumeration value="rectangular"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
]]></artwork>
</figure>
</section>
<section anchor="security" title="Security Considerations">
<t>This document describes a parameter that is added to a PIDF-LO. This additional information MUST be treated with the same privacy considerations as location information. See <xref target="RFC4119"/> for details on privacy considerations for location information.
</t>
<t>No specific security considerations arise from the algorithms described in this document.
</t>
</section>
<section anchor="iana" title="IANA Considerations">
<section title="URN Sub-Namespace Registration for urn:ietf:params:xml:ns:geopriv:conf">
<t>This section registers a new XML namespace, <spanx style="verb">urn:ietf:params:xml:ns:geopriv:conf</spanx>, as per the guidelines in <xref target="RFC3688"/>.
<list style="empty">
<t>URI: urn:ietf:params:xml:ns:geopriv:conf</t>
<t>Registrant Contact: IETF, GEOPRIV working group, (geopriv@ietf.org), Martin Thomson (martin.thomson@andrew.com).</t>
<t>XML:
<figure>
<artwork><![CDATA[
BEGIN
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>PIDF-LO Confidence Attribute</title>
</head>
<body>
<h1>Namespace for PIDF-LO Confidence Attribute</h1>
<h2>urn:ietf:params:xml:ns:geopriv:conf</h2>
[[NOTE TO IANA/RFC-EDITOR: Please update RFC URL and replace XXXX
with the RFC number for this specification.]]
<p>See <a href="[[RFC URL]]">RFCXXXX</a>.</p>
</body>
</html>
END
]]></artwork>
</figure>
</t>
</list>
</t>
</section>
<section title="XML Schema Registration">
<t>This section registers an XML schema as per the guidelines in <xref target="RFC3688"/>.
<list style="hanging">
<t hangText="URI:">urn:ietf:params:xml:schema:geopriv:conf</t>
<t hangText="Registrant Contact:">IETF, GEOPRIV working group, (geopriv@ietf.org), Martin Thomson (martin.thomson@andrew.com).</t>
<t hangText="Schema:">The XML for this schema can be found as the entirety of <xref target="schema"/> of this document.
</t>
</list>
</t>
</section>
</section>
<section anchor="ack" title="Acknowledgements">
<t>Thanks go to Peter Rhodes for his assistance with some particularly curly integrals.
</t>
</section>
<appendix anchor="ecef2geo" title="Conversion Between Cartesian and Geodetic Coordinates">
<t>The process of conversion from geodetic (latitude, longitude and altitude) to earth-centered, earth-fixed (ECEF) Cartesian coordinates is relatively simple.
</t>
<t>In this section, the following constants and derived values are used from the definition of <xref target="WGS84">WGS84</xref>:
<list style="empty">
<t>{radius of ellipsoid} R = 6378137 meters</t>
<t>{inverse flattening} 1/f = 298.257223563</t>
<t>{first eccentricity squared} e^2 = f * (2 - f) </t>
<t>{second eccentricity squared} e'^2 = e^2 * (1 - e^2)</t>
</list>
</t>
<t>To convert geodetic coordinates (latitude, longitude, altitude) to ECEF coordinates (X, Y, Z), use the following relationships:
<list style="empty">
<t>N = R / sqrt(1 - e^2 * sin(latitude)^2)</t>
<t>X = (N + altitude) * cos(latitude) * cos(longitude)</t>
<t>Y = (N + altitude) * cos(latitude) * sin(longitude)</t>
<t>Z = (N*(1 - e^2) + altitude) * sin(latitude)</t>
</list>
</t>
<t>The reverse conversion requires more complex computation and most methods introduce some error in latitude and altitude. A range of techniques are described in <xref target="Convert"/>. A variant on the method originally proposed by Bowring, which results in an acceptably small error, is described by the following:
<list style="empty">
<t>p = sqrt(X^2 + Y^2)</t>
<t>r = sqrt(X^2 + Y^2 + Z^2)</t>
<t>u = atan((1-f) * Z * (1 + e'^2 * (1-f) * R / r) / p)</t>
<t>latitude = atan((Z + e'^2 * (1-f) * R * sin(u)^3) / (p - e^2 * R * cos(u)^3))</t>
<t>longitude = atan(Y / X)</t>
<t>altitude = sqrt((p - R * cos(u))^2 + (Z - (1-f) * R * sin(u))^2)</t>
</list>
If the point is near the poles, that is <spanx style="verb">p < 1</spanx>, the value for altitude that this method produces is unstable. A simpler method for determining the altitude of a point near the poles is:
<list style="empty">
<t>altitude = |Z| - R</t>
</list>
</t>
</appendix>
<appendix anchor="polygonupnormal" title="Calculating the Upward Normal of a Polygon">
<t>For a polygon that is guaranteed to be convex and coplanar, the upward normal can be found by finding the vector cross product of adjacent edges.
</t>
<t>For more general cases the Newell method of approximation described in <xref target="Sunday02"/> may be applied. In particular, this method can be used if the points are only approximately coplanar, and for non-convex polygons.
</t>
<t>This process requires a Cartesian coordinate system. Therefore, <xref target="ecef2geo">convert the geodetic coordinates of the polygon to Cartesian, ECEF coordinates</xref>. If no altitude is specified, assume an altitude of zero.
</t>
<t>This method can be condensed to the following set of equations:
<list style="empty">
<t>Nx = sum from i=1..n of (y[i] * (z[i+1] - z[i-1]))</t>
<t>Ny = sum from i=1..n of (z[i] * (x[i+1] - x[i-1]))</t>
<t>Nz = sum from i=1..n of (x[i] * (y[i+1] - y[i-1]))</t>
</list>
For these formulae, the polygon is made of points <spanx style="verb">(x[1], y[1], z[1])</spanx> through <spanx style="verb">(x[n], y[n], x[n])</spanx>. Each array is treated as circular, that is, <spanx style="verb">x[0] == x[n]</spanx> and <spanx style="verb">x[n+1] == x[1]</spanx>.
</t>
<t>To translate this into a unit-vector; divide each component by the length of the vector:
<list style="empty">
<t>Nx' = Nx / sqrt(Nx^2 + Ny^2 + Nz^2)</t>
<t>Ny' = Ny / sqrt(Nx^2 + Ny^2 + Nz^2)</t>
<t>Nz' = Nz / sqrt(Nx^2 + Ny^2 + Nz^2)</t>
</list>
</t>
</appendix>
<!--
<appendix title="Change Log">
<t>[[The RFC Editor is requested to remove this section at publication.]]</t>
<t>Changes since -0-1:
<list style="symbols">
<t>Document created.</t>
</list>
</t>
</appendix>
-->
</middle>
<back>
<references title="Normative References">
&RFC2119;
&RFC3693;
&I-D.ietf-geopriv-policy;
<reference anchor="WGS84" target="">
<front>
<title>
Department of Defense (DoD) World Geodetic System 1984 (WGS 84), Third Edition
</title>
<author fullname="">
<organization>US National Imagery and Mapping Agency</organization>
</author>
<date day="3" month="January" year="2000"/>
</front>
<seriesInfo name="NIMA" value="TR8350.2"/>
</reference>
<reference anchor="GeoShape">
<front>
<title abbrev="Geo-Shape">GML 3.1.1 PIDF-LO Shape Application Schema for use by the
Internet Engineering Task Force (IETF)</title>
<author initials="M." surname="Thomson" fullname="Martin Thomson">
<organization>Andrew Corporation</organization>
</author>
<author initials="C." surname="Reed" fullname="Carl Reed, PhD.">
<organization>Open Geospatial Consortium Inc.</organization>
</author>
<date month="April" day="10" year="2007"/>
</front>
<seriesInfo name="Candidate OpenGIS Implementation Specification"
value="06-142r1, Version: 1.0"/>
</reference>
</references>
<references title="Informative References">
&RFC3694;
&RFC4119;
&RFC3825;
&RFC3688;
&I-D.ietf-geopriv-revised-civic-lo;
&I-D.ietf-ecrit-lost;
&I-D.ietf-geopriv-pdif-lo-profile;
<reference anchor="ISO.GUM">
<front>
<title>
Guide to the expression of uncertainty in measurement (GUM)
</title>
<author>
<organization>ISO/IEC</organization>
</author>
<date year="1995"/>
</front>
<seriesInfo name="Guide" value="98:1995"/>
</reference>
<reference anchor="NIST.TN1297">
<front>
<title>
Guidelines for Evaluating and Expressing the Uncertainty of NIST Measurement Results
</title>
<author initials="B." surname="Taylor" fullname="Barry N. Taylor">
<organization>NIST</organization>
</author>
<author initials="C." surname="Kuyatt" fullname="Chris E. Kuyatt">
<organization>NIST</organization>
</author>
<date month="Sep" year="1994"/>
</front>
<seriesInfo name="Technical Note" value="1297"/>
</reference>
<reference anchor="Convert">
<front>
<title>A Comparison of Methods Used in Rectangular to Geodetic Coordinate Transformations</title>
<author initials="R." surname="Burtch" fullname="Robert Burtch">
<organization>Ferris State University</organization>
</author>
<date month="April" year="2006"/>
</front>
</reference>
<reference anchor="Sunday02" target="http://www.acm.org/jgt/papers/Sunday02/">
<front>
<title>
Fast polygon area and Newell normal computation.
</title>
<author initials="D" surname="Sunday" fullname="Daniel Sunday">
<organization/>
</author>
<date year="2002"/>
</front>
<seriesInfo name="Journal of Graphics Tools" value="JGT, 7(2):9-13,2002"/>
</reference>
</references>
</back>
</rfc>
| PAFTECH AB 2003-2026 | 2026-04-23 05:30:09 |