1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-15 22:49:26 +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
ser.attribute(null, "lon", formatLocation(location.getLongitude()));
ser.attribute(null, "lat", formatLocation(location.getLatitude()));
ser.startTag(NS_GPX_URI, "ele").text(formatLocation(location.getAltitude())).endTag(NS_GPX_URI, "ele");
if (location.getAltitude() != -20000) {
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");
String description = point.getDescription();
if (description != null) {

View File

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