1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-07 10:47:02 +01:00

Huami: do not write elevation to GPX if we have a base altitude of -20000

( #2001 )
This commit is contained in:
Andreas Shimokawa 2020-09-03 23:01:59 +02:00
parent d3aaef4948
commit f2bfab0491
2 changed files with 6 additions and 2 deletions

View File

@ -130,7 +130,9 @@ public class GPXExporter implements ActivityTrackExporter {
// lon and lat attributes do not have an explicit namespace // lon and lat attributes do not have an explicit namespace
ser.attribute(null, "lon", formatLocation(location.getLongitude())); ser.attribute(null, "lon", formatLocation(location.getLongitude()));
ser.attribute(null, "lat", formatLocation(location.getLatitude())); ser.attribute(null, "lat", formatLocation(location.getLatitude()));
if (location.getAltitude() != -20000) {
ser.startTag(NS_GPX_URI, "ele").text(formatLocation(location.getAltitude())).endTag(NS_GPX_URI, "ele"); ser.startTag(NS_GPX_URI, "ele").text(formatLocation(location.getAltitude())).endTag(NS_GPX_URI, "ele");
}
ser.startTag(NS_GPX_URI, "time").text(DateTimeUtils.formatIso8601UTC(point.getTime())).endTag(NS_GPX_URI, "time"); ser.startTag(NS_GPX_URI, "time").text(DateTimeUtils.formatIso8601UTC(point.getTime())).endTag(NS_GPX_URI, "time");
String description = point.getDescription(); String description = point.getDescription();
if (description != null) { if (description != null) {

View File

@ -179,7 +179,9 @@ public class HuamiActivityDetailsParser {
baseLongitude += longitudeDelta; baseLongitude += longitudeDelta;
baseLatitude += latitudeDelta; baseLatitude += latitudeDelta;
if (baseAltitude != -20000) {
baseAltitude += altitudeDelta; baseAltitude += altitudeDelta;
}
GPSCoordinate coordinate = new GPSCoordinate( GPSCoordinate coordinate = new GPSCoordinate(
convertHuamiValueToDecimalDegrees(baseLongitude), convertHuamiValueToDecimalDegrees(baseLongitude),