diff --git a/geoutils/pointcloud/pointcloud.py b/geoutils/pointcloud/pointcloud.py index ea5451ea..1c69929f 100644 --- a/geoutils/pointcloud/pointcloud.py +++ b/geoutils/pointcloud/pointcloud.py @@ -17,7 +17,8 @@ import geoutils as gu from geoutils._typing import ArrayLike, NDArrayNum, Number from geoutils.interface.gridding import _grid_pointcloud -from geoutils.raster.sampling import subsample_array + +# from geoutils.raster.sampling import subsample_array try: import laspy @@ -113,7 +114,7 @@ def __init__( self._crs: CRS | None = None self._bounds: BoundingBox self._data_column: str - self._data: np.ndarray + self._data: NDArrayNum self._nb_points: int self._all_columns: pd.Index @@ -377,13 +378,13 @@ def grid( return gu.Raster.from_array(data=array, transform=transform, crs=self.crs, nodata=None) - def subsample(self, subsample: float | int, random_state: int | np.random.Generator | None = None) -> PointCloud: - - indices = subsample_array( - array=self.ds[self.data_column].values, subsample=subsample, return_indices=True, random_state=random_state - ) - - return PointCloud(self.ds[indices]) + # def subsample(self, subsample: float | int, random_state: int | np.random.Generator | None = None) -> PointCloud: + # + # indices = subsample_array( + # array=self.data, subsample=subsample, return_indices=True, random_state=random_state + # ) + # + # return PointCloud(self.ds[indices]) # @classmethod # def from_raster(cls, raster: gu.Raster) -> PointCloud: diff --git a/geoutils/raster/raster.py b/geoutils/raster/raster.py index 3d75f9f6..8db1d716 100644 --- a/geoutils/raster/raster.py +++ b/geoutils/raster/raster.py @@ -3391,16 +3391,17 @@ def to_pointcloud( """ return _raster_to_pointcloud( - source_raster=self, - data_column_name=data_column_name, - data_band=data_band, - auxiliary_data_bands=auxiliary_data_bands, - auxiliary_column_names=auxiliary_column_names, - subsample=subsample, - skip_nodata=skip_nodata, - as_array=as_array, - random_state=random_state, - force_pixel_offset=force_pixel_offset) + source_raster=self, + data_column_name=data_column_name, + data_band=data_band, + auxiliary_data_bands=auxiliary_data_bands, + auxiliary_column_names=auxiliary_column_names, + subsample=subsample, + skip_nodata=skip_nodata, + as_array=as_array, + random_state=random_state, + force_pixel_offset=force_pixel_offset, + ) @classmethod def from_pointcloud_regular(