[R-sig-Geo] Strange spatial reference system netCDF
edzer@pebe@m@ @end|ng |rom un|-muen@ter@de
Fri May 3 16:58:01 CEST 2019
an attempt to do something along this line is:
f = "tas_rcp85_land-rcm_eur_12km_01_mon_198012-208011.nc"
r = read_ncdf(f, ncsub = cbind(start = c(1, 1, 1, 1), count = c(418,
406, 3, 1)), eps=1e-3)
rx = read_stars(f, proxy = TRUE) # only for the crs!
st_crs(r) = st_crs(rx)
r0 = stars:::st_transform_proj.stars(r, 4326)
plot(r0[,,,1], border = NA, axes = TRUE, reset = FALSE)
plot(ne_coastline(returnclass = "sf"), add = TRUE, col = 'orange')
Note that the output object time stamps respect the 360-day calendar
(using pkg PCICt).
You'll find some discussion, and the output image, here:
Feel free to post follow-up questions here, or to github.
On 5/2/19 6:49 PM, Maurizio Marchi wrote:
> Dear list,
> I'm working with large netCDF files from the UK Climate Projections portal (
> https://www.metoffice.gov.uk/research/collaboration/ukcp). More in detail
> I'm reading with the ncdf4 library this
> file. Once loaded O can easily handle it but it is a strange reference
> system as follow:
> grid_mapping_name: rotated_latitude_longitude
> longitude_of_prime_meridian: 0
> earth_radius: *6371229*
> grid_north_pole_latitude: 39.25
> grid_north_pole_longitude: 198
> north_pole_grid_longitude: 0
> If I load the .nc file in QGIS I see that the SR is "+proj=longlat
> +a=6371229 +b=6371229 +no_defs" where the values associated to *a* and
> *b* variables
> are the earth radius. Even if QGIS can read it, the raw file isn't
> projected properly (it seems tha QGIS is not able to handle such
> Finally, using the ncdf4+raster libraries, I can easily generate e raster
> image but then I'm not able to understand I could I re project this raster
> in WGS84 reference system.
> Any helps?
> Maurizio Marchi,
> PhD Forest Science - Ecological Mathematics
> Skype ID: maurizioxyz
> linux user 552742
> #EUFGIS national Focal point for Italy
> #Annals of Silvicultural Research Associated Editor
> [[alternative HTML version deleted]]
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
Institute for Geoinformatics
Heisenbergstrasse 2, 48151 Muenster, Germany
Phone: +49 251 8333081
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2472 bytes
Desc: not available
More information about the R-sig-Geo