Skip to content

Commit

Permalink
[processing] correctly handle tiny polygons smaller than raster cell
Browse files Browse the repository at this point in the history
size in Hypsometric curves algorithm (fix #12278)
  • Loading branch information
alexbruy committed Feb 26, 2015
1 parent 3a187be commit a41094d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/plugins/processing/algs/qgis/HypsometricCurves.py
Expand Up @@ -132,6 +132,12 @@ def processAlgorithm(self, progress):
srcOffset = (startColumn, startRow, width, height)
srcArray = rasterBand.ReadAsArray(*srcOffset)

if srcOffset[2] == 0 or srcOffset[3] == 0:
progress.setInfo(
self.tr('Feature %d does is smaller than raster '
'cell size' % f.id()))
continue

newGeoTransform = (
geoTransform[0] + srcOffset[0] * geoTransform[1],
geoTransform[1],
Expand Down

0 comments on commit a41094d

Please sign in to comment.