Remote-sensing opensource python library reading optical and SAR sensors, loading and stacking bands, clouds, DEM and spectral indices in a sensor-agnostic way.
We could easily allow custom stacks with a geographic projection
Here is the code to create a VRT from the given input path:
# If we have an EPSG:4326 custom stack, reproject it
with rasterio.open(input_path) as ds:
if ds.crs.is_geographic:
utm_crs = gpd.GeoDataFrame(geometry=[geometry.from_bounds_to_polygon(*ds.bounds)], crs=ds.crs).estimate_utm_crs()
with rasterio.vrt.WarpedVRT(ds, **{"crs": utm_crs.to_epsg()}) as vrt:
utm_name = path.get_filename(input_path) + f"_{utm_crs.to_epsg()}.vrt"
utm_path = str(output_folder / utm_name)
rasterio.shutil.copy(vrt, utm_path, driver="vrt")
input_path = utm_path
# Open the custom stack
prod = reader.open(
input_path,
custom=True,
sensor_type="OPTICAL",
band_map=custom_band_map,
pixel_size=pixel_size,
remove_tmp=True
)
We could easily allow custom stacks with a geographic projection
Here is the code to create a VRT from the given input path: