Allow processing tests to specify ellipsoid/project CRS

This commit is contained in:
Nyall Dawson 2018-06-28 18:56:53 +10:00
parent 1223a1cd35
commit 9fe26af8fa

View File

@ -43,6 +43,7 @@ from copy import deepcopy
from qgis.core import (QgsVectorLayer,
QgsRasterLayer,
QgsCoordinateReferenceSystem,
QgsFeatureRequest,
QgsMapLayer,
QgsProject,
@ -86,6 +87,16 @@ class AlgorithmsTest(object):
self.vector_layer_params = {}
QgsProject.instance().removeAllMapLayers()
if 'project_crs' in defs:
QgsProject.instance().setCrs(QgsCoordinateReferenceSystem(defs['project_crs']))
else:
QgsProject.instance().setCrs(QgsCoordinateReferenceSystem())
if 'ellipsoid' in defs:
QgsProject.instance().setEllipsoid(defs['ellipsoid'])
else:
QgsProject.instance().setEllipsoid('')
params = self.load_params(defs['params'])
print('Running alg: "{}"'.format(defs['algorithm']))