Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
461f74ab
Kaydet (Commit)
461f74ab
authored
Mar 31, 2016
tarafından
Opa-
Kaydeden (comit)
Tim Graham
Nis 12, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #26432 -- Fixed size tuple order when using numpy reshape on a GDALBand.
üst
93deb169
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
band.py
django/contrib/gis/gdal/raster/band.py
+3
-1
raster.numpy.txt
tests/gis_tests/data/rasters/raster.numpy.txt
+0
-0
test_raster.py
tests/gis_tests/gdal_tests/test_raster.py
+6
-0
No files found.
django/contrib/gis/gdal/raster/band.py
Dosyayı görüntüle @
461f74ab
...
@@ -222,8 +222,10 @@ class GDALBand(GDALBase):
...
@@ -222,8 +222,10 @@ class GDALBand(GDALBase):
if
as_memoryview
:
if
as_memoryview
:
return
memoryview
(
data_array
)
return
memoryview
(
data_array
)
elif
numpy
:
elif
numpy
:
# reshape() needs a reshape parameter with the height first.
return
numpy
.
frombuffer
(
return
numpy
.
frombuffer
(
data_array
,
dtype
=
numpy
.
dtype
(
data_array
))
.
reshape
(
size
)
data_array
,
dtype
=
numpy
.
dtype
(
data_array
)
)
.
reshape
(
tuple
(
reversed
(
size
)))
else
:
else
:
return
list
(
data_array
)
return
list
(
data_array
)
else
:
else
:
...
...
tests/gis_tests/data/rasters/raster.numpy.txt
0 → 100644
Dosyayı görüntüle @
461f74ab
This diff is collapsed.
Click to expand it.
tests/gis_tests/gdal_tests/test_raster.py
Dosyayı görüntüle @
461f74ab
...
@@ -320,6 +320,12 @@ class GDALBandTests(SimpleTestCase):
...
@@ -320,6 +320,12 @@ class GDALBandTests(SimpleTestCase):
self
.
assertEqual
(
self
.
band
.
datatype
(),
1
)
self
.
assertEqual
(
self
.
band
.
datatype
(),
1
)
self
.
assertEqual
(
self
.
band
.
datatype
(
as_string
=
True
),
'GDT_Byte'
)
self
.
assertEqual
(
self
.
band
.
datatype
(
as_string
=
True
),
'GDT_Byte'
)
self
.
assertEqual
(
self
.
band
.
nodata_value
,
15
)
self
.
assertEqual
(
self
.
band
.
nodata_value
,
15
)
data
=
self
.
band
.
data
()
assert_array
=
numpy
.
loadtxt
(
os
.
path
.
join
(
os
.
path
.
dirname
(
upath
(
__file__
)),
'../data/rasters/raster.numpy.txt'
)
)
numpy
.
testing
.
assert_equal
(
data
,
assert_array
)
self
.
assertEqual
(
data
.
shape
,
(
self
.
band
.
height
,
self
.
band
.
width
))
try
:
try
:
smin
,
smax
,
smean
,
sstd
=
self
.
band
.
statistics
(
approximate
=
True
)
smin
,
smax
,
smean
,
sstd
=
self
.
band
.
statistics
(
approximate
=
True
)
self
.
assertEqual
(
smin
,
0
)
self
.
assertEqual
(
smin
,
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment