[processing] fix out of bounds error in extract values scripts

This commit is contained in:
Alexander Bruy 2014-05-21 12:00:23 +03:00
parent 0e48b3a720
commit 21da03e904
2 changed files with 2 additions and 2 deletions

View File

@ -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]

View File

@ -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]