Skip to content

Commit

Permalink
modify move_geometry_col
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-tomasini committed Feb 10, 2025
1 parent 15211d5 commit f941f85
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/shapely_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from typing import Optional, Union
from shapely import (
Geometry, LineString, from_wkt, intersection, distance, buffer, intersects, convex_hull,
extract_unique_points)
from shapely.ops import nearest_points, split, snap, linemerge, transform
extract_unique_points, transform)
from shapely.ops import nearest_points, split, snap, linemerge
from shapely.geometry import MultiPolygon, Polygon, MultiPoint, Point, LineString, shape, MultiLineString
from shapely.prepared import prep
import numpy as np
Expand Down Expand Up @@ -415,7 +415,7 @@ def multipoint_from_multilinestring(multilinestring: MultiLineString) -> MultiPo
def move_geometry(data: dict) -> str:
return (
transform(
from_wkt(data["geometry"]),
lambda x: x + np.array([np.cos(-data["angle"]), np.sin(-data["angle"])])*data["distance"] # type: ignore
geom = from_wkt(data["geometry"]),
func=lambda x: x + np.array([np.cos(-data["angle"]), np.sin(-data["angle"])])*data["distance"], # type: ignore
).wkt
)

0 comments on commit f941f85

Please sign in to comment.