Skip to content
Permalink
Browse files

Fix QgsDistanceArea returning an uninitialized and never set

 member variable instead of the actual source crs srsid
  • Loading branch information
manisandro authored and mhugent committed May 7, 2014
1 parent 014f039 commit 35516fd344ef521d985746d6fe8ddfeaf5d64deb
Showing with 3 additions and 5 deletions.
  1. +1 −1 src/core/qgsdistancearea.cpp
  2. +2 −4 src/core/qgsdistancearea.h
@@ -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() );
}

@@ -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;
}

@@ -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(); }

@@ -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;

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

#endif

0 comments on commit 35516fd

Please sign in to comment.
You can’t perform that action at this time.