Skip to content

Commit

Permalink
[processing] Added extent parameter to RasterLayerBoundsAlgorithm.py
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed May 30, 2014
1 parent b30ac31 commit f4e95c4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions python/plugins/processing/modeler/RasterLayerBoundsAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from processing.parameters.ParameterRaster import ParameterRaster
from processing.outputs.OutputNumber import OutputNumber
from processing.tools import dataobjects

from processing.outputs.OutputExtent import OutputExtent

class RasterLayerBoundsAlgorithm(GeoAlgorithm):

Expand All @@ -49,11 +49,17 @@ def defineCharacteristics(self):
self.addOutput(OutputNumber(self.XMAX, 'max X'))
self.addOutput(OutputNumber(self.YMIN, 'min Y'))
self.addOutput(OutputNumber(self.YMAX, 'max Y'))

self.addOutput(OutputExtent(self.EXTENT, 'Extent'))

def processAlgorithm(self, progress):
uri = self.getParameterValue(self.LAYER)
layer = dataobjects.getObjectFromUri(uri)
self.setOutputValue(self.XMIN, layer.extent().xMinimum())
self.setOutputValue(self.XMAX, layer.extent().xMaximum())
self.setOutputValue(self.YMIN, layer.extent().yMinimum())
self.setOutputValue(self.YMAX, layer.extent().yMaximum())
self.setOutputValue(self.EXTENT, (layer.extent().xMinimum(),
layer.extent().xMaximum(),
layer.extent().yMinimum(),
layer.extent().yMaximum()))

0 comments on commit f4e95c4

Please sign in to comment.