Fix elevation of exported gpx files
This commit is contained in:
parent
21cb9398df
commit
53f21ba8ff
2 changed files with 9 additions and 8 deletions
|
@ -1,7 +1,5 @@
|
|||
package net.osmand.router;
|
||||
|
||||
import net.osmand.GPXUtilities;
|
||||
import net.osmand.GPXUtilities.GPXExtensionsWriter;
|
||||
import net.osmand.GPXUtilities.GPXFile;
|
||||
import net.osmand.GPXUtilities.RouteSegment;
|
||||
import net.osmand.GPXUtilities.RouteType;
|
||||
|
@ -12,12 +10,8 @@ import net.osmand.Location;
|
|||
import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteTypeRule;
|
||||
import net.osmand.binary.RouteDataBundle;
|
||||
import net.osmand.binary.StringBundle;
|
||||
import net.osmand.binary.StringBundleWriter;
|
||||
import net.osmand.binary.StringBundleXmlWriter;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
import org.xmlpull.v1.XmlSerializer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
|
@ -731,8 +731,15 @@ public class MeasurementEditingContext {
|
|||
Pair<WptPt, WptPt> pair = new Pair<>(before.points.get(i), before.points.get(i + 1));
|
||||
RoadSegmentData data = this.roadSegmentData.get(pair);
|
||||
if (data != null) {
|
||||
LocationsHolder locationsHolder = new LocationsHolder(data.points);
|
||||
locations.addAll(locationsHolder.getLocationsList());
|
||||
for (WptPt pt : data.points) {
|
||||
Location l = new Location("");
|
||||
l.setLatitude(pt.getLatitude());
|
||||
l.setLongitude(pt.getLongitude());
|
||||
if (!Double.isNaN(pt.ele)) {
|
||||
l.setAltitude(pt.ele);
|
||||
}
|
||||
locations.add(l);
|
||||
}
|
||||
pair.second.setTrkPtIndex(locations.size() - 1);
|
||||
if (i < size - 2) {
|
||||
locations.remove(locations.size() - 1);
|
||||
|
|
Loading…
Reference in a new issue