Skip to content

Commit

Permalink
merge changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rosepearson committed Nov 7, 2024
2 parents dc96f5b + 1838b97 commit 0521553
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/geofabrics/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,9 @@ def z(self):
self._z = self._points.apply(lambda row: row.geometry.z, axis=1).to_list()
return self._z


class ElevationContours(ElevationPoints):
""" Resample at spatial resolution at points """
"""Resample at spatial resolution at points"""

def __init__(
self,
Expand All @@ -772,16 +773,16 @@ def __init__(
polygon_files=polygon_files,
catchment_geometry=catchment_geometry,
filter_osm_ids=[],
z_labels=z_labels,
z_labels=z_labels,
)
self.logger = logging.getLogger(f"{__name__}.{self.__class__.__name__}")

# convert contoursto samples points at resolution
self.sample_contours(self.catchment_geometry.resolution)

def sample_contours(self, resolution: float) -> numpy.ndarray:
"""Sample the contours at the specified resolution."""

# convert contours to multipoints
self._points.loc[:, "geometry"] = self._points.geometry.apply(
lambda row: shapely.geometry.MultiPoint(
Expand All @@ -792,7 +793,6 @@ def sample_contours(self, resolution: float) -> numpy.ndarray:
)
)
self._points = self._points.explode(index_parts=True, ignore_index=True)



class TileInfo:
Expand Down

0 comments on commit 0521553

Please sign in to comment.