Fix gpx import

This commit is contained in:
crimean 2019-07-12 19:05:57 +03:00
parent 399e34a7d3
commit 8f031a379e

View file

@ -1965,14 +1965,17 @@ public class GPXUtilities {
Object pop = parserState.pop(); Object pop = parserState.pop();
assert pop instanceof Metadata; assert pop instanceof Metadata;
} else if (tag.equals("author")) { } else if (tag.equals("author")) {
Object pop = parserState.pop(); if (parse instanceof Author) {
assert pop instanceof Author; parserState.pop();
}
} else if (tag.equals("copyright")) { } else if (tag.equals("copyright")) {
Object pop = parserState.pop(); if (parse instanceof Copyright) {
assert pop instanceof Copyright; parserState.pop();
}
} else if (tag.equals("bounds")) { } else if (tag.equals("bounds")) {
Object pop = parserState.pop(); if (parse instanceof Bounds) {
assert pop instanceof Bounds; parserState.pop();
}
} else if (tag.equals("trkpt")) { } else if (tag.equals("trkpt")) {
Object pop = parserState.pop(); Object pop = parserState.pop();
assert pop instanceof WptPt; assert pop instanceof WptPt;
@ -2038,6 +2041,7 @@ public class GPXUtilities {
wpt.lat = Double.parseDouble(parser.getAttributeValue("", "lat")); //$NON-NLS-1$ //$NON-NLS-2$ wpt.lat = Double.parseDouble(parser.getAttributeValue("", "lat")); //$NON-NLS-1$ //$NON-NLS-2$
wpt.lon = Double.parseDouble(parser.getAttributeValue("", "lon")); //$NON-NLS-1$ //$NON-NLS-2$ wpt.lon = Double.parseDouble(parser.getAttributeValue("", "lon")); //$NON-NLS-1$ //$NON-NLS-2$
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
// ignore
} }
return wpt; return wpt;
} }
@ -2050,6 +2054,7 @@ public class GPXUtilities {
bounds.maxlat = Double.parseDouble(parser.getAttributeValue("", "maxlat")); bounds.maxlat = Double.parseDouble(parser.getAttributeValue("", "maxlat"));
bounds.maxlon = Double.parseDouble(parser.getAttributeValue("", "maxlon")); bounds.maxlon = Double.parseDouble(parser.getAttributeValue("", "maxlon"));
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
// ignore
} }
return bounds; return bounds;
} }