Defining a grid file for a a custom projection
Added by Jon Mackay over 4 years ago
Hi,
I'm currently trying to remap some EURO-CORDEX netcdf data from it's native rotated pole projection to the British National Grid (EPSG:27700) using cdo. My understanding from the cdo user manual is that this should be possible by building a grid file with 'gridtype=projection' and then details the proj parameters. Having looked on, https://epsg.io/27700 I've found the proj parameters:
"+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs"
So I constructed a grid file with the following:
gridtype = projection
xsize = 1000
ysize = 1000
xfirst = 38000
xinc = 2000
yfirst = -10000
yinc = 2000
proj_params = "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs"
Not surprisingly, it didn't work. I got this error message:
"cdo remapnn (Abort): Invalid key word >proj_params< (grid description file: mygrid_bng)"
Does anyone know where I'm going wrong? Is this even possible?
Many thanks all
Replies (1)
RE: Defining a grid file for a a custom projection - Added by Uwe Schulzweida over 4 years ago
The keyword grid_mapping is missing. This keyword can have any text value and must be specified before the first mapping parameter:
gridtype = projection xsize = 1000 ysize = 1000 xfirst = 38000 xinc = 2000 yfirst = -10000 yinc = 2000 grid_mapping = crs proj_params = "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs"