There are some other various functions and methods deprecated in Shapely 1.8 as well:
在Shapely 1.8中还有一些其他的各种函数和方法也被废弃了。
- The adapters to create geometry-like proxy objects with coordinates stored outside Shapely geometries are deprecated and will be removed in Shapely 2.0 (e.g. created using
asShape()
). They have little to no benefit compared to the normal geometry classes, as thus you can convert to your data to a normal geometry object instead. Use theshape()
function instead to convert a GeoJSON-like dict to a Shapely geometry. - The
empty()
method on a geometry object is deprecated. - The
shapely.ops.cascaded_union
function is deprecated. Useshapely.ops.unary_union
instead, which internally already uses a cascaded union operation for better performance.
- 用Shapely几何对象以外的坐标创建类似几何对象的代理对象的适配器已被废弃,并将在Shapely 2.0中删除(例如,用asShape()创建)。与普通的几何对象相比,它们几乎没有任何好处,因此你可以将你的数据转换为普通的几何对象。使用shape()函数可以将类似GeoJSON的dict转换为Shapely几何体。
- geometry对象的empty()方法已被废弃。
- shapely.ops.cascaded_union函数已被废弃。使用shapely.ops.unary_union代替,它在内部已经使用了级联操作以获得更好的性能。