I have a NetCDF with geographical information. I'd like to obtain a GeoTIFF file with rasterio
. The problem is how to translate the geographical information from CF standard to something that GeoTIFF can understand.
In the netCDF I have this variable:
int projection_lambert ;
projection_lambert:grid_mapping_name = "lambert_conformal_conic" ;
projection_lambert:latitude_of_projection_origin = 63. ;
projection_lambert:longitude_of_central_meridian = 15. ;
projection_lambert:standard_parallel = 63., 63. ;
projection_lambert:proj4 = "+proj=lcc +lat_0=63 +lon_0=15 +lat_1=63 +lat_2=63 +no_defs +R=6.371e+06" ;
Therefore I can create the CRS with:
crs = CRS.from_proj4("+proj=lcc +lat_0=63 +lon_0=15 +lat_1=63 +lat_2=63 +no_defs +R=6.371e+06")
OK, I know the projection, but what is missing is the Affine transformation. This information is implicitly stored in the lat
and lon
variables the NetCDF also includes, but I'm not sure how to go from there, to the Affine transformation.