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
f920be7c
Kaydet (Commit)
f920be7c
authored
Kas 25, 2015
tarafından
Sergey Fedoseev
Kaydeden (comit)
Tim Graham
Kas 25, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #25773 -- Deprecated the geos.MultiPolygon.cascaded_union property.
üst
0cfe589f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
0 deletions
+23
-0
collections.py
django/contrib/gis/geos/collections.py
+6
-0
deprecation.txt
docs/internals/deprecation.txt
+3
-0
geos.txt
docs/ref/contrib/gis/geos.txt
+4
-0
1.10.txt
docs/releases/1.10.txt
+4
-0
test_geos.py
tests/gis_tests/geos_tests/test_geos.py
+6
-0
No files found.
django/contrib/gis/geos/collections.py
Dosyayı görüntüle @
f920be7c
...
...
@@ -3,6 +3,7 @@
GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon
"""
import
json
import
warnings
from
ctypes
import
byref
,
c_int
,
c_uint
from
django.contrib.gis.geos
import
prototypes
as
capi
...
...
@@ -13,6 +14,7 @@ from django.contrib.gis.geos.libgeos import get_pointer_arr
from
django.contrib.gis.geos.linestring
import
LinearRing
,
LineString
from
django.contrib.gis.geos.point
import
Point
from
django.contrib.gis.geos.polygon
import
Polygon
from
django.utils.deprecation
import
RemovedInDjango20Warning
from
django.utils.six.moves
import
range
...
...
@@ -135,6 +137,10 @@ class MultiPolygon(GeometryCollection):
@property
def
cascaded_union
(
self
):
"Returns a cascaded union of this MultiPolygon."
warnings
.
warn
(
"`cascaded_union` is deprecated, use the `unary_union` property instead."
,
RemovedInDjango20Warning
,
2
)
return
GEOSGeometry
(
capi
.
geos_cascaded_union
(
self
.
ptr
),
self
.
srid
)
# Setting the allowed types here since GeometryCollection is defined before
...
...
docs/internals/deprecation.txt
Dosyayı görüntüle @
f920be7c
...
...
@@ -121,6 +121,9 @@ details on these changes.
* The ``get_coords()`` and ``set_coords()`` methods of
``django.contrib.gis.geos.Point`` will be removed.
* The ``cascaded_union`` property of ``django.contrib.gis.geos.MultiPolygon``
will be removed.
.. _deprecation-removed-in-1.10:
1.10
...
...
docs/ref/contrib/gis/geos.txt
Dosyayı görüntüle @
f920be7c
...
...
@@ -746,6 +746,10 @@ Geometry Collections
.. attribute:: cascaded_union
.. deprecated:: 1.10
Use the :attr:`GEOSGeometry.unary_union` property instead.
Returns a :class:`Polygon` that is the union of all of the component
polygons in this collection. The algorithm employed is significantly
more efficient (faster) than trying to union the geometries together
...
...
docs/releases/1.10.txt
Dosyayı görüntüle @
f920be7c
...
...
@@ -361,6 +361,10 @@ This prevents confusion about an assignment resulting in an implicit save.
:class:`~django.contrib.gis.geos.Point` are deprecated in favor of the
``tuple`` property.
* The ``cascaded_union`` property of
:class:`~django.contrib.gis.geos.MultiPolygon` is deprecated in favor of the
:attr:`~django.contrib.gis.geos.GEOSGeometry.unary_union` property.
Miscellaneous
~~~~~~~~~~~~~
...
...
tests/gis_tests/geos_tests/test_geos.py
Dosyayı görüntüle @
f920be7c
...
...
@@ -1203,3 +1203,9 @@ class GEOSTest(SimpleTestCase, TestDataMixin):
p
.
set_coords
((
3
,
2
,
1
))
self
.
assertEqual
(
p
.
get_coords
(),
(
3
,
2
,
1
))
@ignore_warnings
(
category
=
RemovedInDjango20Warning
)
def
test_deprecated_cascaded_union
(
self
):
for
geom
in
self
.
geometries
.
multipolygons
:
mpoly
=
GEOSGeometry
(
geom
.
wkt
)
self
.
assertEqual
(
mpoly
.
cascaded_union
,
mpoly
.
unary_union
)
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