kadyb / rgugik

Download datasets from Polish Head Office of Geodesy and Cartography
https://kadyb.github.io/rgugik/
Other
33 stars 4 forks source link

GDAL error: unit of measure not found #70

Closed mikerspencer closed 3 years ago

mikerspencer commented 3 years ago

Ortho vignette (https://github.com/kadyb/rgugik/blob/master/vignettes/orthophotomap.Rmd), line 236/7.

Warning message:
In CPL_read_gdal(as.character(x), as.character(options), as.character(driver),  :
  GDAL Error 1: PROJ: proj_uom_get_info_from_database: unit of measure not found

My gdal version (3.2.1 on Ubuntu 20.04).

The following line (247) generates 38 gdal warnings:

38: In CPL_read_gdal(as.character(x), as.character(options),  ... :
GDAL Message 1: for band 3, nodata value has been clamped to 0,
  the original value being out of range.

The same out of range error appears from line 260 and 271, but the plots are created.

Submitted as part of JOSS review: https://github.com/openjournals/joss-reviews/issues/2948

kadyb commented 3 years ago

Which version of sf and stars are you using?

kadyb commented 3 years ago

I tried to reproduce this with GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1, sf 0.9.7, stars 0.5.1 on Windows 8.1 and Pop!_OS 20.04 LTS. This warning and GDAL message didn't show up for me, so it may be only related to the logging options.

It seems to me that there is nothing to worry about. The warning is related to the lack of specification of the coordinate system in the raster. We use st_crs(img) = 2180 in next steps to fix it. The GDAL message also seems to be related to data, so I think it can be skipped.

The raster operation results look OK:

stars object with 2 dimensions and 1 attribute
attribute(s), summary of first 1e+05 cells:
   calc_ndvi       
 Min.   :-0.09265  
 1st Qu.: 0.04712  
 Median : 0.11475  
 Mean   : 0.11738  
 3rd Qu.: 0.19249  
 Max.   : 0.36508  
dimension(s):
  from   to offset delta               refsys point values x/y
x    1 8798 361186  0.25 ETRS89 / Poland CS92 FALSE   NULL [x]
y    1 9504 484418 -0.25 ETRS89 / Poland CS92 FALSE   NULL [y]
mikerspencer commented 3 years ago

sf version 0.9-7 stars version 0.4-3

I agree it's not a worry - everything worked subsequently and was plotted in the right place.

kadyb commented 3 years ago

Right. I can also recommend upgrading stars to the new version because it is a really great package, but I don't know if it will affect the printing of warnings/messages from GDAL. Anyway, thanks for reporting!