Skip to content

allign_rasters not working anymore after update to gdal 3.1.4 #35

@michielvandijk

Description

@michielvandijk

I am regularly using allign_rasters to harmonize rasters for further analysis. After I updated gdal to 3.1.4 using OSGEO4W64 (from gdal 3.0 I think), this function is no longer working. I inspected the underlying code and the error seems to be related to the gdalinfo function which is called. This function is supposed to read a $proj4 slot, which now seems to be NA and before provided the crs that is needed for gdalwarp that is run next. I suspect that the error is related with the recent update to proj6 as extensively discussed here: https://cran.r-project.org/web/packages/rgdal/vignettes/PROJ6_GDAL3.html.

Any advice would be appreciated. Below my session info and gdal info

sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] raster_3.4-5 sp_1.4-5 gdalUtils_2.0.3.2 wpgpDownloadR_0.1.0 RCurl_1.98-1.2
[6] countrycode_1.2.0 sf_0.9-7 glue_1.4.2 scales_1.1.1 readxl_1.3.1
[11] forcats_0.5.0 stringr_1.4.0 dplyr_1.0.3 purrr_0.3.4 readr_1.4.0
[16] tidyr_1.1.2 tibble_3.0.5 ggplot2_3.3.3 tidyverse_1.3.0 here_1.0.1
[21] pacman_0.5.1

loaded via a namespace (and not attached):
[1] Rcpp_1.0.6 lattice_0.20-41 lubridate_1.7.9.2 class_7.3-17 assertthat_0.2.1
[6] rprojroot_2.0.2 digest_0.6.27 foreach_1.5.1 R6_2.5.0 cellranger_1.1.0
[11] backports_1.2.0 reprex_0.3.0 evaluate_0.14 e1071_1.7-4 httr_1.4.2
[16] pillar_1.4.7 rlang_0.4.10 rstudioapi_0.13 R.oo_1.24.0 R.utils_2.10.1
[21] rmarkdown_2.6 rgdal_1.5-23 munsell_0.5.0 broom_0.7.3 compiler_4.0.2
[26] modelr_0.1.8 xfun_0.20 pkgconfig_2.0.3 htmltools_0.5.1 tidyselect_1.1.0
[31] codetools_0.2-18 fansi_0.4.2 crayon_1.3.4 dbplyr_2.0.0 withr_2.4.0
[36] R.methodsS3_1.8.1 bitops_1.0-6 grid_4.0.2 jsonlite_1.7.2 gtable_0.3.0
[41] lifecycle_0.2.0 DBI_1.1.1 magrittr_2.0.1 units_0.6-7 KernSmooth_2.23-18
[46] cli_2.2.0 stringi_1.5.3 fs_1.5.0 xml2_1.3.2 ellipsis_0.3.1
[51] generics_0.1.0 vctrs_0.3.6 iterators_1.0.13 tools_4.0.2 hms_1.0.0
[56] yaml_2.2.1 colorspace_2.0-0 classInt_0.4-3 rvest_0.3.6 knitr_1.30
[61] haven_2.3.1

getOption("gdalUtils_gdalPath")
[[1]]
[[1]]$path
[1] "C:/OSGEO4~1/bin/"

[[1]]$version
version
"3.1.4"

[[1]]$date
date
"2020-10-20"

[[1]]$drivers
format_code read write update virtualIO subdatasets
1 ECW-raster- TRUE FALSE FALSE TRUE FALSE
2 JP2ECW-raster,vector- TRUE FALSE FALSE TRUE FALSE
3 GeoRaster-raster- TRUE TRUE TRUE FALSE TRUE
4 HDF5-raster,multidimensionalraster- TRUE FALSE FALSE TRUE TRUE
5 HDF5Image-raster- TRUE FALSE FALSE TRUE FALSE
6 BAG-raster- TRUE TRUE FALSE TRUE FALSE
7 MG4Lidar-raster- TRUE FALSE FALSE FALSE FALSE
8 MrSID-raster- TRUE FALSE FALSE TRUE FALSE
9 JP2MrSID-raster- TRUE FALSE FALSE TRUE FALSE
10 VRT-raster,multidimensionalraster- TRUE TRUE TRUE TRUE FALSE
11 DERIVED-raster- TRUE FALSE FALSE FALSE FALSE
12 GTiff-raster- TRUE TRUE TRUE TRUE TRUE
13 COG-raster- FALSE TRUE FALSE TRUE FALSE
14 NITF-raster- TRUE TRUE TRUE TRUE TRUE
format_name
1 ERDAS Compressed Wavelets (SDK 5.3)
2 ERDAS JPEG2000 (SDK 5.3)
3 Oracle Spatial GeoRaster
4 Hierarchical Data Format Release 5
5 HDF5 Dataset
6 Bathymetry Attributed Grid
7 MrSID Generation 4 / Lidar (.sid)
8 Multi-resolution Seamless Image Database (MrSID)
9 MrSID JPEG2000
10 Virtual Raster
11 Derived datasets using VRT pixel functions
12 GeoTIFF
13 Cloud optimized GeoTIFF generator
14 National Imagery Transmission Format
[ reached 'max' / getOption("max.print") -- omitted 137 rows ]

[[1]]$python_utilities
[[1]]$python_utilities$C:/OSGEO4~1/bin/
character(0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions