mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
[processing] fix out of bounds error in extract values scripts
This commit is contained in:
parent
0e48b3a720
commit
21da03e904
@ -86,7 +86,7 @@ for i in xrange(bandCount):
|
|||||||
x = pnt[0]
|
x = pnt[0]
|
||||||
y = pnt[1]
|
y = pnt[1]
|
||||||
(rX, rY) = raster.mapToPixel(x, y, geoTransform)
|
(rX, rY) = raster.mapToPixel(x, y, geoTransform)
|
||||||
if rX > rasterXSize or rY > rasterYSize:
|
if rX >= rasterXSize or rY >= rasterYSize:
|
||||||
feature = layer.GetNextFeature()
|
feature = layer.GetNextFeature()
|
||||||
continue
|
continue
|
||||||
value = data[rY, rX]
|
value = data[rY, rX]
|
||||||
|
@ -114,7 +114,7 @@ for i in xrange(bandCount):
|
|||||||
x = pnt[0]
|
x = pnt[0]
|
||||||
y = pnt[1]
|
y = pnt[1]
|
||||||
(rX, rY) = mapToPixel(x, y, geoTransform)
|
(rX, rY) = mapToPixel(x, y, geoTransform)
|
||||||
if rX > rasterXSize or rY > rasterYSize:
|
if rX >= rasterXSize or rY >= rasterYSize:
|
||||||
feature = layer.GetNextFeature()
|
feature = layer.GetNextFeature()
|
||||||
continue
|
continue
|
||||||
value = data[rY, rX]
|
value = data[rY, rX]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user