xrspatial.edge_detection.laplacian#

xrspatial.edge_detection.laplacian(agg, name='laplacian', boundary='nan')[source]#

Compute edges using the Laplacian (second-derivative) operator.

Omnidirectional edge detector using the kernel:

[[ 0,  1, 0],
 [ 1, -4, 1],
 [ 0,  1, 0]]
Parameters:
  • agg (xarray.DataArray) – 2D raster. Supports NumPy, CuPy, Dask+NumPy, and Dask+CuPy backends.

  • name (str, default='laplacian') – Name for the output DataArray.

  • boundary (str, default='nan') – How to handle edges: ‘nan’, ‘nearest’, ‘reflect’, or ‘wrap’.

Returns:

Laplacian response with the same shape and backend as the input.

Return type:

xarray.DataArray