Skip to content

Commit

Permalink
Fix QgsDistanceArea returning an uninitialized and never set
Browse files Browse the repository at this point in the history
 member variable instead of the actual source crs srsid
  • Loading branch information
manisandro authored and mhugent committed May 7, 2014
1 parent 014f039 commit 35516fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/qgsdistancearea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ void QgsDistanceArea::_copy( const QgsDistanceArea & origDA )
// Some calculations and trig. Should not be TOO time consuming.
// Alternatively we could copy the temp vars?
computeAreaInit();
mSourceRefSys = origDA.mSourceRefSys;
mCoordTransform = new QgsCoordinateTransform( origDA.mCoordTransform->sourceCrs(), origDA.mCoordTransform->destCRS() );
}

Expand Down Expand Up @@ -1008,3 +1007,4 @@ void QgsDistanceArea::convertMeasurement( double &measure, QGis::UnitType &measu
QgsDebugMsg( QString( "to %1 %2" ).arg( QString::number( measure ), QGis::toLiteral( displayUnits ) ) );
measureUnits = displayUnits;
}

6 changes: 2 additions & 4 deletions src/core/qgsdistancearea.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class CORE_EXPORT QgsDistanceArea
void setSourceAuthId( QString authid );

//! returns source spatial reference system
long sourceCrs() const { return mSourceRefSys; }
long sourceCrs() const { return mCoordTransform->sourceCrs().srsid(); }
//! What sort of coordinate system is being used?
bool geographic() const { return mCoordTransform->sourceCrs().geographicFlag(); }

Expand Down Expand Up @@ -154,9 +154,6 @@ class CORE_EXPORT QgsDistanceArea
//! indicates whether we will transform coordinates
bool mEllipsoidalMode;

//! id of the source spatial reference system
long mSourceRefSys;

//! ellipsoid acronym (from table tbl_ellipsoids)
QString mEllipsoid;

Expand All @@ -180,3 +177,4 @@ class CORE_EXPORT QgsDistanceArea
};

#endif

0 comments on commit 35516fd

Please sign in to comment.