Skip to content

Commit 61bda05

Browse files
committed
Correction: Update acquisition algorithm to define data types and handle cached positions
Enhance the "Acquire a Position" algorithm to include explicit data type definitions and unit specifications for each piece of acquired position data, aligning with the [[WGS84]] coordinate system standards. This update ensures each parameter (latitude, longitude, altitude, etc.) is clearly defined at the point of data acquisition. Additionally, refine the handling of cached position data within the algorithm. Introduce conditional logic to terminate the algorithm early if a valid cached position is used, preventing unnecessary data acquisition steps. This change improves efficiency and clarity in the geolocation process, ensuring that position data is handled correctly based on its freshness and accuracy requirements. Key Changes: - Define explicit data types and units for latitude, longitude, altitude, accuracy, altitude accuracy, speed, and heading. - Implement conditional checks to skip unnecessary acquisition steps when using cached positions. - Update parameters passed to the `GeolocationPosition` constructor to include all newly defined data points.
1 parent b6bfdb2 commit 61bda05

File tree

1 file changed

+144
-111
lines changed

1 file changed

+144
-111
lines changed

index.html

Lines changed: 144 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -840,12 +840,30 @@ <h2>
840840
value of the |options|.{{PositionOptions/maximumAge}}
841841
member.
842842
</li>
843-
<li>If |cachedPosition|'s
844-
{{GeolocationPosition/timestamp}}'s value is greater than
845-
|cacheTime|, and
843+
<li>If
844+
|cachedPosition|.{{GeolocationPosition/timestamp}}'s
845+
value is greater than |cacheTime|, and
846846
|cachedPosition|.{{GeolocationPosition/[[isHighAccuracy]]}}
847-
equals |options|.{{PositionOptions/enableHighAccuracy}},
848-
set |position| to |cachedPosition|.
847+
equals |options|.{{PositionOptions/enableHighAccuracy}}:
848+
<div class="correction" id="c8">
849+
<span class="marker">Candidate Correction:</span>
850+
Updated to ensure that the algorithm terminates
851+
immediately if a valid cached position is used,
852+
avoiding unnecessary steps.
853+
<ol>
854+
<li>
855+
<ins>Set |postion| to |cachedPosition|.</ins>
856+
</li>
857+
<li>
858+
<ins>[=Queue a task=] on the [=geolocation task
859+
source=] with a step that [=invokes=]
860+
|successCallback| with |position|.</ins>
861+
</li>
862+
<li>
863+
<ins>Terminate this algorithm.</ins>
864+
</li>
865+
</ol>
866+
</div>
849867
</li>
850868
</ol>
851869
</li>
@@ -869,9 +887,66 @@ <h2>
869887
</li>
870888
<li>If acquiring the position data from the system succeeds:
871889
<ol>
872-
<li>Set |position| be [=a new `GeolocationPosition`=]
873-
passing |acquisitionTime| and
874-
|options|.{{PositionOptions/enableHighAccuracy}}.
890+
<li>
891+
<div class="correction" id="c5">
892+
<span class="marker">Candidate Correction:</span>
893+
Each acquired data type is now explicitly defined
894+
with units and standards.
895+
<ol>
896+
<li>
897+
<ins>Let |latitude:double| be a real number of
898+
degrees, in the [[WGS84]] coordinate
899+
system.</ins>
900+
</li>
901+
<li>
902+
<ins>Let |longitude:double| be a real number of
903+
degrees, in the [[WGS84]] coordinate
904+
system.</ins>
905+
</li>
906+
<li>
907+
<ins>Let |altitude:double?| be a height, in
908+
meters, above the [[WGS84]] ellipsoid or `null`
909+
if not available.</ins>
910+
</li>
911+
<li>
912+
<ins>Let |accuracy:double| be a non-negative real
913+
number representing a 95% confidence level.</ins>
914+
</li>
915+
<li>
916+
<ins>Let |altitudeAccuracy:double?| be a
917+
non-negative real number or `null` if not
918+
available, representing a 95% confidence
919+
level.</ins>
920+
</li>
921+
<li>
922+
<ins>Let |speed:double?| be a non-negative real
923+
number of meters per second or `null` if not
924+
available.</ins>
925+
</li>
926+
<li>
927+
<ins>Let |heading:double?| be a real number of
928+
degrees or `null` if not available. If the device
929+
is stationary, set to NaN.</ins>
930+
</li>
931+
</ol>
932+
</div>
933+
</li>
934+
<li>
935+
<div class="correction" id="c6">
936+
<span class="marker">Candidate Correction:</span>
937+
Updated the parameters passed to the
938+
`GeolocationPosition` constructor to align with the
939+
new data specifications. <del>Set |position| be [=a
940+
new `GeolocationPosition`=] passing |acquisitionTime|
941+
and
942+
|options|.{{PositionOptions/enableHighAccuracy}}.</del>
943+
<ins>Set |position| to be [=a new
944+
`GeolocationPosition`=] passing |latitude|,
945+
|longitude|, |altitude|, |accuracy|,
946+
|altitudeAccuracy|, |speed|, |heading|,
947+
|acquisitionTime|, and
948+
|options|.{{PositionOptions/enableHighAccuracy}}.</ins>
949+
</div>
875950
</li>
876951
<li>Set [=this=]'s {{Geolocation/[[cachedPosition]]}} to
877952
|position|.
@@ -1208,113 +1283,71 @@ <h2>
12081283
</h2>
12091284
<p>
12101285
<dfn>A new `GeolocationPosition`</dfn> is constructed with
1211-
{{EpochTimeStamp}} |timestamp:EpochTimeStamp| and boolean
1212-
|isHighAccuracy| by performing the following steps:
12131286
</p>
1287+
<div class="correction" id="c7">
1288+
<span class="marker">Candidate Correction:</span> Updated the
1289+
constructor parameters to include explicit data types and conditions
1290+
as defined in the IDL, enhancing the clarity and precision of the
1291+
specification.
1292+
<blockquote>
1293+
<del>{{EpochTimeStamp}} |timestamp:EpochTimeStamp| and boolean
1294+
|isHighAccuracy|</del> <ins>{{double}} |latitude:double|,
1295+
{{double}} |longitude:double|, {{double?}} |altitude:double?|,
1296+
{{double}} |accuracy:double|, {{double?}}
1297+
|altitudeAccuracy:double?|, {{double?}} |speed:double?|,
1298+
{{double?}} |heading:double?|, {{EpochTimeStamp}}
1299+
|timestamp:EpochTimeStamp|, {{boolean}}
1300+
|isHighAccuracy:boolean|</ins>
1301+
</blockquote>
1302+
</div>by performing the following steps:
12141303
<ol class="algorithm">
12151304
<li>Let |coords:GeolocationCoordinates| be a newly created
12161305
{{GeolocationCoordinates}} instance:
1217-
<ol>
1218-
<li>
1219-
<div class="correction" id="c4">
1220-
<span class="marker">Candidate Correction:</span> Enhanced
1221-
the constructor steps for {{GeolocationCoordinates}} to
1222-
clarify the units and reference systems for latitude,
1223-
longitude, and altitude, ensuring consistency with the
1224-
updated attribute definitions.
1225-
<p>
1226-
Initialize |coord|'s {{GeolocationCoordinates/latitude}}
1227-
<del>attribute to a geographic coordinate in decimal
1228-
degrees.</del> <ins>attribute to a latitude, specified as a
1229-
real number of degrees, in the [[WGS84]] coordinate
1230-
system.</ins>
1231-
</p>
1232-
<p>
1233-
Initialize |coord|'s {{GeolocationCoordinates/longitude}}
1234-
<del>attribute to a geographic coordinate in decimal
1235-
degrees.</del> <ins>attribute to a longitude, specified as
1236-
a real number of degrees, in the [[WGS84]] coordinate
1237-
system.</ins>
1238-
</p>
1239-
<p>
1240-
Initialize |coord|'s {{GeolocationCoordinates/altitude}}
1241-
<del>attribute in meters above the [[WGS84]] ellipsoid, or
1242-
`null` if the implementation cannot provide altitude
1243-
information.</del> <ins>attribute to a height, in meters,
1244-
above the [[WGS84]] ellipsoid, or `null` if the
1245-
implementation cannot provide altitude information.</ins>
1246-
</p>
1247-
</div>
1248-
</li>
1249-
<li>
1250-
<div class="correction" id="c5">
1251-
<span class="marker">Candidate Correction:</span> Updates to
1252-
the descriptions of the speed and heading attributes to
1253-
specify measurement units and conditions for null values,
1254-
aligning with the overall enhancements to attribute accuracy
1255-
and clarity.
1256-
<p>
1257-
Initialize |coord|'s {{GeolocationCoordinates/speed}}
1258-
<del>attribute to a non-negative real number, or as `null`
1259-
if the implementation cannot provide speed
1260-
information.</del> <ins>attribute to a speed, as a
1261-
non-negative real number of meters per second, or as `null`
1262-
if the implementation cannot provide speed
1263-
information.</ins>
1264-
</p>
1265-
<p>
1266-
Initialize |coord|'s {{GeolocationCoordinates/heading}}
1267-
<del>attribute in degrees, or `null` if the implementation
1268-
cannot provide heading information. If the hosting device
1269-
is stationary (i.e., the value of the
1270-
{{GeolocationCoordinates/speed}} attribute is 0), then
1271-
initialize the {{GeolocationCoordinates/heading}} to
1272-
`NaN`.</del> <ins>attribute to a heading, in degrees, or
1273-
`null` if the implementation cannot provide heading
1274-
information. If the hosting device is stationary (i.e., the
1275-
value of the {{GeolocationCoordinates/speed}} attribute is
1276-
0), then initialize the {{GeolocationCoordinates/heading}}
1277-
to `NaN`.</ins>
1278-
</p>
1279-
</div>
1280-
</li><!--li>Initialize |coord|'s
1281-
{{GeolocationCoordinates/latitude}} attribute to a latitude,
1282-
specified as a real number of degrees, in the [[WGS84]]
1283-
coordinate system.
1284-
</li-->
1285-
<!--li>Initialize |coord|'s
1286-
{{GeolocationCoordinates/longitude}} attribute to a longitude,
1287-
specified as a real number of degrees, in the [[WGS84]]
1288-
coordinate system.
1289-
</li-->
1290-
<li>Initialize |coord|'s {{GeolocationCoordinates/accuracy}}
1291-
attribute to a non-negative real number. The value SHOULD
1292-
correspond to a 95% confidence level with respect to the
1293-
longitude and latitude values.
1294-
</li><!--li>Initialize |coord|'s
1295-
{{GeolocationCoordinates/altitude}} attribute to a height, in
1296-
meters, above the [[WGS84]] ellipsoid, or `null` if the
1297-
implementation cannot provide altitude information.
1298-
</li-->
1299-
<li>Initialize |coord|'s
1300-
{{GeolocationCoordinates/altitudeAccuracy}} attribute as
1301-
non-negative real number, or to `null` if the implementation
1302-
cannot provide altitude information. If the altitude accuracy
1303-
information is provided, it SHOULD correspond to a 95% confidence
1304-
level.
1305-
</li><!--li>Initialize |coord|'s
1306-
{{GeolocationCoordinates/speed}} attribute to a speed, as a
1307-
non-negative real number of meters per second, or as `null` if
1308-
the implementation cannot provide speed information.
1309-
</li-->
1310-
<!--li>Initialize |coord|'s
1311-
{{GeolocationCoordinates/heading}} attribute to a heading, in
1312-
degrees, or `null` if the implementation cannot provide heading
1313-
information. If the hosting device is stationary (i.e., the value
1314-
of the {{GeolocationCoordinates/speed}} attribute is 0), then
1315-
initialize the {{GeolocationCoordinates/heading}} to `NaN`.
1316-
</li-->
1317-
</ol>
1306+
<div class="correction" id="c4">
1307+
<span class="marker">Candidate Correction:</span> Enhanced the
1308+
constructor steps for {{GeolocationCoordinates}} to take
1309+
arguments from call site.
1310+
<ol>
1311+
<li>Initialize |coord|'s {{GeolocationCoordinates/latitude}}
1312+
attribute to <del>a geographic coordinate in decimal
1313+
degrees.</del> <ins>|latitude|.</ins>
1314+
</li>
1315+
<li>Initialize |coord|'s {{GeolocationCoordinates/longitude}}
1316+
attribute to <del>a geographic coordinate in decimal
1317+
degrees.</del> <ins>|longitude|.</ins>
1318+
</li>
1319+
<li>Initialize |coord|'s {{GeolocationCoordinates/altitude}}
1320+
<del>attribute in meters above the [[WGS84]] ellipsoid, or
1321+
`null` if the implementation cannot provide altitude
1322+
information.</del> <ins>attribute to |altitude|.</ins>
1323+
</li>
1324+
<li>Initialize |coord|'s {{GeolocationCoordinates/speed}}
1325+
attribute to <del>a non-negative real number, or as `null` if
1326+
the implementation cannot provide speed information.</del>
1327+
<ins>|speed|.</ins>
1328+
</li>
1329+
<li>Initialize |coord|'s {{GeolocationCoordinates/heading}}
1330+
<del>attribute in degrees, or `null` if the implementation
1331+
cannot provide heading information. If the hosting device is
1332+
stationary (i.e., the value of the
1333+
{{GeolocationCoordinates/speed}} attribute is 0), then
1334+
initialize the {{GeolocationCoordinates/heading}} to
1335+
`NaN`.</del> <ins>attribute to |heading|.</ins>
1336+
</li>
1337+
<li>Initialize |coord|'s {{GeolocationCoordinates/accuracy}}
1338+
attribute to <del>a non-negative real number. The value SHOULD
1339+
correspond to a 95% confidence level with respect to the
1340+
longitude and latitude values.</del> <ins>|accuracy|.</ins>
1341+
</li>
1342+
<li>Initialize |coord|'s
1343+
{{GeolocationCoordinates/altitudeAccuracy}} attribute <del>as
1344+
non-negative real number, or to `null` if the implementation
1345+
cannot provide altitude information. If the altitude accuracy
1346+
information is provided, it SHOULD correspond to a 95%
1347+
confidence level.</del> <ins>to |altitudeAccuracy|.</ins>
1348+
</li>
1349+
</ol>
1350+
</div>
13181351
</li>
13191352
<li>Return a newly created {{GeolocationPosition}} instance with its
13201353
{{GeolocationPosition/coords}} attribute initialized to |coords| and

0 commit comments

Comments
 (0)