2004-05-07 18:44:20 +00:00
|
|
|
/***************************************************************************
|
|
|
|
qgsgpxprovider.cpp - Data provider for GPS eXchange files
|
|
|
|
-------------------
|
|
|
|
begin : 2004-04-14
|
|
|
|
copyright : (C) 2004 by Lars Luthman
|
|
|
|
email : larsl@users.sourceforge.net
|
|
|
|
|
|
|
|
Partly based on qgsdelimitedtextprovider.cpp, (C) 2004 Gary E. Sherman
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#include <cfloat>
|
|
|
|
#include <iostream>
|
|
|
|
#include <limits>
|
2004-06-03 14:05:01 +00:00
|
|
|
#include <math.h>
|
2004-05-07 18:44:20 +00:00
|
|
|
|
|
|
|
#include <qapp.h>
|
|
|
|
#include <qfile.h>
|
|
|
|
#include <qtextstream.h>
|
|
|
|
#include <qstringlist.h>
|
|
|
|
#include <qdom.h>
|
|
|
|
#include <qrect.h>
|
|
|
|
|
2004-08-17 16:14:09 +00:00
|
|
|
#include "../../src/qgis.h"
|
2004-05-07 18:44:20 +00:00
|
|
|
#include "../../src/qgsdataprovider.h"
|
|
|
|
#include "../../src/qgsfeature.h"
|
|
|
|
#include "../../src/qgsfield.h"
|
|
|
|
#include "../../src/qgsrect.h"
|
|
|
|
#include "qgsgpxprovider.h"
|
|
|
|
#include "gpsdata.h"
|
|
|
|
|
2004-06-14 04:35:20 +00:00
|
|
|
#ifdef WIN32
|
|
|
|
#define QGISEXTERN extern "C" __declspec( dllexport )
|
|
|
|
#else
|
|
|
|
#define QGISEXTERN extern "C"
|
|
|
|
#endif
|
|
|
|
|
2004-05-07 18:44:20 +00:00
|
|
|
|
2004-10-19 11:51:06 +00:00
|
|
|
const char* QgsGPXProvider::attr[] = { "Name", "Elevation", "Symbol", "Number",
|
|
|
|
"Comment", "Description", "Source",
|
|
|
|
"URL", "URL name" };
|
|
|
|
|
|
|
|
|
2004-05-10 22:59:12 +00:00
|
|
|
QgsGPXProvider::QgsGPXProvider(QString uri) : mDataSourceUri(uri),
|
2004-10-18 14:33:22 +00:00
|
|
|
mMinMaxCacheDirty(true),
|
|
|
|
mEditable(false) {
|
2004-05-07 18:44:20 +00:00
|
|
|
|
2004-05-10 22:59:12 +00:00
|
|
|
// assume that it won't work
|
|
|
|
mValid = false;
|
|
|
|
|
|
|
|
// get the filename and the type parameter from the URI
|
|
|
|
int fileNameEnd = uri.find('?');
|
|
|
|
if (fileNameEnd == -1 || uri.mid(fileNameEnd + 1, 5) != "type=") {
|
|
|
|
std::cerr<<"Bad URI - you need to specify the feature type"<<std::endl;
|
|
|
|
return;
|
|
|
|
}
|
2004-10-19 11:17:17 +00:00
|
|
|
QString typeStr = uri.mid(fileNameEnd + 6);
|
|
|
|
mFeatureType = (typeStr == "waypoint" ? WaypointType :
|
|
|
|
(typeStr == "route" ? RouteType : TrackType));
|
2004-05-10 22:59:12 +00:00
|
|
|
|
|
|
|
// set up the attributes and the geometry type depending on the feature type
|
2004-10-19 11:51:06 +00:00
|
|
|
attributeFields.push_back(QgsField(attr[NameAttr], "text"));
|
2004-10-19 11:17:17 +00:00
|
|
|
if (mFeatureType == WaypointType) {
|
2004-05-10 22:59:12 +00:00
|
|
|
mGeomType = 1;
|
2004-10-19 12:26:52 +00:00
|
|
|
for (int i = 0; i < 8; ++i)
|
|
|
|
mAllAttributes.push_back(i);
|
2004-10-19 11:51:06 +00:00
|
|
|
attributeFields.push_back(QgsField(attr[EleAttr], "text"));
|
|
|
|
attributeFields.push_back(QgsField(attr[SymAttr], "text"));
|
2004-05-10 22:59:12 +00:00
|
|
|
}
|
2004-10-19 11:17:17 +00:00
|
|
|
else if (mFeatureType == RouteType || mFeatureType == TrackType) {
|
2004-05-10 22:59:12 +00:00
|
|
|
mGeomType = 2;
|
2004-10-19 12:26:52 +00:00
|
|
|
for (int i = 0; i < 8; ++i)
|
|
|
|
mAllAttributes.push_back(7);
|
2004-10-19 11:51:06 +00:00
|
|
|
attributeFields.push_back(QgsField(attr[NumAttr], "text"));
|
2004-05-10 22:59:12 +00:00
|
|
|
}
|
2004-10-19 11:51:06 +00:00
|
|
|
attributeFields.push_back(QgsField(attr[CmtAttr], "text"));
|
|
|
|
attributeFields.push_back(QgsField(attr[DscAttr], "text"));
|
|
|
|
attributeFields.push_back(QgsField(attr[SrcAttr], "text"));
|
|
|
|
attributeFields.push_back(QgsField(attr[URLAttr], "text"));
|
|
|
|
attributeFields.push_back(QgsField(attr[URLNameAttr], "text"));
|
2004-05-10 22:59:12 +00:00
|
|
|
mFileName = uri.left(fileNameEnd);
|
|
|
|
|
2004-05-07 18:44:20 +00:00
|
|
|
// set the selection rectangle to null
|
|
|
|
mSelectionRectangle = 0;
|
|
|
|
|
|
|
|
// parse the file
|
2004-05-11 22:00:56 +00:00
|
|
|
data = GPSData::getData(mFileName);
|
|
|
|
if (data == 0)
|
|
|
|
return;
|
|
|
|
mValid = true;
|
2004-05-07 18:44:20 +00:00
|
|
|
|
|
|
|
// resize the cache matrix
|
|
|
|
mMinMaxCache=new double*[attributeFields.size()];
|
|
|
|
for(int i=0;i<attributeFields.size();i++) {
|
|
|
|
mMinMaxCache[i]=new double[2];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QgsGPXProvider::~QgsGPXProvider() {
|
|
|
|
for(int i=0;i<fieldCount();i++) {
|
|
|
|
delete mMinMaxCache[i];
|
|
|
|
}
|
|
|
|
delete[] mMinMaxCache;
|
2004-05-11 22:00:56 +00:00
|
|
|
GPSData::releaseData(mFileName);
|
2004-05-07 18:44:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the first feature resulting from a select operation
|
|
|
|
* @return QgsFeature
|
|
|
|
*/
|
|
|
|
QgsFeature *QgsGPXProvider::getFirstFeature(bool fetchAttributes) {
|
|
|
|
mFid = 0;
|
|
|
|
return getNextFeature(fetchAttributes);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the next feature resulting from a select operation
|
|
|
|
* Return 0 if there are no features in the selection set
|
|
|
|
* @return QgsFeature
|
|
|
|
*/
|
|
|
|
bool QgsGPXProvider::getNextFeature(QgsFeature &feature, bool fetchAttributes){
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the next feature resulting from a select operation
|
|
|
|
* Return 0 if there are no features in the selection set
|
|
|
|
* @return QgsFeature
|
|
|
|
*/
|
|
|
|
QgsFeature *QgsGPXProvider::getNextFeature(bool fetchAttributes) {
|
2004-10-19 12:26:52 +00:00
|
|
|
QgsFeature* feature = new QgsFeature(-1);
|
|
|
|
bool success;
|
|
|
|
if (fetchAttributes)
|
|
|
|
success = getNextFeature(feature, mAllAttributes, false);
|
|
|
|
else {
|
|
|
|
std::list<int> emptyList;
|
|
|
|
success = getNextFeature(feature, emptyList, false);
|
2004-05-07 18:44:20 +00:00
|
|
|
}
|
2004-10-19 12:26:52 +00:00
|
|
|
if (success)
|
|
|
|
return feature;
|
|
|
|
delete feature;
|
|
|
|
return NULL;
|
2004-05-07 18:44:20 +00:00
|
|
|
}
|
|
|
|
|
2004-05-19 15:18:39 +00:00
|
|
|
|
2004-10-19 12:26:52 +00:00
|
|
|
QgsFeature * QgsGPXProvider::getNextFeature(std::list<int>& attlist,
|
|
|
|
bool getnotcommited) {
|
|
|
|
QgsFeature* feature = new QgsFeature(-1);
|
|
|
|
bool success = getNextFeature(feature, attlist, getnotcommited);
|
|
|
|
if (success)
|
|
|
|
return feature;
|
|
|
|
delete feature;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool QgsGPXProvider::getNextFeature(QgsFeature* feature,
|
|
|
|
std::list<int>& attlist,
|
|
|
|
bool getnotcommitted) {
|
|
|
|
bool result = false;
|
|
|
|
|
2004-05-19 15:18:39 +00:00
|
|
|
std::list<int>::const_iterator iter;
|
|
|
|
|
2004-10-19 11:17:17 +00:00
|
|
|
if (mFeatureType == WaypointType) {
|
2004-05-19 15:18:39 +00:00
|
|
|
// go through the list of waypoints and return the first one that is in
|
|
|
|
// the bounds rectangle
|
2004-10-18 14:33:22 +00:00
|
|
|
int maxFid = data->getNumberOfWaypoints() +
|
2004-10-19 12:26:52 +00:00
|
|
|
(getnotcommitted ? mAddedFeatures.size() : 0);
|
2004-10-18 14:33:22 +00:00
|
|
|
|
|
|
|
for (; mFid < maxFid; ++mFid) {
|
|
|
|
const Waypoint* wpt;
|
|
|
|
if (mFid < data->getNumberOfWaypoints())
|
|
|
|
wpt = &(data->getWaypoint(mFid));
|
|
|
|
else {
|
|
|
|
wpt = dynamic_cast<Waypoint*>
|
|
|
|
(mAddedFeatures[mFid - data->getNumberOfWaypoints()]);
|
|
|
|
}
|
|
|
|
if (boundsCheck(wpt->lon, wpt->lat)) {
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->setFeatureId(mFid);
|
|
|
|
result = true;
|
2004-05-19 15:18:39 +00:00
|
|
|
|
|
|
|
// some wkb voodoo
|
|
|
|
char* geo = new char[21];
|
|
|
|
std::memset(geo, 0, 21);
|
|
|
|
geo[0] = endian();
|
|
|
|
geo[1] = 1;
|
2004-10-18 14:33:22 +00:00
|
|
|
std::memcpy(geo+5, &wpt->lon, sizeof(double));
|
|
|
|
std::memcpy(geo+13, &wpt->lat, sizeof(double));
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->setGeometry((unsigned char *)geo, sizeof(wkbPoint));
|
|
|
|
feature->setValid(true);
|
2004-05-19 15:18:39 +00:00
|
|
|
|
|
|
|
// add attributes if they are wanted
|
|
|
|
for (iter = attlist.begin(); iter != attlist.end(); ++iter) {
|
|
|
|
switch (*iter) {
|
|
|
|
case 0:
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[NameAttr], wpt->name);
|
2004-05-19 15:18:39 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2004-10-18 14:33:22 +00:00
|
|
|
if (wpt->ele == -std::numeric_limits<double>::max())
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[EleAttr], "");
|
2004-10-18 14:33:22 +00:00
|
|
|
else
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[EleAttr], QString("%1").arg(wpt->ele));
|
2004-05-19 15:18:39 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[SymAttr], wpt->sym);
|
2004-05-19 15:18:39 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[CmtAttr], wpt->cmt);
|
2004-05-19 15:18:39 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[DscAttr], wpt->desc);
|
2004-08-20 21:31:31 +00:00
|
|
|
break;
|
|
|
|
case 5:
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[SrcAttr], wpt->src);
|
2004-08-20 21:31:31 +00:00
|
|
|
break;
|
|
|
|
case 6:
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[URLAttr], wpt->url);
|
2004-08-20 21:31:31 +00:00
|
|
|
break;
|
|
|
|
case 7:
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[URLNameAttr], wpt->urlname);
|
2004-08-20 21:31:31 +00:00
|
|
|
break;
|
2004-05-19 15:18:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
++mFid;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-10-19 11:17:17 +00:00
|
|
|
else if (mFeatureType == RouteType) {
|
2004-05-19 15:18:39 +00:00
|
|
|
// go through the routes and return the first one that is in the bounds
|
|
|
|
// rectangle
|
2004-10-18 14:33:22 +00:00
|
|
|
int maxFid = data->getNumberOfRoutes() +
|
2004-10-19 12:26:52 +00:00
|
|
|
(getnotcommitted ? mAddedFeatures.size() : 0);
|
2004-10-18 14:33:22 +00:00
|
|
|
for (; mFid < maxFid; ++mFid) {
|
|
|
|
const Route* rte;
|
|
|
|
if (mFid < data->getNumberOfRoutes())
|
|
|
|
rte = &(data->getRoute(mFid));
|
|
|
|
else {
|
|
|
|
rte = dynamic_cast<Route*>
|
|
|
|
(mAddedFeatures[mFid - data->getNumberOfRoutes()]);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rte->points.size() == 0)
|
2004-05-19 15:18:39 +00:00
|
|
|
continue;
|
2004-10-18 14:33:22 +00:00
|
|
|
const Routepoint& rtept(rte->points[0]);
|
2004-05-19 15:18:39 +00:00
|
|
|
const QgsRect& b(*mSelectionRectangle);
|
2004-10-18 14:33:22 +00:00
|
|
|
if ((rte->xMax >= b.xMin()) && (rte->xMin <= b.xMax()) &&
|
|
|
|
(rte->yMax >= b.yMin()) && (rte->yMin <= b.yMax())) {
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->setFeatureId(mFid);
|
|
|
|
result = true;
|
2004-05-19 15:18:39 +00:00
|
|
|
|
|
|
|
// some wkb voodoo
|
2004-10-18 14:33:22 +00:00
|
|
|
int nPoints = rte->points.size();
|
2004-05-19 15:18:39 +00:00
|
|
|
char* geo = new char[9 + 16 * nPoints];
|
|
|
|
std::memset(geo, 0, 9 + 16 * nPoints);
|
|
|
|
geo[0] = endian();
|
|
|
|
geo[1] = 2;
|
|
|
|
std::memcpy(geo + 5, &nPoints, 4);
|
2004-10-18 14:33:22 +00:00
|
|
|
for (int i = 0; i < rte->points.size(); ++i) {
|
|
|
|
std::memcpy(geo + 9 + 16 * i, &rte->points[i].lon, sizeof(double));
|
|
|
|
std::memcpy(geo + 9 + 16 * i + 8, &rte->points[i].lat, sizeof(double));
|
2004-05-19 15:18:39 +00:00
|
|
|
}
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->setGeometry((unsigned char *)geo, 9 + 16 * nPoints);
|
|
|
|
feature->setValid(true);
|
2004-05-19 15:18:39 +00:00
|
|
|
|
|
|
|
// add attributes if they are wanted
|
|
|
|
for (iter = attlist.begin(); iter != attlist.end(); ++iter) {
|
|
|
|
if (*iter == 0)
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[NameAttr], rte->name);
|
2004-08-20 21:31:31 +00:00
|
|
|
else if (*iter == 1) {
|
2004-10-18 14:33:22 +00:00
|
|
|
if (rte->number == std::numeric_limits<int>::max())
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[NumAttr], "");
|
2004-08-20 21:31:31 +00:00
|
|
|
else
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[NumAttr], QString("%1").arg(rte->number));
|
2004-08-20 21:31:31 +00:00
|
|
|
}
|
|
|
|
else if (*iter == 2)
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[CmtAttr], rte->cmt);
|
2004-08-20 21:31:31 +00:00
|
|
|
else if (*iter == 3)
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[DscAttr], rte->desc);
|
2004-08-20 21:31:31 +00:00
|
|
|
else if (*iter == 4)
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[SrcAttr], rte->src);
|
2004-08-20 21:31:31 +00:00
|
|
|
else if (*iter == 5)
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[URLAttr], rte->url);
|
2004-08-20 21:31:31 +00:00
|
|
|
else if (*iter == 6)
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[URLNameAttr], rte->urlname);
|
2004-05-19 15:18:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
++mFid;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-10-19 11:17:17 +00:00
|
|
|
else if (mFeatureType == TrackType) {
|
2004-05-19 15:18:39 +00:00
|
|
|
// go through the tracks and return the first one that is in the bounds
|
|
|
|
// rectangle
|
2004-10-18 14:33:22 +00:00
|
|
|
int maxFid = data->getNumberOfTracks() +
|
2004-10-19 12:26:52 +00:00
|
|
|
(getnotcommitted ? mAddedFeatures.size() : 0);
|
2004-10-18 14:33:22 +00:00
|
|
|
for (; mFid < maxFid; ++mFid) {
|
|
|
|
const Track* trk;
|
|
|
|
if (mFid < data->getNumberOfTracks())
|
|
|
|
trk = &(data->getTrack(mFid));
|
|
|
|
else {
|
|
|
|
trk = dynamic_cast<Track*>
|
|
|
|
(mAddedFeatures[mFid - data->getNumberOfTracks()]);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (trk->segments.size() == 0)
|
2004-05-19 15:18:39 +00:00
|
|
|
continue;
|
2004-10-18 14:33:22 +00:00
|
|
|
if (trk->segments[0].points.size() == 0)
|
2004-05-19 15:18:39 +00:00
|
|
|
continue;
|
2004-10-18 14:33:22 +00:00
|
|
|
const Trackpoint& trkpt(trk->segments[0].points[0]);
|
2004-05-19 15:18:39 +00:00
|
|
|
const QgsRect& b(*mSelectionRectangle);
|
2004-10-18 14:33:22 +00:00
|
|
|
if ((trk->xMax >= b.xMin()) && (trk->xMin <= b.xMax()) &&
|
|
|
|
(trk->yMax >= b.yMin()) && (trk->yMin <= b.yMax())) {
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->setFeatureId(mFid);
|
|
|
|
result = true;
|
2004-05-19 15:18:39 +00:00
|
|
|
|
|
|
|
// some wkb voodoo
|
2004-10-18 14:33:22 +00:00
|
|
|
int nPoints = trk->segments[0].points.size();
|
2004-05-19 15:18:39 +00:00
|
|
|
char* geo = new char[9 + 16 * nPoints];
|
|
|
|
std::memset(geo, 0, 9 + 16 * nPoints);
|
|
|
|
geo[0] = endian();
|
|
|
|
geo[1] = 2;
|
|
|
|
std::memcpy(geo + 5, &nPoints, 4);
|
|
|
|
for (int i = 0; i < nPoints; ++i) {
|
2004-10-18 14:33:22 +00:00
|
|
|
std::memcpy(geo + 9 + 16 * i, &trk->segments[0].points[i].lon, sizeof(double));
|
|
|
|
std::memcpy(geo + 9 + 16 * i + 8, &trk->segments[0].points[i].lat, sizeof(double));
|
2004-05-19 15:18:39 +00:00
|
|
|
}
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->setGeometry((unsigned char *)geo, 9 + 16 * nPoints);
|
|
|
|
feature->setValid(true);
|
2004-05-19 15:18:39 +00:00
|
|
|
|
|
|
|
// add attributes if they are wanted
|
|
|
|
for (iter = attlist.begin(); iter != attlist.end(); ++iter) {
|
|
|
|
if (*iter == 0)
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[NameAttr], trk->name);
|
2004-08-20 21:31:31 +00:00
|
|
|
else if (*iter == 1) {
|
2004-10-18 14:33:22 +00:00
|
|
|
if (trk->number == std::numeric_limits<int>::max())
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[NumAttr], "");
|
2004-08-20 21:31:31 +00:00
|
|
|
else
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[NumAttr], QString("%1").arg(trk->number));
|
2004-08-20 21:31:31 +00:00
|
|
|
}
|
|
|
|
else if (*iter == 2)
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[CmtAttr], trk->cmt);
|
2004-08-20 21:31:31 +00:00
|
|
|
else if (*iter == 3)
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[DscAttr], trk->desc);
|
2004-08-20 21:31:31 +00:00
|
|
|
else if (*iter == 4)
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[SrcAttr], trk->src);
|
2004-08-20 21:31:31 +00:00
|
|
|
else if (*iter == 5)
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[URLAttr], trk->url);
|
2004-08-20 21:31:31 +00:00
|
|
|
else if (*iter == 6)
|
2004-10-19 12:26:52 +00:00
|
|
|
feature->addAttribute(attr[URLNameAttr], trk->urlname);
|
2004-05-19 15:18:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
++mFid;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
2004-05-16 20:39:47 +00:00
|
|
|
}
|
2004-05-07 18:44:20 +00:00
|
|
|
|
2004-05-19 15:18:39 +00:00
|
|
|
|
2004-05-07 18:44:20 +00:00
|
|
|
/**
|
|
|
|
* Select features based on a bounding rectangle. Features can be retrieved
|
|
|
|
* with calls to getFirstFeature and getNextFeature.
|
|
|
|
* @param mbr QgsRect containing the extent to use in selecting features
|
|
|
|
*/
|
|
|
|
void QgsGPXProvider::select(QgsRect *rect, bool useIntersect) {
|
|
|
|
|
|
|
|
// Setting a spatial filter doesn't make much sense since we have to
|
|
|
|
// compare each point against the rectangle.
|
|
|
|
// We store the rect and use it in getNextFeature to determine if the
|
|
|
|
// feature falls in the selection area
|
|
|
|
mSelectionRectangle = new QgsRect(*rect);
|
|
|
|
// Select implies an upcoming feature read so we reset the data source
|
|
|
|
reset();
|
|
|
|
// Reset the feature id to 0
|
|
|
|
mFid = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Identify features within the search radius specified by rect
|
|
|
|
* @param rect Bounding rectangle of search radius
|
|
|
|
* @return std::vector containing QgsFeature objects that intersect rect
|
|
|
|
*/
|
|
|
|
std::vector<QgsFeature>& QgsGPXProvider::identify(QgsRect * rect) {
|
|
|
|
// reset the data source since we need to be able to read through
|
|
|
|
// all features
|
|
|
|
reset();
|
|
|
|
std::cerr<<"Attempting to identify features falling within "
|
|
|
|
<<rect->stringRep()<<std::endl;
|
|
|
|
// select the features
|
|
|
|
select(rect);
|
2004-08-16 18:29:57 +00:00
|
|
|
// temporary fix to get this to compile under windows
|
|
|
|
std::vector<QgsFeature> features;
|
|
|
|
return features;
|
2004-05-07 18:44:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
unsigned char * QgsGPXProvider::getGeometryPointer(OGRFeature *fet){
|
|
|
|
unsigned char *gPtr=0;
|
|
|
|
// get the wkb representation
|
|
|
|
|
|
|
|
//geom->exportToWkb((OGRwkbByteOrder) endian(), gPtr);
|
|
|
|
return gPtr;
|
|
|
|
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
int QgsGPXProvider::endian() {
|
|
|
|
char *chkEndian = new char[4];
|
|
|
|
memset(chkEndian, '\0', 4);
|
|
|
|
chkEndian[0] = 0xE8;
|
|
|
|
|
|
|
|
int *ce = (int *) chkEndian;
|
|
|
|
int retVal;
|
|
|
|
if (232 == *ce)
|
|
|
|
retVal = NDR;
|
|
|
|
else
|
|
|
|
retVal = XDR;
|
|
|
|
delete[]chkEndian;
|
|
|
|
return retVal;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Return the extent of the layer
|
|
|
|
QgsRect *QgsGPXProvider::extent() {
|
2004-05-11 22:00:56 +00:00
|
|
|
return data->getExtent();
|
2004-05-07 18:44:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the feature type
|
|
|
|
*/
|
|
|
|
int QgsGPXProvider::geometryType() {
|
2004-05-10 22:59:12 +00:00
|
|
|
return mGeomType;
|
2004-05-07 18:44:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the feature type
|
|
|
|
*/
|
|
|
|
long QgsGPXProvider::featureCount() {
|
2004-10-19 11:17:17 +00:00
|
|
|
if (mFeatureType == WaypointType)
|
2004-05-11 22:00:56 +00:00
|
|
|
return data->getNumberOfWaypoints();
|
2004-10-19 11:17:17 +00:00
|
|
|
if (mFeatureType == RouteType)
|
2004-05-11 22:00:56 +00:00
|
|
|
return data->getNumberOfRoutes();
|
2004-10-19 11:17:17 +00:00
|
|
|
if (mFeatureType == TrackType)
|
2004-05-11 22:00:56 +00:00
|
|
|
return data->getNumberOfTracks();
|
2004-05-10 22:59:12 +00:00
|
|
|
return 0;
|
2004-05-07 18:44:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the number of fields
|
|
|
|
*/
|
|
|
|
int QgsGPXProvider::fieldCount() {
|
|
|
|
return attributeFields.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<QgsField>& QgsGPXProvider::fields(){
|
|
|
|
return attributeFields;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QgsGPXProvider::reset() {
|
|
|
|
// Reset feature id to 0
|
|
|
|
mFid = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString QgsGPXProvider::minValue(int position) {
|
|
|
|
if (position >= fieldCount()) {
|
|
|
|
std::cerr<<"Warning: access requested to invalid position "
|
|
|
|
<<"in QgsGPXProvider::minValue(..)"<<std::endl;
|
|
|
|
}
|
|
|
|
if (mMinMaxCacheDirty) {
|
|
|
|
fillMinMaxCash();
|
|
|
|
}
|
|
|
|
return QString::number(mMinMaxCache[position][0],'f',2);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString QgsGPXProvider::maxValue(int position) {
|
|
|
|
if (position >= fieldCount()) {
|
|
|
|
std::cerr<<"Warning: access requested to invalid position "
|
|
|
|
<<"in QgsGPXProvider::maxValue(..)"<<std::endl;
|
|
|
|
}
|
|
|
|
if (mMinMaxCacheDirty) {
|
|
|
|
fillMinMaxCash();
|
|
|
|
}
|
|
|
|
return QString::number(mMinMaxCache[position][1],'f',2);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QgsGPXProvider::fillMinMaxCash() {
|
|
|
|
for(int i=0;i<fieldCount();i++) {
|
|
|
|
mMinMaxCache[i][0]=DBL_MAX;
|
|
|
|
mMinMaxCache[i][1]=-DBL_MAX;
|
|
|
|
}
|
|
|
|
|
|
|
|
QgsFeature f;
|
|
|
|
reset();
|
|
|
|
|
|
|
|
getNextFeature(f, true);
|
|
|
|
do {
|
|
|
|
for(int i=0;i<fieldCount();i++) {
|
|
|
|
double value=(f.attributeMap())[i].fieldValue().toDouble();
|
|
|
|
if(value<mMinMaxCache[i][0]) {
|
|
|
|
mMinMaxCache[i][0]=value;
|
|
|
|
}
|
|
|
|
if(value>mMinMaxCache[i][1]) {
|
|
|
|
mMinMaxCache[i][1]=value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} while(getNextFeature(f, true));
|
|
|
|
|
|
|
|
mMinMaxCacheDirty=false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QgsGPXProvider::setDataSourceUri(QString uri) {
|
2004-05-10 22:59:12 +00:00
|
|
|
mDataSourceUri = uri;
|
2004-05-07 18:44:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString QgsGPXProvider::getDataSourceUri() {
|
2004-05-10 22:59:12 +00:00
|
|
|
return mDataSourceUri;
|
2004-05-07 18:44:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool QgsGPXProvider::isValid(){
|
|
|
|
return mValid;
|
|
|
|
}
|
|
|
|
|
2004-10-18 14:33:22 +00:00
|
|
|
bool QgsGPXProvider::startEditing() {
|
|
|
|
mEditable = true;
|
|
|
|
return true;
|
2004-09-27 21:30:27 +00:00
|
|
|
}
|
|
|
|
|
2004-10-18 14:33:22 +00:00
|
|
|
|
|
|
|
void QgsGPXProvider::stopEditing() {
|
|
|
|
mEditable = false;
|
2004-09-27 21:30:27 +00:00
|
|
|
}
|
|
|
|
|
2004-10-18 14:33:22 +00:00
|
|
|
|
|
|
|
bool QgsGPXProvider::commitChanges() {
|
|
|
|
for (int i = 0; i < mAddedFeatures.size(); ++i) {
|
2004-10-19 11:17:17 +00:00
|
|
|
if (mFeatureType == WaypointType)
|
2004-10-18 14:33:22 +00:00
|
|
|
data->addWaypoint(*dynamic_cast<Waypoint*>(mAddedFeatures[i]));
|
2004-10-19 11:17:17 +00:00
|
|
|
else if (mFeatureType == RouteType)
|
2004-10-18 14:33:22 +00:00
|
|
|
data->addRoute(*dynamic_cast<Route*>(mAddedFeatures[i]));
|
2004-10-19 11:17:17 +00:00
|
|
|
else if (mFeatureType == TrackType)
|
2004-10-18 14:33:22 +00:00
|
|
|
data->addTrack(*dynamic_cast<Track*>(mAddedFeatures[i]));
|
|
|
|
|
|
|
|
delete mAddedFeatures[i];
|
|
|
|
}
|
|
|
|
mAddedFeatures.clear();
|
|
|
|
|
|
|
|
// write back to file
|
|
|
|
QDomDocument qdd;
|
|
|
|
data->fillDom(qdd);
|
|
|
|
QFile file(mFileName);
|
|
|
|
if (file.open(IO_WriteOnly)) {
|
|
|
|
QTextStream stream(&file);
|
|
|
|
stream<<qdd.toString();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
std::cerr<<"Could not write \""<<mFileName<<"\""<<std::endl;
|
2004-09-27 21:30:27 +00:00
|
|
|
return false;
|
2004-10-18 14:33:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
2004-09-27 21:30:27 +00:00
|
|
|
}
|
|
|
|
|
2004-10-18 14:33:22 +00:00
|
|
|
|
|
|
|
bool QgsGPXProvider::rollBack() {
|
|
|
|
for (int i = 0; i < mAddedFeatures.size(); ++i)
|
|
|
|
delete mAddedFeatures[i];
|
|
|
|
mAddedFeatures.clear();
|
|
|
|
return true;
|
2004-09-27 21:30:27 +00:00
|
|
|
}
|
|
|
|
|
2004-10-18 14:33:22 +00:00
|
|
|
|
2004-07-11 16:22:50 +00:00
|
|
|
bool QgsGPXProvider::addFeature(QgsFeature* f) {
|
2004-10-18 14:33:22 +00:00
|
|
|
if (!mEditable)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
GPSObject* obj = NULL;
|
|
|
|
|
2004-08-17 16:14:09 +00:00
|
|
|
unsigned char* geo = f->getGeometry();
|
2004-07-11 16:22:50 +00:00
|
|
|
int id;
|
2004-08-17 16:14:09 +00:00
|
|
|
QGis::WKBTYPE ftype;
|
|
|
|
memcpy(&ftype, (geo + 1), sizeof(int));
|
|
|
|
|
|
|
|
/* Do different things for different geometry types:
|
|
|
|
WKBPoint -> add waypoint if this is a waypoint layer
|
|
|
|
WKBLineString -> add track if this is a track layer, route if this is a
|
|
|
|
route layer
|
|
|
|
WKBPolygon and the WKBMulti types are not supported because they don't
|
|
|
|
make sense for GPX files. */
|
|
|
|
switch(ftype) {
|
|
|
|
|
|
|
|
// the user is trying to add a point feature
|
|
|
|
case QGis::WKBPoint: {
|
2004-10-19 11:17:17 +00:00
|
|
|
if (mFeatureType != WaypointType) {
|
2004-08-17 16:14:09 +00:00
|
|
|
std::cerr<<"Tried to write point feature to non-point layer!"<<std::endl;
|
|
|
|
return false;
|
|
|
|
}
|
2004-10-18 14:33:22 +00:00
|
|
|
mAddedFeatures.push_back(new Waypoint);
|
|
|
|
Waypoint* wpt(dynamic_cast<Waypoint*>(mAddedFeatures[mAddedFeatures.size() - 1]));
|
|
|
|
wpt->lat = *((double*)(geo + 5 + sizeof(double)));
|
|
|
|
wpt->lon = *((double*)(geo + 5));
|
|
|
|
|
|
|
|
// parse waypoint-specific attributes
|
2004-07-11 16:22:50 +00:00
|
|
|
std::vector<QgsFeatureAttribute>::const_iterator iter;
|
|
|
|
for (iter = f->attributeMap().begin();
|
|
|
|
iter != f->attributeMap().end(); ++iter) {
|
2004-10-18 14:33:22 +00:00
|
|
|
if (iter->fieldName() == "ele") {
|
|
|
|
bool b;
|
|
|
|
double d = iter->fieldValue().toDouble(&b);
|
|
|
|
if (b)
|
|
|
|
wpt->ele = d;
|
|
|
|
else
|
|
|
|
wpt->ele = -std::numeric_limits<double>::max();
|
|
|
|
}
|
2004-08-20 21:31:31 +00:00
|
|
|
else if (iter->fieldName() == "sym")
|
2004-10-18 14:33:22 +00:00
|
|
|
wpt->sym = iter->fieldValue();
|
2004-07-11 16:22:50 +00:00
|
|
|
}
|
2004-10-18 14:33:22 +00:00
|
|
|
|
|
|
|
obj = wpt;
|
|
|
|
|
2004-08-17 18:13:05 +00:00
|
|
|
break;
|
2004-07-11 16:22:50 +00:00
|
|
|
}
|
2004-08-17 16:14:09 +00:00
|
|
|
|
|
|
|
// the user is trying to add a line feature
|
|
|
|
case QGis::WKBLineString: {
|
2004-10-19 11:17:17 +00:00
|
|
|
if (mFeatureType == WaypointType) {
|
2004-08-17 16:14:09 +00:00
|
|
|
std::cerr<<"Tried to write line feature to point layer!"<<std::endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// get the number of points
|
|
|
|
int length;
|
|
|
|
memcpy(&length,f->getGeometry()+1+sizeof(int),sizeof(int));
|
|
|
|
#ifdef QGISDEBUG
|
|
|
|
qWarning("length: "+QString::number(length));
|
|
|
|
#endif
|
|
|
|
|
2004-10-18 14:33:22 +00:00
|
|
|
GPSExtended* ext = NULL;
|
|
|
|
|
2004-08-17 16:14:09 +00:00
|
|
|
// add route
|
2004-10-19 11:17:17 +00:00
|
|
|
if (mFeatureType == RouteType) {
|
2004-10-18 14:33:22 +00:00
|
|
|
mAddedFeatures.push_back(new Route);
|
|
|
|
Route* rte(dynamic_cast<Route*>(mAddedFeatures[mAddedFeatures.size() - 1]));
|
2004-08-17 16:14:09 +00:00
|
|
|
for (int i = 0; i < length; ++i) {
|
|
|
|
Routepoint rpt;
|
|
|
|
std::memcpy(&rpt.lon, geo + 9 + 16 * i, sizeof(double));
|
|
|
|
std::memcpy(&rpt.lat, geo + 9 + 16 * i + 8, sizeof(double));
|
2004-08-20 12:29:07 +00:00
|
|
|
|
|
|
|
// update the route bounds
|
2004-10-18 14:33:22 +00:00
|
|
|
rte->xMin = (rte->xMin < rpt.lon ? rte->xMin : rpt.lon);
|
|
|
|
rte->xMax = (rte->xMax > rpt.lon ? rte->xMax : rpt.lon);
|
|
|
|
rte->yMin = (rte->yMin < rpt.lat ? rte->yMin : rpt.lat);
|
|
|
|
rte->yMax = (rte->yMax > rpt.lat ? rte->yMax : rpt.lat);
|
2004-10-18 18:53:24 +00:00
|
|
|
|
2004-10-18 14:33:22 +00:00
|
|
|
rte->points.push_back(rpt);
|
2004-08-17 16:14:09 +00:00
|
|
|
}
|
2004-10-18 14:33:22 +00:00
|
|
|
|
|
|
|
ext = rte;
|
2004-08-17 16:14:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// add track
|
2004-10-19 11:17:17 +00:00
|
|
|
else if (mFeatureType == TrackType) {
|
2004-10-18 14:33:22 +00:00
|
|
|
mAddedFeatures.push_back(new Track);
|
|
|
|
Track* trk(dynamic_cast<Track*>(mAddedFeatures[mAddedFeatures.size() - 1]));
|
2004-08-17 16:14:09 +00:00
|
|
|
TrackSegment trkSeg;
|
|
|
|
for (int i = 0; i < length; ++i) {
|
|
|
|
Trackpoint tpt;
|
|
|
|
std::memcpy(&tpt.lon, geo + 9 + 16 * i, sizeof(double));
|
|
|
|
std::memcpy(&tpt.lat, geo + 9 + 16 * i + 8, sizeof(double));
|
2004-08-20 12:29:07 +00:00
|
|
|
|
|
|
|
// update the track bounds
|
2004-10-18 14:33:22 +00:00
|
|
|
trk->xMin = (trk->xMin < tpt.lon ? trk->xMin : tpt.lon);
|
|
|
|
trk->xMax = (trk->xMax > tpt.lon ? trk->xMax : tpt.lon);
|
|
|
|
trk->yMin = (trk->yMin < tpt.lat ? trk->yMin : tpt.lat);
|
|
|
|
trk->yMax = (trk->yMax > tpt.lat ? trk->yMax : tpt.lat);
|
2004-08-20 12:29:07 +00:00
|
|
|
|
2004-08-17 16:14:09 +00:00
|
|
|
trkSeg.points.push_back(tpt);
|
|
|
|
}
|
2004-10-18 14:33:22 +00:00
|
|
|
trk->segments.push_back(trkSeg);
|
|
|
|
|
|
|
|
ext = trk;
|
|
|
|
}
|
|
|
|
|
|
|
|
// parse GPSExtended-specific attributes
|
|
|
|
std::vector<QgsFeatureAttribute>::const_iterator iter;
|
|
|
|
for (iter = f->attributeMap().begin();
|
|
|
|
iter != f->attributeMap().end(); ++iter) {
|
|
|
|
if (iter->fieldName() == "number") {
|
|
|
|
bool b;
|
|
|
|
int n = iter->fieldValue().toInt(&b);
|
|
|
|
if (b)
|
|
|
|
ext->number = n;
|
|
|
|
else
|
|
|
|
ext->number = std::numeric_limits<int>::max();
|
|
|
|
}
|
2004-08-17 16:14:09 +00:00
|
|
|
}
|
|
|
|
|
2004-10-18 14:33:22 +00:00
|
|
|
obj = ext;
|
|
|
|
|
2004-08-17 16:14:09 +00:00
|
|
|
break;
|
|
|
|
}
|
2004-08-17 18:13:05 +00:00
|
|
|
|
|
|
|
// unsupported geometry - something's wrong
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
|
2004-08-17 16:14:09 +00:00
|
|
|
}
|
|
|
|
|
2004-10-18 14:33:22 +00:00
|
|
|
// parse common attributes
|
|
|
|
std::vector<QgsFeatureAttribute>::const_iterator iter;
|
|
|
|
for (iter = f->attributeMap().begin();
|
|
|
|
iter != f->attributeMap().end(); ++iter) {
|
|
|
|
if (iter->fieldName() == "name")
|
|
|
|
obj->name = iter->fieldValue();
|
|
|
|
else if (iter->fieldName() == "cmt")
|
|
|
|
obj->cmt = iter->fieldValue();
|
|
|
|
else if (iter->fieldName() == "desc")
|
|
|
|
obj->desc = iter->fieldValue();
|
|
|
|
else if (iter->fieldName() == "src")
|
|
|
|
obj->src = iter->fieldValue();
|
|
|
|
else if (iter->fieldName() == "url")
|
|
|
|
obj->url = iter->fieldValue();
|
|
|
|
else if (iter->fieldName() == "urlname")
|
|
|
|
obj->urlname = iter->fieldValue();
|
2004-08-17 18:13:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
2004-07-11 06:01:10 +00:00
|
|
|
}
|
|
|
|
|
2004-08-17 16:14:09 +00:00
|
|
|
|
2004-07-11 16:22:50 +00:00
|
|
|
bool QgsGPXProvider::deleteFeature(int id) {
|
|
|
|
return false;
|
2004-07-11 06:01:10 +00:00
|
|
|
}
|
2004-05-07 18:44:20 +00:00
|
|
|
|
2004-08-17 16:14:09 +00:00
|
|
|
|
2004-10-29 21:55:43 +00:00
|
|
|
QString QgsGPXProvider::getDefaultValue(const QString& attr, QgsFeature* f) {
|
|
|
|
if (attr == "source")
|
|
|
|
return "Digitized in QGIS";
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-05-07 18:44:20 +00:00
|
|
|
/**
|
|
|
|
* Check to see if the point is within the selection rectangle
|
|
|
|
*/
|
|
|
|
bool QgsGPXProvider::boundsCheck(double x, double y)
|
|
|
|
{
|
|
|
|
bool inBounds = (((x < mSelectionRectangle->xMax()) &&
|
|
|
|
(x > mSelectionRectangle->xMin())) &&
|
|
|
|
((y < mSelectionRectangle->yMax()) &&
|
|
|
|
(y > mSelectionRectangle->yMin())));
|
|
|
|
QString hit = inBounds?"true":"false";
|
|
|
|
return inBounds;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class factory to return a pointer to a newly created
|
|
|
|
* QgsGPXProvider object
|
|
|
|
*/
|
2004-06-14 04:35:20 +00:00
|
|
|
QGISEXTERN QgsGPXProvider * classFactory(const char *uri) {
|
2004-05-07 18:44:20 +00:00
|
|
|
return new QgsGPXProvider(uri);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** Required key function (used to map the plugin to a data store type)
|
|
|
|
*/
|
2004-06-14 04:35:20 +00:00
|
|
|
QGISEXTERN QString providerKey(){
|
2004-05-07 18:44:20 +00:00
|
|
|
return QString("gpx");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Required description function
|
|
|
|
*/
|
2004-06-14 04:35:20 +00:00
|
|
|
QGISEXTERN QString description(){
|
2004-09-23 09:07:50 +00:00
|
|
|
return QString("GPS eXchange format provider");
|
2004-05-07 18:44:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Required isProvider function. Used to determine if this shared library
|
|
|
|
* is a data provider plugin
|
|
|
|
*/
|
2004-06-14 04:35:20 +00:00
|
|
|
QGISEXTERN bool isProvider(){
|
2004-05-07 18:44:20 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|