2

I have to analyze some CORDEX models which have a rotated pole projection. The projection is described in this document, see page 10, Table 1, row "Europe high res".

I have tried to describe the proj4 string like so: +proj=ob_tran +o_proj=longlat +o_lon_p=-162.0 +o_lat_p=39.25 +lon_0=180 +lat_0=0, but it seems that this is not correct, at least using sf in R:

st_crs(rsf) <- "+proj=ob_tran +o_proj=longlat +o_lon_p=-162.0 +o_lat_p=39.25 +lon_0=180 +lat_0=0"
Warning message:
In CPL_crs_from_proj4string(x) :
  Cannot import crs from PROJ.4 string `+proj=ob_tran +o_proj=longlat +o_lon_p=-162.0 +o_lat_p=39.25 +lon_0=180 +lat_0=0', missing crs returned

What is the correct CRS for this projection?

0
2

With the help of Edzer and others we conjured a solution that works. See the GitHub issue here. It is a workaround and is not the most beautiful approach, but it works.

Basically using the proj.4 crs "+proj=ob_tran +o_proj=longlat +o_lon_p=-162 +o_lat_p=39.25 +lon_0=180 +to_meter=0.01745329" works, with the caveat of using R lwgeom to project instead of sf::st_transform, since GDAL currently does not understand this projection (it will in the next version).

# d is the input dataset saved in an sf object
x <- lwgeom::st_transform_proj(d, c(st_crs(4326)$proj4string, "+proj=ob_tran +o_proj=longlat +o_lon_p=-162 +o_lat_p=39.25 +lon_0=180 +to_meter=0.01745329"))
sf:st_crs(x) = NA # ?! This is mandatory for some reason
sf::st_crs(x) = 4326
sf::plot(x, axes = TRUE)

enter image description here

4
  • This proj4 string isn't accepted in QGIS. Any idea why? QGIS doesn't give much detail.. just "The proj4 definition of 'CORDEX EUR-44' is not valid." ... Maybe a better question: Which version of GDAL was "the next version", when you posted this? – naught101 Jan 22 '20 at 5:13
  • @naught101 as you can see in R I had some issues as well, I have no idea what's the issue with this proj4 string. I think the version of GDAL I talk about was going to be GDAL3.0, but I might be wrong – AF7 Jan 23 '20 at 7:35
  • OK, well I'm stuck on 2.4 for the time being. Maybe I will try and upgrade.. Any idea if there's a simple way to test the validity of a proj4 string? – naught101 Jan 25 '20 at 1:29
  • @naught101 I'm sure there are several ways; google returns for example this: rdrr.io/github/lbusett/MODIStsp/man/check_proj4string.html, but try man proj for a more direct way using the command line proj program (on Unix). – AF7 Jan 26 '20 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.