Rename tag and remove adding to stack
This commit is contained in:
parent
5a13afb387
commit
87d48b8344
2 changed files with 9 additions and 12 deletions
|
@ -1447,27 +1447,24 @@ public class GPXUtilities {
|
|||
((TrkSegment) parse).points.add(wptPt);
|
||||
parserState.push(wptPt);
|
||||
}
|
||||
if (parser.getName().equals("trkptsattrs")) {
|
||||
String segmentPoints = readText(parser, "trkptsattrs");
|
||||
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(",");
|
||||
WptPt wptPt = new WptPt();
|
||||
try {
|
||||
int arrLength = pointsArr.length;
|
||||
if (arrLength > 0) {
|
||||
wptPt.lon = Double.parseDouble(pointAttrs[0]);
|
||||
if (arrLength > 1) {
|
||||
WptPt wptPt = new WptPt();
|
||||
wptPt.lon = Double.parseDouble(pointAttrs[0]);
|
||||
wptPt.lat = Double.parseDouble(pointAttrs[1]);
|
||||
if (arrLength > 2) {
|
||||
wptPt.ele = Double.parseDouble(pointAttrs[2]);
|
||||
}
|
||||
}
|
||||
((TrkSegment) parse).points.add(wptPt);
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
((TrkSegment) parse).points.add(wptPt);
|
||||
parserState.push(wptPt);
|
||||
}
|
||||
}
|
||||
// main object to parse
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
<xsl:if test="kml:MultiGeometry/kml:LineString/kml:coordinates">
|
||||
<trk>
|
||||
<trkseg>
|
||||
<trkptsattrs><xsl:value-of select="kml:MultiGeometry/kml:LineString/kml:coordinates"/></trkptsattrs>
|
||||
<csvattributes><xsl:value-of select="kml:MultiGeometry/kml:LineString/kml:coordinates"/></csvattributes>
|
||||
</trkseg>
|
||||
</trk>
|
||||
</xsl:if>
|
||||
|
|
Loading…
Reference in a new issue