GIS methods#
Raster methods#
High level methods#
|
Return a full DataArray based on a geospatial coords dictionary. |
|
Return a full object with the same grid and geospatial attributes as |
|
Return a full DataArray based on a geospatial transform and shape. |
|
Merge multiple tiles to a single DataArray. |
|
Transform a 2D/3D numpy array into a DataArray with geospatial attributes. |
|
Transform multiple numpy arrays to a Dataset object. |
Attributes#
Return dictionary of spatial attributes. |
|
Return horizontal Coordinate Reference System. |
|
Return the bounds (xmin, ymin, xmax, ymax) of the object. |
|
Return the affine transform of the object. |
|
Return resolution (x, y) tuple. |
|
Return rotation of grid (degrees). |
|
Return origin of grid (x0, y0) tuple. |
|
Nodata value of the DataArray. |
|
Return tuple of geospatial dimensions names. |
|
Return dict of geospatial dimensions coordinates. |
|
Return the non geospatial dimension name. |
|
Return the y dimension name. |
|
Return the x dimension name. |
|
Return the x coordinates. |
|
Return the y coordinates. |
|
Return shape of geospatial dimension (height, width). |
|
Return size of geospatial grid. |
|
Return the width of the object (x dimension size). |
|
Return the height of the object (y dimension size). |
|
Return the internal bounds (left, bottom, right, top) the object. |
|
Return |
General methods#
|
Set the Coordinate Reference System. |
|
Set the geospatial dimensions of the object. |
Reset spatial dimension names and attributes. |
|
Return True if other has an same grid as object (crs, transform, shape). |
|
Check if other grid aligns with object grid (crs, resolution, origin). |
|
Update attributes to get GDAL compliant NetCDF files. |
|
|
Return x,y coordinates at linear index. |
|
Return linear index of x, y coordinates. |
|
Return row, col indices of x, y coordinates. |
|
Return x,y coordinates at cell center of row, col indices. |
Return raster flipped along y dimension. |
|
|
Return the grid cell area [m2]. |
Return the density in [unit/m2] of raster(s). |
|
|
Reclass columns in df from raster map (DataArray). |
Nodata handling and interpolation#
|
Set the nodata value as CF compliant attribute of the DataArray. |
|
Mask nodata values with fill_value (default np.nan). |
|
Interpolate missing data. |
Clip#
|
Clip object based on slices. |
|
Clip object based on a bounding box. |
|
Clip object to region with mask values greater than zero. |
|
Clip object to bounding box of the geometry. |
Reproject#
|
Reproject a DataArray with geospatial coordinates. |
|
Return reprojected DataArray object based on simple reindexing. |
|
Reproject a object to match the grid of |
|
Transform bounds from object to destination CRS. |
|
Prepare nearest index mapping for reprojection of a gridded timeseries file. |
Transform#
|
Return an object with input geometry values burned in. |
|
Return an object with the fraction of the grid cells covered by geometry. |
|
Return a grid with True values where shapes overlap pixels. |
|
Return geometry of grouped pixels with the same value in a DataArray object. |
|
Return a vector representation of the grid. |
Sampling and zonal stats#
|
Sample from map at point locations with optional window around the points. |
|
Calculate zonal statistics of raster samples aggregated for geometries. |
Writing methods#
|
Export rasterdataset to tiles in a xyz structure. |
|
Produce tiles in /zoom/x/y.<ext> structure (EPSG:3857). |
|
Write DataArray object to a gdal-writable raster file. |
|
Write the Dataset object to one gdal-writable raster files per variable. |
GeoDataset methods#
High level methods#
|
Parse GeoDataFrame object with point geometries to DataArray. |
|
Return geopandas GeoDataFrame with Point geometry. |
|
Read netcdf file or convert xr.DataArray as GeoDataArray. |
|
Export geodataset vectordata to an ogr compliant netCDF4 file. |
|
Create Dataset with geospatial coordinates. |
|
Return geopandas GeoDataFrame with Point geometry. |
|
Create GeoDataset from ogr compliant netCDF4 file or xr.Dataset. |
|
Export geodataset vectordata to an ogr compliant netCDF4 file. |
Attributes#
Return dictionary of spatial attributes. |
|
Return horizontal Coordinate Reference System. |
|
Index dimension name. |
|
Time dimension name. |
|
Name of x coordinate; only for point geometries in xy format. |
|
Name of y coordinate; only for point geometries in xy format. |
|
Name of geometry coordinate; only for 'wkt' and 'geom' formats. |
|
Return geometry type. |
|
Name of geometry coordinate; only for 'wkt' and 'geom' formats. |
|
Return the index values. |
|
Return the bounds (xmin, ymin, xmax, ymax) of the object. |
|
Return the length of the index array. |
|
Return the spatial index of the geometry. |
|
Return the geometry of the dataset or array as GeoSeries. |
|
Return dictionary of spatial attributes. |
|
Return horizontal Coordinate Reference System. |
|
Index dimension name. |
|
Time dimension name. |
|
Name of x coordinate; only for point geometries in xy format. |
|
Name of y coordinate; only for point geometries in xy format. |
|
Name of geometry coordinate; only for 'wkt' and 'geom' formats. |
|
Return geometry type. |
|
Name of geometry coordinate; only for 'wkt' and 'geom' formats. |
|
Return the index values. |
|
Return the bounds (xmin, ymin, xmax, ymax) of the object. |
|
Return the length of the index array. |
|
Return the spatial index of the geometry. |
|
Return the geometry of the dataset or array as GeoSeries. |
Conversion#
|
Create a Dataset/Array which is understood by OGR. |
|
Update the geometry in the Dataset/Array with a new geometry. |
|
Convert Dataset/ DataArray with xy or wkt geometries to shapely Geometries. |
|
Convert Dataset/ DataArray with Point geometries to x,y structure. |
|
Convert geometries in Dataset/DataArray to wkt strings. |
|
Create a Dataset/Array which is understood by OGR. |
|
Update the geometry in the Dataset/Array with a new geometry. |
|
Convert Dataset/ DataArray with xy or wkt geometries to shapely Geometries. |
|
Convert Dataset/ DataArray with Point geometries to x,y structure. |
|
Convert geometries in Dataset/DataArray to wkt strings. |
General methods#
|
Set the Coordinate Reference System. |
Set the spatial and index dimensions of the object. |
|
|
Set the Coordinate Reference System. |
|
Set the spatial and index dimensions of the object. |
Clip#
|
Select point locations to bounding box. |
|
Select all geometries that intersect with the input geometry. |
|
Select point locations to bounding box. |
|
Select all geometries that intersect with the input geometry. |
Reproject#
|
Transform spatial coordinates to a new coordinate reference system. |
|
Transform spatial coordinates to a new coordinate reference system. |
Flow direction methods#
These methods are based on the pyflwdir library. For more flow direction based methods visit the pyflwdir docs.
|
Parse dataarray to flow direction raster object. |
|
Derive D8 flow directions grid from an elevation grid. |
|
Reproject flow direction and upstream area data to the da_elv crs and grid. |
|
Upscale flow direction network to lower resolution. |
|
Return a stream mask DataArray. |
|
Return a (sub)basin map, with unique non-zero IDs for each subbasin. |
|
Return map with unique gauge IDs. |
|
Return a mask of basin outlets/pits from a flow direction raster. |
|
Clip a dataset to a subbasin. |
|
Return hydrologically conditioned elevation. |