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
d013134f
Kaydet (Commit)
d013134f
authored
Ara 15, 2016
tarafından
Sergey Fedoseev
Kaydeden (comit)
Tim Graham
Ara 15, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Improved testing of num_seg kwarg of BoundingCircle GIS function.
üst
bf84d042
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
test_functions.py
tests/gis_tests/geoapp/test_functions.py
+9
-0
No files found.
tests/gis_tests/geoapp/test_functions.py
Dosyayı görüntüle @
d013134f
...
...
@@ -147,16 +147,25 @@ class GISFunctionsTests(TestCase):
@skipUnlessDBFeature
(
"has_BoundingCircle_function"
)
def
test_bounding_circle
(
self
):
def
circle_num_points
(
num_seg
):
# num_seg is the number of segments per quarter circle.
return
(
4
*
num_seg
)
+
1
# The weak precision in the assertions is because the BoundingCircle
# calculation changed on PostGIS 2.3.
qs
=
Country
.
objects
.
annotate
(
circle
=
functions
.
BoundingCircle
(
'mpoly'
))
.
order_by
(
'name'
)
self
.
assertAlmostEqual
(
qs
[
0
]
.
circle
.
area
,
169
,
0
)
self
.
assertAlmostEqual
(
qs
[
1
]
.
circle
.
area
,
136
,
0
)
# By default num_seg=48.
self
.
assertEqual
(
qs
[
0
]
.
circle
.
num_points
,
circle_num_points
(
48
))
self
.
assertEqual
(
qs
[
1
]
.
circle
.
num_points
,
circle_num_points
(
48
))
qs
=
Country
.
objects
.
annotate
(
circle
=
functions
.
BoundingCircle
(
'mpoly'
,
num_seg
=
12
))
.
order_by
(
'name'
)
self
.
assertGreater
(
qs
[
0
]
.
circle
.
area
,
168.4
,
0
)
self
.
assertLess
(
qs
[
0
]
.
circle
.
area
,
169.5
,
0
)
self
.
assertAlmostEqual
(
qs
[
1
]
.
circle
.
area
,
136
,
0
)
self
.
assertEqual
(
qs
[
0
]
.
circle
.
num_points
,
circle_num_points
(
12
))
self
.
assertEqual
(
qs
[
1
]
.
circle
.
num_points
,
circle_num_points
(
12
))
@skipUnlessDBFeature
(
"has_Centroid_function"
)
def
test_centroid
(
self
):
...
...
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