Skip to content

Commit

Permalink
Convert shapely proxy object to geometries
Browse files Browse the repository at this point in the history
  • Loading branch information
mdpiper committed Oct 8, 2024
1 parent 4209cb2 commit 93519d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pymt/grids/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"""

from shapely.geometry import Point, asLineString, asPoint, asPolygon
from shapely.geometry import Point, LineString, Polygon

from pymt.grids import (
Rectilinear,
Expand Down Expand Up @@ -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):
"""
Expand Down

0 comments on commit 93519d5

Please sign in to comment.