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
078eb876
Kaydet (Commit)
078eb876
authored
May 16, 2016
tarafından
Daniel Wiesmann
Kaydeden (comit)
Claude Paroz
May 16, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #26592 -- Fixed band statistics for empty bands and GDAL 2.1
üst
aa69f369
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
raster.py
django/contrib/gis/gdal/prototypes/raster.py
+0
-2
band.py
django/contrib/gis/gdal/raster/band.py
+7
-7
No files found.
django/contrib/gis/gdal/prototypes/raster.py
Dosyayı görüntüle @
078eb876
...
...
@@ -74,12 +74,10 @@ get_band_statistics = void_output(
c_void_p
,
c_int
,
c_int
,
POINTER
(
c_double
),
POINTER
(
c_double
),
POINTER
(
c_double
),
POINTER
(
c_double
),
c_void_p
,
c_void_p
,
],
errcheck
=
False
)
compute_band_statistics
=
void_output
(
std_call
(
'GDALComputeRasterStatistics'
),
[
c_void_p
,
c_int
,
POINTER
(
c_double
),
POINTER
(
c_double
),
POINTER
(
c_double
),
POINTER
(
c_double
),
c_void_p
,
c_void_p
],
errcheck
=
False
)
# Reprojection routine
...
...
django/contrib/gis/gdal/raster/band.py
Dosyayı görüntüle @
078eb876
import
math
from
ctypes
import
byref
,
c_double
,
c_int
,
c_void_p
from
django.contrib.gis.gdal.base
import
GDALBase
...
...
@@ -85,18 +84,19 @@ class GDALBand(GDALBase):
]
if
refresh
or
self
.
_stats_refresh
:
capi
.
compute_band_statistics
(
*
stats_args
)
func
=
capi
.
compute_band_statistics
else
:
# Add additional argument to force computation if there is no
# existing PAM file to take the values from.
force
=
True
stats_args
.
insert
(
2
,
c_int
(
force
))
capi
.
get_band_statistics
(
*
stats_args
)
func
=
capi
.
get_band_statistics
result
=
smin
.
value
,
smax
.
value
,
smean
.
value
,
sstd
.
value
# Check if band is empty (in that case, set all statistics to None)
if
any
((
math
.
isnan
(
val
)
for
val
in
result
)):
# Computation of statistics fails for empty bands.
try
:
func
(
*
stats_args
)
result
=
smin
.
value
,
smax
.
value
,
smean
.
value
,
sstd
.
value
except
GDALException
:
result
=
(
None
,
None
,
None
,
None
)
self
.
_stats_refresh
=
False
...
...
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