From 93519d56cd3282791db9f5e60e2dcd897ba1bd7c Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Tue, 8 Oct 2024 13:13:00 -0600 Subject: [PATCH] Convert shapely proxy object to geometries See https://shapely.readthedocs.io/en/stable/migration.html#other-deprecated-functionality --- pymt/grids/map.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pymt/grids/map.py b/pymt/grids/map.py index ad4d463..61afb1f 100644 --- a/pymt/grids/map.py +++ b/pymt/grids/map.py @@ -46,7 +46,7 @@ """ -from shapely.geometry import Point, asLineString, asPoint, asPolygon +from shapely.geometry import Point, LineString, Polygon from pymt.grids import ( Rectilinear, @@ -84,11 +84,11 @@ def __init__(self, *args, **kwargs): (x, y) = (point_x.take(cell), point_y.take(cell)) if len(x) > 2: - self._polys.append(asPolygon(zip(x, y))) + self._polys.append(Polygon(zip(x, y))) elif len(x) == 2: - self._polys.append(asLineString(zip(x, y))) + self._polys.append(LineString(zip(x, y))) else: - self._polys.append(asPoint(zip(x, y))) + self._polys.append(Point(zip(x, y))) def get_shared_cells(self, point_id): """