Skip to content

Commit

Permalink
[processing] fix Field calculator algorthm (fix #11488)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Nov 22, 2014
1 parent f273edb commit 6637796
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions python/plugins/processing/algs/qgis/FieldsCalculator.py
Expand Up @@ -87,7 +87,8 @@ def processAlgorithm(self, progress):

if output.value == '':
ext = output.getDefaultFileExtension(self)
output.value = system.getTempFilenameInTempFolder(output.name + '.' + ext)
output.value = system.getTempFilenameInTempFolder(
output.name + '.' + ext)

provider = layer.dataProvider()
fields = layer.pendingFields()
Expand All @@ -101,11 +102,11 @@ def processAlgorithm(self, progress):

da = QgsDistanceArea()
da.setSourceCrs(layer.crs().srsid())
#canvas = iface.mapCanvas()
#da.setEllipsoidalMode(iface.mapCanvas().mapRenderer().hasCrsTransformEnabled())
da.setEllipsoid(QgsProject.instance().readEntry('Measure',
'/Ellipsoid',
GEO_NONE)[0])
canvas = iface.mapCanvas()
da.setEllipsoidalMode(
iface.mapCanvas().mapSettings().hasCrsTransformEnabled())
da.setEllipsoid(QgsProject.instance().readEntry(
'Measure', '/Ellipsoid', GEO_NONE)[0])
exp.setGeomCalculator(da)

if not exp.prepare(layer.pendingFields()):
Expand Down

0 comments on commit 6637796

Please sign in to comment.