Skip to content
Permalink
Browse files
Improved recognition of crs for wfs provider
git-svn-id: http://svn.osgeo.org/qgis/trunk@7055 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jun 29, 2007
1 parent bdf4f8e commit c4ecd847641f1d7606767172e56bebba29146331
Showing with 4 additions and 11 deletions.
  1. +3 −10 src/providers/wfs/qgswfsprovider.cpp
  2. +1 −1 src/providers/wfs/qgswfsprovider.h
@@ -60,7 +60,6 @@ QgsWFSProvider::QgsWFSProvider(const QString& uri)
QgsWFSProvider::~QgsWFSProvider()
{
delete mSelectedFeatures;
delete mSourceSRS;
for(std::list<std::pair<GEOS_GEOM::Envelope*, QgsFeature*> >::iterator it = mEnvelopesAndFeatures.begin();\
it != mEnvelopesAndFeatures.end(); ++it)
{
@@ -146,10 +145,7 @@ void QgsWFSProvider::reset()

QgsSpatialRefSys QgsWFSProvider::getSRS()
{
if (mSourceSRS)
return *mSourceSRS;
else
return QgsSpatialRefSys();
return mSourceSRS;
}

QgsRect QgsWFSProvider::extent()
@@ -291,7 +287,7 @@ int QgsWFSProvider::getFeatureGET(const QString& uri, const QString& geometryAtt
thematicAttributes.insert(it->name());
}

QgsWFSData dataReader(uri, &mExtent, mSourceSRS, &dataFeatures, geometryAttribute, thematicAttributes, &mWKBType);
QgsWFSData dataReader(uri, &mExtent, &mSourceSRS, &dataFeatures, geometryAttribute, thematicAttributes, &mWKBType);
if(dataReader.getWFSData() != 0)
{
qWarning("getWFSData returned with error");
@@ -723,12 +719,9 @@ int QgsWFSProvider::setSRSFromGML2(const QDomElement& wfsCollectionElement)
}
}

mSourceSRS = new QgsSpatialRefSys();
if(!mSourceSRS->createFromEpsg(epsgId))
if(!mSourceSRS.createFromEpsg(epsgId))
{
QgsDebugMsg("Error, creation of QgsSpatialRefSys failed");
delete mSourceSRS;
mSourceSRS = 0;
return 6;
}
return 0;
@@ -119,7 +119,7 @@ class QgsWFSProvider: public QgsVectorDataProvider
/**Geometry type of the features in this layer*/
mutable QGis::WKBTYPE mWKBType;
/**Source SRS*/
QgsSpatialRefSys* mSourceSRS;
QgsSpatialRefSys mSourceSRS;
int mFeatureCount;
/**Flag if provider is valid*/
bool mValid;

0 comments on commit c4ecd84

Please sign in to comment.