Skip to content

Commit

Permalink
Improved recognition of crs for wfs provider
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7055 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jun 29, 2007
1 parent e29e972 commit 0d32bcc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
13 changes: 3 additions & 10 deletions src/providers/wfs/qgswfsprovider.cpp
Expand Up @@ -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)
{
Expand Down Expand Up @@ -146,10 +145,7 @@ void QgsWFSProvider::reset()

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

QgsRect QgsWFSProvider::extent()
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/providers/wfs/qgswfsprovider.h
Expand Up @@ -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;
Expand Down

0 comments on commit 0d32bcc

Please sign in to comment.