Raster Objects#
Constructing Rasters#
|
Abstraction of georeferenced raster data with lazy function evaluation. |
Properties#
The dtype of the data. |
|
The shape of the underlying raster. |
|
The number of bands. |
|
The raster's null value used to fill missing or invalid entries. |
|
The raw internal raster as a numpy array. |
|
The underlying dask array of data |
|
The underlying |
|
The null value mask as a dask array. |
|
The null value mask as an xarray DataArray. |
|
The x (horizontal) coordinate values. |
|
The y (vertical) coordinate values. |
|
The raster's CRS. |
|
The affine transformation for the raster data. |
|
The x and y cell sizes as a tuple. |
|
Bounds tuple (minx, miny, maxx, maxy) |
|
Returns an adapter for band-wise operations on this raster |
Deprecated Properties#
Operations#
Arithmetic and Comparison Operations#
Raster objects support all arithmetic (+
, -
, *
,
/
, //
, %
, divmod()
, **
, <<
, >>
, &
, ^
,
|
, ~
), bitwise/logical operators (&
, |
, ^
, ~
), and
comparison operations (==
, <
, >
, <=
, >=
, !=
). Because
of this, they can be used like regular scalar variables. Some examples:
Addition and subtraction:
rs4 = rs1 + rs2 - rs3
Floor division:
rs3 = rs1 // rs2
With scalars:
rs3 = 1.5 * (rs1 ** (-rs2 - 2))
divmod:
rs_div, rs_mod = divmod(rs1, rs2)
Bit shifting:
rs2 = rs1 << 1
Bitwise and:
rs3 = rs1 & rs2
Bitwise complement:
rs2 = ~rs1
Comparison:
rs_bool = rs1 >= rs2
General#
|
Evenly round to the given number of decimals |
Reductions#
|
Reduce the raster to a single dask value by applying all across all bands. |
|
Reduce the raster to a single dask value by applying any across all bands. |
|
Reduce the raster to a single dask value by applying max across all bands. |
|
Reduce the raster to a single dask value by applying mean across all bands. |
|
Reduce the raster to a single dask value by applying min across all bands. |
|
Reduce the raster to a single dask value by applying prod across all bands. |
|
Reduce the raster to a single dask value by applying std across all bands. |
|
Reduce the raster to a single dask value by applying sum across all bands. |
|
Reduce the raster to a single dask value by applying var across all bands. |
Methods#
Reorganizing#
|
Rechunk the underlying raster |
Extracting#
|
Retrieve the specified bands as a new Raster. |
Return the underlying data chunks as an array of Rasters. |
|
Split the raster into quadrants |
Null Data and Remapping#
Fill null-masked cells with null value. |
|
|
Reclassify raster values based on a mapping. |
|
Replaces null values with value. |
|
Remaps values based on a mapping or list of mappings. |
|
Sets or replaces the null value for the raster. |
|
Update the raster's null pixels using the provided mask |
Returns a boolean Raster with True at null values and False otherwise. |
|
|
Filter elements from this raster according to condition. |
Contents / Conversion#
|
Return a copy of the Raster cast to the specified type. |
Returns a copy of this Raster. |
|
Returns the underlying xarray.Dataset. |
|
Return the raw internal raster as a numpy array. |
|
|
Convert the raster to a vector. |
Georeferencing#
|
Return the (row, col) index of the pixel at (x, y). |
|
Set the CRS for the underlying data. |
|
Return the (x, y) coordinates of the pixel at (row, col). |
Warping#
|
Reproject to a new projection or resolution. |
Raster IO#
Close the underlying source |
|
Compute any applied operations and return the result as new Raster. |
|
Compute delayed operations and load the result into memory. |
|
|
Compute the final raster and save it to the provided location. |
Plotting#
|
Plot the raster band on an interactive |
|
Plot the raster. |
Miscellaneous#
|
Return GeoDataFrame with the chunk bounding boxes. |
Get lazy coordinate arrays, in x-y order, chunked to match data. |
|
|
Generate a new raster using the provided model to predict new values. |