Skip to content

Commit c0a8ee5

Browse files
committedFeb 24, 2017
Do not re-lookup already present CRSes
1 parent 10f50ee commit c0a8ee5

18 files changed

+21
-21
lines changed
 

‎python/plugins/processing/algs/qgis/FieldsCalculator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def processAlgorithm(self, feedback):
9999
exp = QgsExpression(formula)
100100

101101
da = QgsDistanceArea()
102-
da.setSourceCrs(layer.crs().srsid())
102+
da.setSourceCrs(layer.crs())
103103
da.setEllipsoidalMode(
104104
iface.mapCanvas().mapSettings().hasCrsTransformEnabled())
105105
da.setEllipsoid(QgsProject.instance().readEntry(

‎python/plugins/processing/algs/qgis/FieldsMapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def processAlgorithm(self, feedback):
103103
expressions = []
104104

105105
da = QgsDistanceArea()
106-
da.setSourceCrs(layer.crs().srsid())
106+
da.setSourceCrs(layer.crs())
107107
da.setEllipsoidalMode(
108108
iface.mapCanvas().mapSettings().hasCrsTransformEnabled())
109109
da.setEllipsoid(QgsProject.instance().readEntry(

‎python/plugins/processing/algs/qgis/HubDistanceLines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def processAlgorithm(self, feedback):
9999
index = vector.spatialindex(layerHubs)
100100

101101
distance = QgsDistanceArea()
102-
distance.setSourceCrs(layerPoints.crs().srsid())
102+
distance.setSourceCrs(layerPoints.crs())
103103
distance.setEllipsoidalMode(True)
104104

105105
# Scan source points, find nearest hub, and write to output file

‎python/plugins/processing/algs/qgis/HubDistancePoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def processAlgorithm(self, feedback):
9999
index = vector.spatialindex(layerHubs)
100100

101101
distance = QgsDistanceArea()
102-
distance.setSourceCrs(layerPoints.crs().srsid())
102+
distance.setSourceCrs(layerPoints.crs())
103103
distance.setEllipsoidalMode(True)
104104

105105
# Scan source points, find nearest hub, and write to output file

‎src/analysis/network/qgsgraphbuilderinterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ANALYSIS_EXPORT QgsGraphBuilderInterface
4646
, mCtfEnabled( ctfEnabled )
4747
, mTopologyTolerance( topologyTolerance )
4848
{
49-
mDa.setSourceCrs( mCrs.srsid() );
49+
mDa.setSourceCrs( mCrs );
5050
mDa.setEllipsoid( ellipsoidID );
5151
mDa.setEllipsoidalMode( ctfEnabled );
5252
}

‎src/analysis/vector/qgstransectsample.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ int QgsTransectSample::createSample( QProgressDialog* pd )
123123

124124
//configure distanceArea depending on minDistance units and output CRS
125125
QgsDistanceArea distanceArea;
126-
distanceArea.setSourceCrs( mStrataLayer->crs().srsid() );
126+
distanceArea.setSourceCrs( mStrataLayer->crs() );
127127
if ( mMinDistanceUnits == Meters )
128128
{
129129
distanceArea.setEllipsoidalMode( true );

‎src/app/qgisapp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7506,7 +7506,7 @@ void QgisApp::selectByForm()
75067506
}
75077507
QgsDistanceArea myDa;
75087508

7509-
myDa.setSourceCrs( vlayer->crs().srsid() );
7509+
myDa.setSourceCrs( vlayer->crs() );
75107510
myDa.setEllipsoidalMode( true );
75117511
myDa.setEllipsoid( QgsProject::instance()->ellipsoid() );
75127512

‎src/app/qgisappinterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ QgsAttributeDialog* QgisAppInterface::getFeatureForm( QgsVectorLayer *l, QgsFeat
697697
{
698698
QgsDistanceArea myDa;
699699

700-
myDa.setSourceCrs( l->crs().srsid() );
700+
myDa.setSourceCrs( l->crs() );
701701
myDa.setEllipsoidalMode( true );
702702
myDa.setEllipsoid( QgsProject::instance()->ellipsoid() );
703703

‎src/app/qgsattributeactionpropertiesdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ void QgsAttributeActionPropertiesDialog::init( const QSet<QString>& actionScopes
199199
}
200200

201201
QgsDistanceArea myDa;
202-
myDa.setSourceCrs( mLayer->crs().srsid() );
202+
myDa.setSourceCrs( mLayer->crs() );
203203
myDa.setEllipsoidalMode( true );
204204
myDa.setEllipsoid( QgsProject::instance()->ellipsoid() );
205205

‎src/app/qgsattributetabledialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ void QgsAttributeTableDialog::filterExpressionBuilder()
586586
dlg.setWindowTitle( tr( "Expression based filter" ) );
587587

588588
QgsDistanceArea myDa;
589-
myDa.setSourceCrs( mLayer->crs().srsid() );
589+
myDa.setSourceCrs( mLayer->crs() );
590590
myDa.setEllipsoidalMode( true );
591591
myDa.setEllipsoid( QgsProject::instance()->ellipsoid() );
592592
dlg.setGeomCalculator( myDa );
@@ -947,7 +947,7 @@ void QgsAttributeTableDialog::setFilterExpression( const QString& filterString,
947947
QgsFeatureIds filteredFeatures;
948948
QgsDistanceArea myDa;
949949

950-
myDa.setSourceCrs( mLayer->crs().srsid() );
950+
myDa.setSourceCrs( mLayer->crs() );
951951
myDa.setEllipsoidalMode( true );
952952
myDa.setEllipsoid( QgsProject::instance()->ellipsoid() );
953953

‎src/app/qgsdiagramproperties.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ QgsDiagramProperties::QgsDiagramProperties( QgsVectorLayer* layer, QWidget* pare
173173
// field combo and expression button
174174
mSizeFieldExpressionWidget->setLayer( mLayer );
175175
QgsDistanceArea myDa;
176-
myDa.setSourceCrs( mLayer->crs().srsid() );
176+
myDa.setSourceCrs( mLayer->crs() );
177177
myDa.setEllipsoidalMode( true );
178178
myDa.setEllipsoid( QgsProject::instance()->ellipsoid() );
179179
mSizeFieldExpressionWidget->setGeomCalculator( myDa );
@@ -865,7 +865,7 @@ QString QgsDiagramProperties::showExpressionBuilder( const QString& initialExpre
865865
dlg.setWindowTitle( tr( "Expression based attribute" ) );
866866

867867
QgsDistanceArea myDa;
868-
myDa.setSourceCrs( mLayer->crs().srsid() );
868+
myDa.setSourceCrs( mLayer->crs() );
869869
myDa.setEllipsoidalMode( true );
870870
myDa.setEllipsoid( QgsProject::instance()->ellipsoid() );
871871
dlg.setGeomCalculator( myDa );

‎src/app/qgsfieldcalculator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ QgsFieldCalculator::QgsFieldCalculator( QgsVectorLayer* vl, QWidget* parent )
5555
connect( mOutputFieldWidthSpinBox, SIGNAL( editingFinished() ), this, SLOT( setPrecisionMinMax() ) );
5656

5757
QgsDistanceArea myDa;
58-
myDa.setSourceCrs( vl->crs().srsid() );
58+
myDa.setSourceCrs( vl->crs() );
5959
myDa.setEllipsoidalMode( true );
6060
myDa.setEllipsoid( QgsProject::instance()->ellipsoid() );
6161
builder->setGeomCalculator( myDa );
@@ -155,7 +155,7 @@ void QgsFieldCalculator::accept()
155155
// Set up QgsDistanceArea each time we (re-)calculate
156156
QgsDistanceArea myDa;
157157

158-
myDa.setSourceCrs( mVectorLayer->crs().srsid() );
158+
myDa.setSourceCrs( mVectorLayer->crs() );
159159
myDa.setEllipsoidalMode( true );
160160
myDa.setEllipsoid( QgsProject::instance()->ellipsoid() );
161161

‎src/app/qgslabelinggui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ void QgsLabelingGui::setLayer( QgsMapLayer* mapLayer )
107107

108108
mFieldExpressionWidget->setLayer( mLayer );
109109
QgsDistanceArea da;
110-
da.setSourceCrs( mLayer->crs().srsid() );
110+
da.setSourceCrs( mLayer->crs() );
111111
da.setEllipsoidalMode( true );
112112
da.setEllipsoid( QgsProject::instance()->ellipsoid() );
113113
mFieldExpressionWidget->setGeomCalculator( da );

‎src/app/qgsmaptoolmeasureangle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void QgsMapToolMeasureAngle::updateSettings()
182182
void QgsMapToolMeasureAngle::configureDistanceArea()
183183
{
184184
QString ellipsoidId = QgsProject::instance()->ellipsoid();
185-
mDa.setSourceCrs( mCanvas->mapSettings().destinationCrs().srsid() );
185+
mDa.setSourceCrs( mCanvas->mapSettings().destinationCrs() );
186186
mDa.setEllipsoid( ellipsoidId );
187187
mDa.setEllipsoidalMode( true );
188188
}

‎src/app/qgsmeasuredialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void QgsMeasureDialog::updateSettings()
7777
// Configure QgsDistanceArea
7878
mDistanceUnits = QgsProject::instance()->distanceUnits();
7979
mAreaUnits = QgsProject::instance()->areaUnits();
80-
mDa.setSourceCrs( mTool->canvas()->mapSettings().destinationCrs().srsid() );
80+
mDa.setSourceCrs( mTool->canvas()->mapSettings().destinationCrs() );
8181
mDa.setEllipsoid( QgsProject::instance()->ellipsoid() );
8282
mDa.setEllipsoidalMode( true );
8383

‎src/core/composer/qgscomposerscalebar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ double QgsComposerScaleBar::mapWidth() const
338338
{
339339
QgsDistanceArea da;
340340
da.setEllipsoidalMode( true );
341-
da.setSourceCrs( mComposerMap->crs().srsid() );
341+
da.setSourceCrs( mComposerMap->crs() );
342342
da.setEllipsoid( mComposition->project()->ellipsoid() );
343343

344344
QgsUnitTypes::DistanceUnit units = QgsUnitTypes::DistanceMeters;

‎src/gui/qgsmaptoolidentify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ QMap< QString, QString > QgsMapToolIdentify::featureDerivedAttributes( QgsFeatur
355355
QgsDistanceArea calc;
356356
calc.setEllipsoidalMode( true );
357357
calc.setEllipsoid( ellipsoid );
358-
calc.setSourceCrs( layer->crs().srsid() );
358+
calc.setSourceCrs( layer->crs() );
359359

360360
QgsWkbTypes::Type wkbType = QgsWkbTypes::NoGeometry;
361361
QgsWkbTypes::GeometryType geometryType = QgsWkbTypes::NullGeometry;

‎src/providers/grass/qgsgrassgislib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ int GRASS_LIB_EXPORT QgsGrassGisLib::G__gisinit( const char * version, const cha
234234
mCrs.saveAsUserCRS( myName );
235235
}
236236
}
237-
mDistanceArea.setSourceCrs( mCrs.srsid() );
237+
mDistanceArea.setSourceCrs( mCrs );
238238

239239
// Read region fron environment variable
240240
// QGIS_GRASS_REGION=west,south,east,north,cols,rows

0 commit comments

Comments
 (0)
Please sign in to comment.