Skip to content

Commit

Permalink
Fix for bug #1136 measure tools show wrong values
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8709 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jul 4, 2008
1 parent 7e62632 commit a61a270
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/core/qgsdistancearea.cpp
Expand Up @@ -43,7 +43,7 @@ QgsDistanceArea::QgsDistanceArea()
// init with default settings
mProjectionsEnabled = FALSE;
mCoordTransform = new QgsCoordinateTransform;
setSourceSRS(EPSGID); // WGS 84
setSourceEPSG(EPSGID); // WGS 84
setEllipsoid("WGS84");
}

Expand All @@ -59,8 +59,14 @@ void QgsDistanceArea::setProjectionsEnabled(bool flag)
mProjectionsEnabled = flag;
}

void QgsDistanceArea::setSourceSRS(long srsid)
{
QgsSpatialRefSys srcSRS;
srcSRS.createFromSrsId(srsid);
mCoordTransform->setSourceSRS(srcSRS);
}

void QgsDistanceArea::setSourceSRS(long epsgId)
void QgsDistanceArea::setSourceEPSG(long epsgId)
{
QgsSpatialRefSys srcSRS;
srcSRS.createFromEpsg(epsgId);
Expand Down
5 changes: 4 additions & 1 deletion src/core/qgsdistancearea.h
Expand Up @@ -50,7 +50,10 @@ class CORE_EXPORT QgsDistanceArea
bool projectionsEnabled() { return mProjectionsEnabled; }

//! sets source spatial reference system (by QGIS SRS)
void setSourceSRS(long epsgId);
void setSourceSRS(long srsid);

//! sets source spatial reference system (by EPSG)
void setSourceEPSG(long epsgId);

//! returns source spatial reference system
long sourceSRS() { return mSourceRefSys; }
Expand Down

0 comments on commit a61a270

Please sign in to comment.