geoutils.PointCloud.grid

geoutils.PointCloud.grid#

PointCloud.grid(ref=None, grid_coords=None, res=None, shape=None, bounds=None, resampling='linear', dist_nodata_pixel=1.0, nodata=-9999, *, data_column=None, distance_power=2.0, min_points=1, engine='scipy', chunksizes=None, mp_config=None, n_threads=0, nodata_propagation='gdal')#

Grid the point cloud into a raster.

Define the output grid with a reference raster, regular X/Y coordinates, or a combination of resolution or shape and optional bounds.

Parameters:
  • ref (RasterLike | None) – Reference raster whose grid should be matched. A Dask reference also selects lazy output.

  • grid_coords (tuple[NDArrayNum, NDArrayNum] | None) – Regular X and Y coordinates defining the output grid.

  • res (float | tuple[float, float] | None) – Output resolution in X and Y, mutually exclusive with shape.

  • shape (tuple[int, int] | None) – Output shape as (height, width), mutually exclusive with res.

  • bounds (tuple[float, float, float, float] | None) – Output bounds as (left, bottom, right, top). Defaults to the point-cloud bounds.

  • resampling (GriddingMethod) – Interpolation, circular statistic or distance method. average, min and max are aliases for mean, minimum and maximum.

  • dist_nodata_pixel (float) – Maximum point distance or circular neighborhood radius in output pixels.

  • nodata (int | float) – Nodata value of the output raster.

  • data_column (str | None) – Point value column to grid. None uses the active point values.

  • distance_power (float) – Distance exponent used for inverse-distance weighting.

  • min_points (int) – Minimum number of finite points required inside a circular neighborhood.

  • engine (GriddingEngine) – Calculation engine, either scipy or numba.

  • chunksizes (tuple[int, int] | None) – Output chunk size as (rows, columns) for Dask or multiprocessing execution.

  • mp_config (MultiprocConfig | None) – Multiprocessing configuration for computing output chunks in workers.

  • n_threads (int) – Number of SciPy threads for eager nearest gridding. 0 uses all but one available CPU.

  • nodata_propagation (NodataPropagation) – Whether invalid point values follow GDAL behavior, are ignored, or propagate.

Return type:

Any

Returns:

A gridded raster matching the concrete PointCloud or dataframe accessor interface.