Raster Utilities

raster_utilities.clip_raster(input_raster, geodf, output_raster)

Clip a raster using a geopandas geodataframe. Wrapper for rasterio.mask.mask.

Parameters:
  • input_raster (str) – Path to input raster

  • geodf (Geopandas.DataFrame) – A geodataframe containing all the shapes you would like to clip out(must use the same crs as the input raster)

  • output_raster (str) – Write path

Return type:

None (writes clipping to the output_raster)

raster_utilities.reproject_raster(input_raster, output, crs=None, resampling_method='nearest', resolution=None)

Reprojects and north orients a raster. Wrapper for rasterio.warp.reproject

Parameters:
  • input_raster (str) – Path to input raster

  • output (str) – Write path

  • crs (str (optional)) – destination crs (can be the same as input and raster will just north orient)

  • resampling_method (str (optional)) – String pertaining to the desired resampling method. Default: nearest

  • resolution (tuple(float, float) (optional)) – Output resolution, Default: input raster resolution

Return type:

None (Writes reprojection to the outpath)