forked from upstream-mirrors/OpenTracks
Include GPS accuracy in GPX export
Add a new "accuracy" tag to the opentracks extension as there was no other extension providing this tag that could be found. Signed-off-by: Brian J. Murrell <brian@interlinx.bc.ca>
This commit is contained in:
committed by
Dennis Guse
parent
18b21a6a3e
commit
fb70486bdc
@@ -29,4 +29,13 @@
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="accuracy"
|
||||
type="xsd:float">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
Accuracy in meters of the current TrackPoint.
|
||||
Only used in GPX.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
@@ -358,6 +358,10 @@ public class GPXTrackExporter implements TrackExporter {
|
||||
trackPointExtensionContent += ("<opentracks:loss>" + ALTITUDE_FORMAT.format(cumulativeLoss) + "</opentracks:loss>\n");
|
||||
}
|
||||
|
||||
if (trackPoint.hasHorizontalAccuracy()) {
|
||||
trackPointExtensionContent += ("<opentracks:accuracy>" + DISTANCE_FORMAT.format(trackPoint.getHorizontalAccuracy().toM()) + "</opentracks:accuracy>");
|
||||
}
|
||||
|
||||
cumulativeDistance = Distance.ofOrNull(cumulateSensorData(trackPoint, sensorPoints, (tp) -> tp.hasSensorDistance() ? tp.getSensorDistance().toM() : null));
|
||||
if (cumulativeDistance != null) {
|
||||
trackPointExtensionContent += ("<opentracks:distance>" + DISTANCE_FORMAT.format(cumulativeDistance.toM()) + "</opentracks:distance>\n");
|
||||
|
||||
Reference in New Issue
Block a user