Skip to content

Commit

Permalink
fix: avoid double imports
Browse files Browse the repository at this point in the history
  • Loading branch information
AngRodrigues committed May 29, 2024
1 parent 0fe1c75 commit 3347751
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions map2loop/thickness_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
find_segment_strike_from_pt,
)
from .m2l_enums import Datatype
from shapely.geometry import Point
import shapely
import math

Expand Down Expand Up @@ -244,7 +243,7 @@ def compute(
# get the sampled contacts
contacts = geopandas.GeoDataFrame(map_data.sampled_contacts)
# build points from x and y coordinates
geometry2 = contacts.apply(lambda row: Point(row.X, row.Y), axis=1)
geometry2 = contacts.apply(lambda row: shapely.Point(row.X, row.Y), axis=1)
contacts.set_geometry(geometry2, inplace=True)

# set the crs of the contacts to the crs of the units
Expand All @@ -253,7 +252,7 @@ def compute(
contacts = map_data.get_value_from_raster_df(Datatype.DTM, contacts)
# update the geometry of the contact points to include the Z value
contacts["geometry"] = contacts.apply(
lambda row: Point(row.geometry.x, row.geometry.y, row["Z"]), axis=1
lambda row: shapely.Point(row.geometry.x, row.geometry.y, row["Z"]), axis=1
)
# spatial join the contact points with the basal contacts to get the unit for each contact point
contacts = contacts.sjoin(basal_contacts, how="inner", predicate="intersects")
Expand All @@ -279,7 +278,7 @@ def compute(
interpolated = map_data.get_value_from_raster_df(Datatype.DTM, interpolated_orientations)
# update the geometry of the interpolated points to include the Z value
interpolated["geometry"] = interpolated.apply(
lambda row: Point(row.geometry.x, row.geometry.y, row["Z"]), axis=1
lambda row: shapely.Point(row.geometry.x, row.geometry.y, row["Z"]), axis=1
)
# for each interpolated point, assign name of unit using spatial join
units = map_data.get_map_data(Datatype.GEOLOGY)
Expand Down

0 comments on commit 3347751

Please sign in to comment.