Skip to content
Permalink
Browse files

Small tidying up, replacing with GEO_NONE

  • Loading branch information
homann committed Aug 29, 2012
1 parent 412fedd commit cb0d9f093048fb83b0a400e893b5e6d9d5344703
@@ -15,7 +15,6 @@

#include "qgsmaptoolfeatureaction.h"

#include "qgsdistancearea.h"
#include "qgsfeature.h"
#include "qgsfield.h"
#include "qgsgeometry.h"
@@ -111,7 +110,6 @@ bool QgsMapToolFeatureAction::doAction( QgsVectorLayer *layer, int x, int y )
// load identify radius from settings
QSettings settings;
double identifyValue = settings.value( "/Map/identifyRadius", QGis::DEFAULT_IDENTIFY_RADIUS ).toDouble();
QString ellipsoid = settings.value( "/qgis/measure/ellipsoid", "WGS84" ).toString();

if ( identifyValue <= 0.0 )
identifyValue = QGis::DEFAULT_IDENTIFY_RADIUS;
@@ -204,7 +204,7 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int
// load identify radius from settings
QSettings settings;
double identifyValue = settings.value( "/Map/identifyRadius", QGis::DEFAULT_IDENTIFY_RADIUS ).toDouble();
QString ellipsoid = settings.value( "/qgis/measure/ellipsoid", "WGS84" ).toString();
QString ellipsoid = settings.value( "/qgis/measure/ellipsoid", GEO_NONE ).toString();

if ( identifyValue <= 0.0 )
identifyValue = QGis::DEFAULT_IDENTIFY_RADIUS;
@@ -283,7 +283,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :

getEllipsoidList();
// Pre-select current ellipsoid
QString myEllipsoidId = settings.value( "/qgis/measure/ellipsoid", "WGS84" ).toString();
QString myEllipsoidId = settings.value( "/qgis/measure/ellipsoid", GEO_NONE ).toString();
cmbEllipsoid->setCurrentIndex( cmbEllipsoid->findText( getEllipsoidName( myEllipsoidId ), Qt::MatchExactly ) );
// Check if CRS transformation is on, or else turn combobox off
if ( QgisApp::instance()->mapCanvas()->mapRenderer()->hasCrsTransformEnabled() )
@@ -44,7 +44,7 @@ QgsDistanceArea::QgsDistanceArea()
mEllipsoidalMode = false;
mCoordTransform = new QgsCoordinateTransform;
setSourceCrs( GEOCRS_ID ); // WGS 84
setEllipsoid( "WGS84" );
setEllipsoid( GEO_NONE );
}


@@ -773,15 +773,15 @@ static QVariant fcnRound( const QVariantList& values , QgsFeature *f, QgsExpress
Q_UNUSED( f );
if ( values.length() == 2 )
{
double number = getDoubleValue( values.at( 0 ), parent );
double scaler = pow( 10.0, getIntValue( values.at( 1 ), parent ) );
return QVariant( qRound( number * scaler ) / scaler );
double number = getDoubleValue( values.at( 0 ), parent );
double scaler = pow( 10.0, getIntValue( values.at( 1 ), parent ) );
return QVariant( round( number * scaler ) / scaler );
}

if ( values.length() == 1 )
{
double number = getIntValue( values.at( 0 ), parent );
return QVariant( qRound( number) ).toInt();
double number = getIntValue( values.at( 0 ), parent );
return QVariant( round( number ) ).toInt();
}

return QVariant();
@@ -933,10 +933,10 @@ bool QgsExpression::needsGeometry()
void QgsExpression::initGeomCalculator()
{
mCalc = new QgsDistanceArea;
mCalc->setEllipsoidalMode( false );
QSettings settings;
QString ellipsoid = settings.value( "/qgis/measure/ellipsoid", "WGS84" ).toString();
QString ellipsoid = settings.value( "/qgis/measure/ellipsoid", GEO_NONE ).toString();
mCalc->setEllipsoid( ellipsoid );
mCalc->setEllipsoidalMode( false );
}

bool QgsExpression::prepare( const QgsFieldMap& fields )

0 comments on commit cb0d9f0

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