1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #26432 -- Fixed size tuple order when using numpy reshape on a GDALBand.

This commit is contained in:
Opa-
2016-03-31 10:43:14 +02:00
committed by Tim Graham
parent 93deb1691e
commit 461f74ab19
3 changed files with 183 additions and 1 deletions

View File

@@ -222,8 +222,10 @@ class GDALBand(GDALBase):
if as_memoryview:
return memoryview(data_array)
elif numpy:
# reshape() needs a reshape parameter with the height first.
return numpy.frombuffer(
data_array, dtype=numpy.dtype(data_array)).reshape(size)
data_array, dtype=numpy.dtype(data_array)
).reshape(tuple(reversed(size)))
else:
return list(data_array)
else: