- cascaded_union() method will be deprecated in Shapely 1.8 in favor of unary_union; replaced the usage of cascaded_union with unary_union in all the app

This commit is contained in:
Marius Stanciu
2020-10-21 13:55:41 +03:00
committed by Marius
parent 265028de76
commit 66a3e36701
26 changed files with 116 additions and 115 deletions

View File

@@ -3,7 +3,7 @@ from tclCommands.TclCommand import TclCommandSignaled
import logging
import collections
from copy import deepcopy
from shapely.ops import cascaded_union
from shapely.ops import unary_union
from shapely.geometry import Polygon, LineString, LinearRing
import gettext
@@ -131,14 +131,14 @@ class TclCommandGeoCutout(TclCommandSignaled):
flat_geometry = flatten(geo, pathonly=True)
polygon = Polygon(pts)
toolgeo = cascaded_union(polygon)
toolgeo = unary_union(polygon)
diffs = []
for target in flat_geometry:
if type(target) == LineString or type(target) == LinearRing:
diffs.append(target.difference(toolgeo))
else:
log.warning("Not implemented.")
return cascaded_union(diffs)
return unary_union(diffs)
if 'name' in args:
name = args['name']