[R-sig-Geo] Strange spatial reference system netCDF [stars and sf functions not working now]

Roger Bivand Roger@B|v@nd @end|ng |rom nhh@no
Tue Feb 18 22:58:08 CET 2020


On Tue, 18 Feb 2020, maurizio marchi wrote:

> Dear all,
> Thanks for your time. Unfortunately the solution the community (i.e.
> Edzer Pebesma, https://github.com/r-spatial/stars/issues/175) is not
> working anymore. Does anyone knows why the code is now broken? Here the
> output of the old R code...
>
> /f<-"tasmax_rcp85_land-rcm_eur_12km_01_mon_198012-208011.nc"//
> //library(stars)//
> //  Loading required package: abind//
> //  Loading required package: sf//
> //  Linking to GEOS 3.8.0, GDAL 3.0.2, PROJ 6.2.1//

This seems to be the "smoking gun" - when the code last ran without error, 
which versions of GDAL and PROJ were you using? See below for the 
PROJ-related error message.

> //r<-read_ncdf(f, ncsub = cbind(start = c(1, 1, 1, 1), count = c(418,
> 406, 3, 1)), eps=1e-3)//
> //  no 'var' specified, using tasmax//
> //  other available variables://
> //  rotated_latitude_longitude, ensemble_member, time, time_bnds,
> grid_latitude, grid_latitude_bnds, grid_longitude, grid_longitude_bnds,
> ensemble_member_id, month_number, year, yyyymm//
> //  Error in UseMethod("GPFN") : //
> //  no applicable method for 'GPFN' applied to an object of class
> "rotated_latitude_longitude"//
> //rx<-read_stars(f, proxy = TRUE) # only for the crs!//
> //  Warning messages://
> //  1: In CPL_read_gdal(as.character(x), as.character(options),
> as.character(driver),  ://
> //    GDAL Message 1: The dataset has several variables that could be
> identified as vector fields, but not all share the same primary
> dimension. Consequently they will be ignored.//
> //  2: In CPL_read_gdal(as.character(x), as.character(options),
> as.character(driver),  ://
> //    GDAL Message 1: dimension #1 (time) is not a Time dimension.//
> //  3: In CPL_read_gdal(as.character(x), as.character(options),
> as.character(driver),  ://
> //    GDAL Message 1: dimension #0 (ensemble_member) is not a Time
> dimension.//
> //st_crs(r)<-st_crs(rx)//
> //  Warning messages://
> //  1: In CPL_crs_from_proj4string(x) ://
> //    GDAL Error 1: PROJ: proj_as_wkt: DerivedGeographicCRS can only be
> exported to WKT2//
> //  2: In CPL_crs_from_proj4string(x) ://
> //    GDAL Error 1: PROJ: proj_as_wkt: DerivedGeographicCRS can only be
> exported to WKT2//

... here ... is the use of code that will vary by GDAL and PROJ versions.

Roger


> //r0 = stars:::st_transform_proj.stars(r, 4326)//
> //  Error: invalid crs: , reason: generic error of unknown origin//
> //  proj_create: unrecognized format / unknown name//
> //r0//
> //Error: object 'r0' not found//
> /
> All my bests
>

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: Roger.Bivand using nhh.no
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en


More information about the R-sig-Geo mailing list