Description
Hi, I tried to load a shapefile that can be downloaded here and got the following error message:
Error in CPL_get_z_range(obj, 2) : z error - expecting three columns;
Given that I seemed not to be the first to have this problem, I followed the suggestion made by @kadyb in this error thread to install the 1.10 version of the package. However, it did not work. When I ran install.packages("sf", repos = "https://r-spatial.r-universe.dev")
I got the following message:
*installing source package ‘sf’ ...
** using staged installation
configure: CC: clang -arch arm64
configure: CXX: clang++ -arch arm64 -std=gnu++11
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘sf’
*removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/sf’
*restoring previous ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/sf’
Warning in install.packages :
installation of package ‘sf’ had non-zero exit status
I then ran remotes::install_github("r-spatial/sf")
and got:
Downloading GitHub repo r-spatial/sf@HEAD
RunningR CMD build
...
*checking for file ‘/private/var/folders/8_/n10p4gls1rggj7frcghmj4y40000gn/T/RtmpL5L5wu/remotes1332e6d8caad9/r-spatial-sf-8afb003/DESCRIPTION’ ... OK
*preparing ‘sf’:
*checking DESCRIPTION meta-information ... OK
*cleaning src
*running ‘cleanup’
*checking for LF line-endings in source and make files and shell scripts
*checking for empty or unneeded directories
*building ‘sf_1.0-10.tar.gz’
*installing source package ‘sf’ ...
** using staged installation
configure: CC: clang -arch arm64
configure: CXX: clang++ -arch arm64 -std=gnu++11
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘sf’
*removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/sf’
*restoring previous ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/sf’
Warning message:
In i.p(...) :
installation of package ‘/var/folders/8_/n10p4gls1rggj7frcghmj4y40000gn/T//RtmpL5L5wu/file1332e38c1e457/sf_1.0-10.tar.gz’ had non-zero exit status
[Sorry I cannot manage to input multi-line code in Github's interface]
Would anyone be able to help, either by guiding me to install the 1.10 version of the package, or finding an alternative fix to the initial error message when loading the shapefile ?
Many thanks,