Surface#

Danger

slope(), aspect(), curvature(), and hillshade() with method='geodesic' assume the WGS84 ellipsoid and require coordinates in degrees (geographic CRS). Passing projected coordinates (metres) to the geodesic method produces wrong results. Use method='planar' (the default) for projected data.

Note

All surface functions output float32 regardless of input dtype. Edge cells within the 3x3 kernel radius are NaN by default (boundary='nan').

Aspect#

xrspatial.aspect.aspect(agg[, name, method, ...])

Calculates the aspect value of an elevation aggregate.

Northness#

xrspatial.aspect.northness(agg[, name, ...])

Computes the north-south component of aspect.

Eastness#

xrspatial.aspect.eastness(agg[, name, ...])

Computes the east-west component of aspect.

Curvature#

xrspatial.curvature.curvature(agg[, name, ...])

Calculates, for all cells in the array, the curvature (second derivative) of each cell based on the elevation of its neighbors in a 3x3 grid.

Hillshade#

xrspatial.hillshade.hillshade(agg[, ...])

Calculates, for all cells in the array, an illumination value of each cell based on illumination from a specific azimuth and altitude.

Slope#

xrspatial.slope.slope(agg[, name, method, ...])

Returns slope of input aggregate in degrees.

Terrain Generation#

xrspatial.terrain.generate_terrain(agg[, ...])

Generate pseudo-random terrain for testing raster functions.

Sky-View Factor#

xrspatial.sky_view_factor.sky_view_factor(agg)

Compute the sky-view factor for each cell of a DEM.

Viewshed#

xrspatial.viewshed.viewshed(raster, x, y[, ...])

Calculate viewshed of a raster (the visible cells in the raster) for the given viewpoint (observer) location.

Cumulative Viewshed#

xrspatial.visibility.cumulative_viewshed(...)

Count how many observers can see each cell.

Visibility Frequency#

xrspatial.visibility.visibility_frequency(...)

Fraction of observers that can see each cell.

Line of Sight#

xrspatial.visibility.line_of_sight(raster, ...)

Compute elevation profile and visibility along a straight line.

Perlin Noise#

xrspatial.perlin.perlin(agg[, freq, seed, name])

Generate perlin noise aggregate.

Bump Mapping#

xrspatial.bump.bump([width, height, count, ...])

Generate a simple bump map to simulate the appearance of land features.

Erosion#

xrspatial.erosion.erode(agg[, iterations, ...])

Apply particle-based hydraulic erosion to a terrain DataArray.