mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-10 00:05:25 -04:00
Small tidying up, replacing with GEO_NONE
This commit is contained in:
parent
412feddf43
commit
cb0d9f0930
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
#include "qgsmaptoolfeatureaction.h"
|
#include "qgsmaptoolfeatureaction.h"
|
||||||
|
|
||||||
#include "qgsdistancearea.h"
|
|
||||||
#include "qgsfeature.h"
|
#include "qgsfeature.h"
|
||||||
#include "qgsfield.h"
|
#include "qgsfield.h"
|
||||||
#include "qgsgeometry.h"
|
#include "qgsgeometry.h"
|
||||||
@ -111,7 +110,6 @@ bool QgsMapToolFeatureAction::doAction( QgsVectorLayer *layer, int x, int y )
|
|||||||
// load identify radius from settings
|
// load identify radius from settings
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
double identifyValue = settings.value( "/Map/identifyRadius", QGis::DEFAULT_IDENTIFY_RADIUS ).toDouble();
|
double identifyValue = settings.value( "/Map/identifyRadius", QGis::DEFAULT_IDENTIFY_RADIUS ).toDouble();
|
||||||
QString ellipsoid = settings.value( "/qgis/measure/ellipsoid", "WGS84" ).toString();
|
|
||||||
|
|
||||||
if ( identifyValue <= 0.0 )
|
if ( identifyValue <= 0.0 )
|
||||||
identifyValue = QGis::DEFAULT_IDENTIFY_RADIUS;
|
identifyValue = QGis::DEFAULT_IDENTIFY_RADIUS;
|
||||||
|
@ -204,7 +204,7 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int
|
|||||||
// load identify radius from settings
|
// load identify radius from settings
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
double identifyValue = settings.value( "/Map/identifyRadius", QGis::DEFAULT_IDENTIFY_RADIUS ).toDouble();
|
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 )
|
if ( identifyValue <= 0.0 )
|
||||||
identifyValue = QGis::DEFAULT_IDENTIFY_RADIUS;
|
identifyValue = QGis::DEFAULT_IDENTIFY_RADIUS;
|
||||||
|
@ -283,7 +283,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
|
|||||||
|
|
||||||
getEllipsoidList();
|
getEllipsoidList();
|
||||||
// Pre-select current ellipsoid
|
// 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 ) );
|
cmbEllipsoid->setCurrentIndex( cmbEllipsoid->findText( getEllipsoidName( myEllipsoidId ), Qt::MatchExactly ) );
|
||||||
// Check if CRS transformation is on, or else turn combobox off
|
// Check if CRS transformation is on, or else turn combobox off
|
||||||
if ( QgisApp::instance()->mapCanvas()->mapRenderer()->hasCrsTransformEnabled() )
|
if ( QgisApp::instance()->mapCanvas()->mapRenderer()->hasCrsTransformEnabled() )
|
||||||
|
@ -44,7 +44,7 @@ QgsDistanceArea::QgsDistanceArea()
|
|||||||
mEllipsoidalMode = false;
|
mEllipsoidalMode = false;
|
||||||
mCoordTransform = new QgsCoordinateTransform;
|
mCoordTransform = new QgsCoordinateTransform;
|
||||||
setSourceCrs( GEOCRS_ID ); // WGS 84
|
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 );
|
Q_UNUSED( f );
|
||||||
if ( values.length() == 2 )
|
if ( values.length() == 2 )
|
||||||
{
|
{
|
||||||
double number = getDoubleValue( values.at( 0 ), parent );
|
double number = getDoubleValue( values.at( 0 ), parent );
|
||||||
double scaler = pow( 10.0, getIntValue( values.at( 1 ), parent ) );
|
double scaler = pow( 10.0, getIntValue( values.at( 1 ), parent ) );
|
||||||
return QVariant( qRound( number * scaler ) / scaler );
|
return QVariant( round( number * scaler ) / scaler );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( values.length() == 1 )
|
if ( values.length() == 1 )
|
||||||
{
|
{
|
||||||
double number = getIntValue( values.at( 0 ), parent );
|
double number = getIntValue( values.at( 0 ), parent );
|
||||||
return QVariant( qRound( number) ).toInt();
|
return QVariant( round( number ) ).toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
return QVariant();
|
return QVariant();
|
||||||
@ -933,10 +933,10 @@ bool QgsExpression::needsGeometry()
|
|||||||
void QgsExpression::initGeomCalculator()
|
void QgsExpression::initGeomCalculator()
|
||||||
{
|
{
|
||||||
mCalc = new QgsDistanceArea;
|
mCalc = new QgsDistanceArea;
|
||||||
mCalc->setEllipsoidalMode( false );
|
|
||||||
QSettings settings;
|
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->setEllipsoid( ellipsoid );
|
||||||
|
mCalc->setEllipsoidalMode( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QgsExpression::prepare( const QgsFieldMap& fields )
|
bool QgsExpression::prepare( const QgsFieldMap& fields )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user