mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Added url/link parsing to the GPX provider
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@1416 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
76e6775e92
commit
3e6ae6d1ae
@ -1,8 +1,11 @@
|
||||
QGIS Change Log
|
||||
ChangeLog,v 1.78 2004/05/16 15:16:05 larsl Exp
|
||||
ChangeLog,v 1.79 2004/05/16 21:23:27 larsl Exp
|
||||
------------------------------------------------------------------------------
|
||||
Version 0.3 'Madison' .... development version
|
||||
|
||||
2004-05-16 [larsl] 0.2.0devel21
|
||||
** Added url/link parsing to the GPX provider
|
||||
|
||||
2004-05-16 [larsl] 0.2.0devel20
|
||||
** Corrected file name extension for PNG files
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl configure.in,v 1.82 2004/05/16 15:16:05 larsl Exp
|
||||
dnl configure.in,v 1.83 2004/05/16 21:23:27 larsl Exp
|
||||
|
||||
AC_INIT
|
||||
|
||||
@ -24,7 +24,7 @@ dnl ---------------------------------------------------------------------------
|
||||
MAJOR_VERSION=0
|
||||
MINOR_VERSION=2
|
||||
MICRO_VERSION=0
|
||||
EXTRA_VERSION=20
|
||||
EXTRA_VERSION=21
|
||||
if test $EXTRA_VERSION -eq 0; then
|
||||
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}
|
||||
else
|
||||
|
@ -202,6 +202,11 @@ bool GPSData::parseGPX(QDomNode& node) {
|
||||
if (!node2.isNull())
|
||||
wpt.name = (const char*)node2.firstChild().nodeValue();
|
||||
|
||||
// url is optional
|
||||
node2 = node.namedItem("url");
|
||||
if (!node2.isNull())
|
||||
wpt.url = (const char*)node2.firstChild().nodeValue();
|
||||
|
||||
// ele is optional
|
||||
node2 = node.namedItem("ele");
|
||||
if (!node2.isNull())
|
||||
@ -370,6 +375,10 @@ bool GPSData::parseLOC(QDomNode& node) {
|
||||
if (!(node2 = node.namedItem("name")).isNull())
|
||||
wpt.name = (const char*)node2.firstChild().nodeValue();
|
||||
|
||||
// link is optional
|
||||
if (!(node2 = node.namedItem("link")).isNull())
|
||||
wpt.url = (const char*)node2.firstChild().nodeValue();
|
||||
|
||||
// coord with lat and lon is required
|
||||
if ((node2 = node.namedItem("coord")).isNull())
|
||||
return false;
|
||||
|
@ -57,6 +57,7 @@ QgsGPXProvider::QgsGPXProvider(QString uri) : mDataSourceUri(uri),
|
||||
attributeFields.push_back(QgsField("lat", "text"));
|
||||
attributeFields.push_back(QgsField("lon", "text"));
|
||||
attributeFields.push_back(QgsField("ele", "text"));
|
||||
attributeFields.push_back(QgsField("url", "text"));
|
||||
}
|
||||
else if (mFeatureType == "route" || mFeatureType == "track") {
|
||||
mGeomType = 2;
|
||||
@ -147,6 +148,7 @@ QgsFeature *QgsGPXProvider::getNextFeature(bool fetchAttributes) {
|
||||
result->addAttribute("lon", QString("%1").arg(wpt.lon));
|
||||
if (!isnan(wpt.ele))
|
||||
result->addAttribute("ele", QString("%1").arg(wpt.ele));
|
||||
result->addAttribute("url", wpt.url);
|
||||
}
|
||||
|
||||
++mFid;
|
||||
|
Loading…
x
Reference in New Issue
Block a user