mirror of
https://github.com/django/django.git
synced 2025-10-29 00:26:07 +00:00
Fixed #25773 -- Deprecated the geos.MultiPolygon.cascaded_union property.
This commit is contained in:
committed by
Tim Graham
parent
0cfe589f95
commit
f920be7c32
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user