[Marble-commits] KDE/kdeedu/marble/src/lib/geodata
Thibaut Gridel
tgridel at free.fr
Thu Jan 7 00:08:47 CET 2010
SVN commit 1070863 by tgridel:
Geodata: gpx track parsing
M +3 -0 CMakeLists.txt
M +3 -0 handlers/gpx/GPXElementDictionary.cpp
M +3 -0 handlers/gpx/GPXElementDictionary.h
M +2 -2 handlers/gpx/GPXgpxTagHandler.cpp
M +4 -3 handlers/gpx/GPXnameTagHandler.cpp
A handlers/gpx/GPXtrkTagHandler.cpp handlers/gpx/GPXwptTagHandler.cpp#1070837 [License: LGPL (v2.1+)]
A handlers/gpx/GPXtrkTagHandler.h [License: LGPL (v2.1+)]
A handlers/gpx/GPXtrkptTagHandler.cpp handlers/gpx/GPXwptTagHandler.cpp#1070837 [License: LGPL (v2.1+)]
A handlers/gpx/GPXtrkptTagHandler.h [License: LGPL (v2.1+)]
A handlers/gpx/GPXtrksegTagHandler.cpp handlers/gpx/GPXnameTagHandler.cpp#1070837 [License: LGPL (v2.1+)]
A handlers/gpx/GPXtrksegTagHandler.h [License: LGPL (v2.1+)]
M +2 -2 handlers/gpx/GPXwptTagHandler.cpp
--- trunk/KDE/kdeedu/marble/src/lib/geodata/CMakeLists.txt #1070862:1070863
@@ -23,6 +23,9 @@
geodata/handlers/gpx/GPXElementDictionary.cpp
geodata/handlers/gpx/GPXgpxTagHandler.cpp
geodata/handlers/gpx/GPXnameTagHandler.cpp
+ geodata/handlers/gpx/GPXtrkTagHandler.cpp
+ geodata/handlers/gpx/GPXtrkptTagHandler.cpp
+ geodata/handlers/gpx/GPXtrksegTagHandler.cpp
geodata/handlers/gpx/GPXwptTagHandler.cpp
)
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/gpx/GPXElementDictionary.cpp #1070862:1070863
@@ -35,6 +35,9 @@
const char* gpxTag_lat = "lat";
const char* gpxTag_lon = "lon";
const char* gpxTag_name = "name";
+const char* gpxTag_trk = "trk";
+const char* gpxTag_trkpt = "trkpt";
+const char* gpxTag_trkseg = "trkseg";
const char* gpxTag_wpt = "wpt";
}
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/gpx/GPXElementDictionary.h #1070862:1070863
@@ -36,6 +36,9 @@
extern const char* gpxTag_lat;
extern const char* gpxTag_lon;
extern const char* gpxTag_name;
+ extern const char* gpxTag_trk;
+ extern const char* gpxTag_trkpt;
+ extern const char* gpxTag_trkseg;
extern const char* gpxTag_wpt;
// TODO: add all remaining tags!
}
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/gpx/GPXgpxTagHandler.cpp #1070862:1070863
@@ -37,9 +37,9 @@
GeoNode* GPXgpxTagHandler::parse(GeoParser& parser) const
{
GeoDataDocument* doc = geoDataDoc( parser );
-//#ifdef DEBUG_TAGS
+#ifdef DEBUG_TAGS
mDebug() << "Parsed <" << gpxTag_gpx << "> document: " << doc;
-//#endif
+#endif
return doc;
}
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/gpx/GPXnameTagHandler.cpp #1070862:1070863
@@ -38,14 +38,15 @@
Q_ASSERT(parser.isStartElement() && parser.isValidElement(gpxTag_name));
GeoStackItem parentItem = parser.parentElement();
- if (parentItem.represents(gpxTag_wpt))
+ if (parentItem.represents(gpxTag_wpt)
+ || parentItem.represents(gpxTag_trk))
{
GeoDataPlacemark* placemark = parentItem.nodeAs<GeoDataPlacemark>();
placemark->setName(parser.readElementText().trimmed());
-//#ifdef DEBUG_TAGS
+#ifdef DEBUG_TAGS
mDebug() << "Parsed <" << gpxTag_name << "> : " << placemark->name();
-//#endif
+#endif
}
return 0;
}
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/gpx/GPXwptTagHandler.cpp #1070862:1070863
@@ -59,9 +59,9 @@
}
placemark.setCoordinate(lat, lon);
doc->append(placemark);
-//#ifdef DEBUG_TAGS
+#ifdef DEBUG_TAGS
mDebug() << "Parsed <" << gpxTag_wpt << "> waypoint: " << doc->size();
-//#endif
+#endif
return static_cast<GeoDataPlacemark*>(&doc->last());
}
mDebug() << "wpt parsing with parentitem" << parentItem.qualifiedName();
More information about the Marble-commits
mailing list