-
Notifications
You must be signed in to change notification settings - Fork 0
Description
As I noted in mkslopes/create_pfl_slopes, HSURFBurnedAndMod.nc does not have geotransform, gcps, or rpcs information included. This was not preserved in burnShape2Topo.py. Now I thought that this would be then included by
gdal_translate -a_srs ./WKT-Sphere.txt HSURF.nc HSURF-Sphere.tiff
gdal_translate -a_srs ./WKT-Sphere.txt HSURFBurnedAndMod.nc HSURFBurnedAndMod-Sphere.tiff
but it is not:
>>> dem = grid.read_raster('/p/scratch/cdetect/vanhulten1/testing/ParFlow_static-file-gen.25C09/mkslopes/HSURF-Sphere.tiff', crs="sphere")
>>> dem = grid.read_raster('/p/scratch/cdetect/vanhulten1/testing/ParFlow_static-file-gen.25C09/mkslopes/HSURFBurnedAndMod-Sphere.tiff', crs="sphere")
/p/home/jusers/vanhulten1/jureca/.local/lib/python3.12/site-packages/rasterio/__init__.py:356: NotGeoreferencedWarning: Dataset has no geotransform, gcps, or rpcs. The identity matrix will be returned.
dataset = DatasetReader(path, driver=driver, sharing=sharing, **kwargs)Is the argument to gdal_translate -a_srs exactly the information that is needed?
The man page states:
No reprojection is done.
and I also do not want this. I do want relevant metadata (missing from the netCDF file) to be included in the GeoTIFF file, but this does not appear to work.
Inspection with gdalinfo(1) shows that Coordinate Systems are defined in both GeoTIFF files, but there is much more Metadata in the non-burnt GeoTIFF file.
Of course, instead of including the needed geotransform metadata into the GeoTIFF output, we could first try to address the discarded/missing metadata in the intermediate netCDF output.