xdem.DEM.from_array#
- classmethod DEM.from_array(data, transform, crs, nodata=None, area_or_point=None, tags=None, cast_nodata=True, vcrs=None)[source]#
Create a DEM from a numpy array and the georeferencing information.
- Parameters:
data (
ndarray[tuple[Any,...],dtype[floating[Any]]] |MaskedArray[Any,dtype[floating[Any]]]) – Input array.transform (
tuple[float,...] |Affine) – Affine 2D transform. Either a tuple(x_res, 0.0, top_left_x, 0.0, y_res, top_left_y) or an affine.Affine object.crs (
CRS|int|None) – Coordinate reference system. Either a rasterio CRS, or an EPSG integer.area_or_point (
Literal['Area','Point'] |None) – Pixel interpretation of the raster, will be stored in AREA_OR_POINT metadata.cast_nodata (
bool) – Automatically cast nodata value to the default nodata for the new array type if not compatible. If False, will raise an error when incompatible.vcrs (
Literal['Ellipsoid'] |Literal['EGM08'] |Literal['EGM96'] |str|Path|VerticalCRS|int|None) – Vertical coordinate reference system.
- Return type:
- Returns:
DEM created from the provided array and georeferencing.