geodata.mask#

Mask module of the geodata package. This module contains the Mask class, which is used to create, manipulate, and load geodata mask object that takes GeoTIFF and shapefiles as input. Additionally, this module also contains a set of functions that are used to interact with raw raster data and shapefiles.

Attributes#

Classes#

Mask

A class to create, manipulate, and load geodata mask object that takes GeoTIFF

Functions#

open_tif(→ rasterio.DatasetReader)

Open a layer using rasterio given a file path.

ras_to_xarr(→ xarray.DataArray)

Open a raster (rasterio openner) with rioxarray

create_temp_tif(→ rasterio.DatasetReader | str)

Create a ras.DatasetReader object openning a temporary rasterio file

save_opened_raster(raster, path)

Helper method to close the opened raster and save it to the given path.

save_raster(arr, transform, path)

Given an array and an Affine transform, save the raster as tif file to the specified path.

crop_raster(→ rasterio.DatasetReader)

Crop a raster given geographical coordinates or its array index bounds

reproject_raster(→ rasterio.DatasetReader)

Convert CRS of TIFF file from one to another. By default, we want to make the destination raster

apply_fn_to_raster(raster, fn)

Apply a custom function to individual values in the raster array.

filter_raster(→ rasterio.DatasetReader)

Filter the raster with a list of values to be True. This method can also set

trim_raster(→ rasterio.DatasetReader)

Remove the all-zero columns and rows at the border of the raster and returns the trimmed raster.

filter_area(→ rasterio.DatasetReader)

Eliminate the small area of a certain value in the raster by converting it to

convert_shape_crs(shape, src_crs, dst_crs)

Convert the CRS of a shape object given its source CRS and destinated CRS.

show(, title, title_size, lat_lon, colorbar, grid, ...)

Plot a raster file.

show_all(r_dict, **kwargs)

Show all the layers given a dictionary of name: raster pairs.

Module Contents#

geodata.mask.logger[source]#
geodata.mask.prange[source]#
geodata.mask.SHAPELY_NEW_API[source]#
geodata.mask.raster_show[source]#