Use of GCPS in Rasterio
Right now Rasterio has partial support of GCPS (meaning it can just list them).
I've started a PR to add support of GCPS to retrieve the geotransform and crs from it when it's not present in the file (mostly to support Sentinel-1 data COG): https://github.com/mapbox/rasterio/pull/1749
While this works, the implementation and logic might not be the one expected from users. Because it's unlikely that a file will have a georeferenced coordinates system + gcps, I'd love if we could have something at least semi-automatic/seamless for users when opening the file (e.g with an environment variable ?) to handle gcps information.
GDAL docs says "The GDAL data model does not imply a transformation mechanism that must be generated from the GCPs … this is left to the application"
- gdalinfo: list gcps, does not get transform, bounds and crs from GCPS
- gdal_translate: create a pure copy, does not get transform, bounds and crs from GCPS
- gdalwarp: get transform, bounds and crs from GCPS and copy those to the output file
- rio info: list gcps, does not get transform, bounds and crs from GCPS
- rio convert: copy the file, loose GCPS info, does not get transform, bounds and crs from GCPS
- rio warp: copy the file, loose GCPS info, does not get transform, bounds and crs from GCPS
when using `WarpedVRT`rasterio seems to be able to get the geotransform from the gcps
with rasterio.open(src_path) as src_dst:
with WarpedVRT(src_dst, src_crs=src_dst.gcps, scrs=src_dst.gcps) as vrt_dst: