Merge pull request #10587 from jensMF/fix_xml_schema_calculated_and_planned_routes

Add BaseCamp compatibility for planned Tracks and claculated routes exported to gpx
This commit is contained in:
vshcherb 2021-01-18 01:26:36 +01:00 committed by GitHub
commit 981d374b80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 21 deletions

View file

@ -1822,6 +1822,25 @@ public class GPXUtilities {
} }
serializer.endTag(null, "metadata"); serializer.endTag(null, "metadata");
for (WptPt l : file.points) {
serializer.startTag(null, "wpt"); //$NON-NLS-1$
writeWpt(format, serializer, l);
serializer.endTag(null, "wpt"); //$NON-NLS-1$
}
for (Route track : file.routes) {
serializer.startTag(null, "rte"); //$NON-NLS-1$
writeNotNullText(serializer, "name", track.name);
writeNotNullText(serializer, "desc", track.desc);
for (WptPt p : track.points) {
serializer.startTag(null, "rtept"); //$NON-NLS-1$
writeWpt(format, serializer, p);
serializer.endTag(null, "rtept"); //$NON-NLS-1$
}
writeExtensions(serializer, track);
serializer.endTag(null, "rte"); //$NON-NLS-1$
}
for (Track track : file.tracks) { for (Track track : file.tracks) {
if (!track.generalTrack) { if (!track.generalTrack) {
@ -1844,26 +1863,6 @@ public class GPXUtilities {
} }
} }
for (Route track : file.routes) {
serializer.startTag(null, "rte"); //$NON-NLS-1$
writeNotNullText(serializer, "name", track.name);
writeNotNullText(serializer, "desc", track.desc);
for (WptPt p : track.points) {
serializer.startTag(null, "rtept"); //$NON-NLS-1$
writeWpt(format, serializer, p);
serializer.endTag(null, "rtept"); //$NON-NLS-1$
}
writeExtensions(serializer, track);
serializer.endTag(null, "rte"); //$NON-NLS-1$
}
for (WptPt l : file.points) {
serializer.startTag(null, "wpt"); //$NON-NLS-1$
writeWpt(format, serializer, l);
serializer.endTag(null, "wpt"); //$NON-NLS-1$
}
writeExtensions(serializer, file); writeExtensions(serializer, file);
serializer.endTag(null, "gpx"); //$NON-NLS-1$ serializer.endTag(null, "gpx"); //$NON-NLS-1$

View file

@ -20,7 +20,7 @@ public abstract class StringBundleWriter {
public void writeBundle() { public void writeBundle() {
for (Entry<String, Item<?>> entry : bundle.getMap().entrySet()) { for (Entry<String, Item<?>> entry : bundle.getMap().entrySet()) {
writeItem(entry.getKey(), entry.getValue()); writeItem("osmand:" + entry.getKey(), entry.getValue());
} }
} }
} }