geodata.mask.reproject_raster

geodata.mask.reproject_raster#

geodata.mask.reproject_raster(src: rasterio.DatasetReader, src_crs: str, dst_crs: str = 'EPSG:4326', trim: bool = False, **kwargs) rasterio.DatasetReader#

Convert CRS of TIFF file from one to another. By default, we want to make the destination raster in lat/lon coordinate system. However, this can still be changed by specifying the dst_crs.

Parameters:
  • src (ras.DatasetReader) – The source raster

  • src_crs (str) – The source CRS

  • dst_crs (str) – By default, we want to make the destination raster in lat/lon coordinate system. However, this can still be changed by specifying the dst_crs.

  • trim (bool) – False by default. If True, we will trim the empty border to save space.

Returns:

The reprojected raster.

Return type:

ras.DatasetReader