Skip to content

Commit 05c8c1e

Browse files
author
mhugent
committed
Better fix for crs bug
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8348 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 8008185 commit 05c8c1e

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/core/qgsspatialrefsys.cpp

+2-7
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ QgsSpatialRefSys::QgsSpatialRefSys(const QgsSpatialRefSys &srs)
125125
// Assignment operator
126126
QgsSpatialRefSys& QgsSpatialRefSys::operator=(const QgsSpatialRefSys& srs)
127127
{
128-
OSRDestroySpatialReference( mSRS );
129-
mSRS = OSRNewSpatialReference(NULL);
130-
131128
if (&srs != this)
132129
{
133130
mSrsId = srs.mSrsId;
@@ -141,10 +138,8 @@ QgsSpatialRefSys& QgsSpatialRefSys::operator=(const QgsSpatialRefSys& srs)
141138
mIsValidFlag = srs.mIsValidFlag;
142139
if(mIsValidFlag)
143140
{
144-
char *proj4src = NULL;
145-
OSRExportToProj4(srs.mSRS, &proj4src);
146-
OSRImportFromProj4(mSRS, proj4src);
147-
CPLFree(proj4src);
141+
OSRDestroySpatialReference(mSRS);
142+
mSRS = OSRClone(srs.mSRS);
148143
}
149144
}
150145
return *this;

0 commit comments

Comments
 (0)