diff --git a/OsmAnd/src/net/osmand/plus/GPXUtilities.java b/OsmAnd/src/net/osmand/plus/GPXUtilities.java index 8d96630b1c..2b49f5c89a 100644 --- a/OsmAnd/src/net/osmand/plus/GPXUtilities.java +++ b/OsmAnd/src/net/osmand/plus/GPXUtilities.java @@ -1447,6 +1447,26 @@ public class GPXUtilities { ((TrkSegment) parse).points.add(wptPt); parserState.push(wptPt); } + if (parser.getName().equals("csvattributes")) { + String segmentPoints = readText(parser, "csvattributes"); + String[] pointsArr = segmentPoints.split("\n"); + for (int i = 0; i < pointsArr.length; i++) { + String[] pointAttrs = pointsArr[i].split(","); + try { + int arrLength = pointsArr.length; + if (arrLength > 1) { + WptPt wptPt = new WptPt(); + wptPt.lon = Double.parseDouble(pointAttrs[0]); + wptPt.lat = Double.parseDouble(pointAttrs[1]); + ((TrkSegment) parse).points.add(wptPt); + if (arrLength > 2) { + wptPt.ele = Double.parseDouble(pointAttrs[2]); + } + } + } catch (NumberFormatException e) { + } + } + } // main object to parse } else if (parse instanceof WptPt) { if (parser.getName().equals("name")) { diff --git a/OsmAnd/src/net/osmand/plus/helpers/kml2gpx.xslt b/OsmAnd/src/net/osmand/plus/helpers/kml2gpx.xslt index 8b2677e875..2d5b32048a 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/kml2gpx.xslt +++ b/OsmAnd/src/net/osmand/plus/helpers/kml2gpx.xslt @@ -6,68 +6,69 @@ http://opensource.org/licenses/gpl-2.0.php --> - + xmlns:gx="http://www.google.com/kml/ext/2.2" + xmlns:kml="http://www.opengis.net/kml/2.2" - + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -75,66 +76,76 @@ - - + + - - - - + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -142,4 +153,4 @@ - \ No newline at end of file +