Home > Mobile >  sf install on Ubuntu fails - no member named SetAxisMappingStrategy
sf install on Ubuntu fails - no member named SetAxisMappingStrategy

Time:02-18

sf install on Ubuntu 18.04 fails with:

g   -std=gnu  11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/include -I'/usr/local/lib/R/site-library/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-J7pprH/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c signed_area.cpp -o signed_area.o
g   -std=gnu  11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/include -I'/usr/local/lib/R/site-library/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-J7pprH/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c stars.cpp -o stars.o
stars.cpp: In function ‘void CPL_create(Rcpp::CharacterVector, Rcpp::IntegerVector, Rcpp::NumericVector, Rcpp::CharacterVector, Rcpp::NumericVector, Rcpp::NumericVector)’:
stars.cpp:771:7: error: ‘class OGRSpatialReference’ has no member named ‘SetAxisMappingStrategy’
  oSRS.SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER);
       ^~~~~~~~~~~~~~~~~~~~~~
stars.cpp:771:30: error: ‘OAMS_TRADITIONAL_GIS_ORDER’ was not declared in this scope
  oSRS.SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER);
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/R/etc/Makeconf:177: recipe for target 'stars.o' failed
make: *** [stars.o] Error 1
ERROR: compilation failed for package ‘sf’
* removing ‘/usr/local/lib/R/site-library/sf’

The downloaded source packages are in
        ‘/tmp/RtmpDZ9Qvj/downloaded_packages’
Warning message:
In install.packages("sf") :
  installation of package ‘sf’ had non-zero exit status

Any suggestions appreciated.

CodePudding user response:

Warning message: In utils::install.packages("sf", repos = "https://cloud.r-project.org") : installation of package ‘sf’ had non-zero exit status

Same issue here. Any advice?

CodePudding user response:

Solved by installing the development versions (sf_1.0-7) from GitHub with: library(devtools) install_github("r-spatial/sf")

  • Related