Skip to content

Commit 21da03e

Browse files
committed
[processing] fix out of bounds error in extract values scripts
1 parent 0e48b3a commit 21da03e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

python/plugins/processing/script/scripts/Extract_raster_values_to_CSV.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
x = pnt[0]
8787
y = pnt[1]
8888
(rX, rY) = raster.mapToPixel(x, y, geoTransform)
89-
if rX > rasterXSize or rY > rasterYSize:
89+
if rX >= rasterXSize or rY >= rasterYSize:
9090
feature = layer.GetNextFeature()
9191
continue
9292
value = data[rY, rX]

python/plugins/processing/script/scripts/Extract_raster_values_to_shapefile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
x = pnt[0]
115115
y = pnt[1]
116116
(rX, rY) = mapToPixel(x, y, geoTransform)
117-
if rX > rasterXSize or rY > rasterYSize:
117+
if rX >= rasterXSize or rY >= rasterYSize:
118118
feature = layer.GetNextFeature()
119119
continue
120120
value = data[rY, rX]

0 commit comments

Comments
 (0)