From 21da03e904ee680ed6da3b762ca23afa958942a8 Mon Sep 17 00:00:00 2001 From: Alexander Bruy Date: Wed, 21 May 2014 12:00:23 +0300 Subject: [PATCH] [processing] fix out of bounds error in extract values scripts --- .../processing/script/scripts/Extract_raster_values_to_CSV.py | 2 +- .../script/scripts/Extract_raster_values_to_shapefile.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/plugins/processing/script/scripts/Extract_raster_values_to_CSV.py b/python/plugins/processing/script/scripts/Extract_raster_values_to_CSV.py index b1893530e89..84b9ee7d2cc 100644 --- a/python/plugins/processing/script/scripts/Extract_raster_values_to_CSV.py +++ b/python/plugins/processing/script/scripts/Extract_raster_values_to_CSV.py @@ -86,7 +86,7 @@ for i in xrange(bandCount): x = pnt[0] y = pnt[1] (rX, rY) = raster.mapToPixel(x, y, geoTransform) - if rX > rasterXSize or rY > rasterYSize: + if rX >= rasterXSize or rY >= rasterYSize: feature = layer.GetNextFeature() continue value = data[rY, rX] diff --git a/python/plugins/processing/script/scripts/Extract_raster_values_to_shapefile.py b/python/plugins/processing/script/scripts/Extract_raster_values_to_shapefile.py index 8016bdf0a38..c5e5258a8ed 100644 --- a/python/plugins/processing/script/scripts/Extract_raster_values_to_shapefile.py +++ b/python/plugins/processing/script/scripts/Extract_raster_values_to_shapefile.py @@ -114,7 +114,7 @@ for i in xrange(bandCount): x = pnt[0] y = pnt[1] (rX, rY) = mapToPixel(x, y, geoTransform) - if rX > rasterXSize or rY > rasterYSize: + if rX >= rasterXSize or rY >= rasterYSize: feature = layer.GetNextFeature() continue value = data[rY, rX]