-
Notifications
You must be signed in to change notification settings - Fork 303
Use install.packages("sf",configure.args=)
to link to gdal/proj/geos from MacOSx postgresapp installation.
#1703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For record keeping purposes, I should also note that this is an edited repost of a question I put on stack: https://stackoverflow.com/questions/68025597/install-sf-for-r-using-gdal-from-postgresapp |
As of https://www.kyngchaos.com/software/archive/gdal-complete/, Kynchaos has is pretty up-to-date:
Success installing R packages on this basis has been reported. What software a user uses to install R packages on MacOS from source is in principle their own business, only CRAN MacOS binaries are supported as such. |
That's great to know. I'll probably end up using it then so I can move on with my life, but I still think it would be a good thing if we could figure this out. |
Unless you must install from source because you need other drivers than provided in the CRAN MacOS binary, please do use the CRAN binary. https://github.com/rsbivand/checkGDALDrivers checks drivers against the CRAN Windows binary, and only four ODBC-based drivers are missing on MacOS (like MSSQLSpatial and ODBC). The
They probably do not include the PostGIS extension in PostgreSQL, so if that is you case, Kyngchaos may be useful. Please report on progress. |
Okay. I have a long geoprocessing query running at the moment that won't be finished for a few days, so I cannot try kyngchaos yet. I will update before the end of the week though, so please do not close yet. Just to clarify, when you say please use the CRAN binaries, you mean just Here is a more thorough reproduction of my problem. Configuration & Libraries# Install libraries if necessary and load them into the environment
if (suppressWarnings(require("RPostgreSQL"))==FALSE) {
install.packages("RPostgreSQL",repos="https://cran.microsoft.com/");
library("RPostgreSQL");
}
# sf technically part of velociraptr, but it is so important that I break it out separately.
if (suppressWarnings(require("sf"))==FALSE) {
install.packages("sf",repos="https://cran.microsoft.com/");
library("sf");
} Example data to Load in from an ESRI args REST service# Load data
Ecoregions = sf::st_read("https://services.arcgis.com/F7DSX1DSNSiWmOqh/arcgis/rest/services/Marine_Ecoregions_Of_the_World_(MEOW)/FeatureServer/0/query?outFields=*&where=1%3D1&f=geojson") Example combining
|
I'll check the MacOS drivers in the CRAN binaries next week when I have access to that platform. |
The CRAN MacOS binary sf package includes |
Thanks so much for helping me investigate this. I have uninstalled R completely from my system and reinstalled everything from scratch just to make sure we are all on the same page. Here is my workflow and output. the
R version 4.1.0 (2021-05-18) -- "Camp Pontanezen"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin17.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
[R.app GUI 1.76 (7976) x86_64-apple-darwin17.0]
> install.packages("sf",repos="https://cran.microsoft.com/")
also installing the dependencies ‘proxy’, ‘cpp11’, ‘e1071’, ‘wk’, ‘classInt’, ‘DBI’, ‘magrittr’, ‘Rcpp’, ‘s2’, ‘units’
trying URL 'https://cran.microsoft.com/bin/macosx/contrib/4.1/proxy_0.4-26.tgz'
Content type 'application/octet-stream' length 232221 bytes (226 KB)
==================================================
downloaded 226 KB
trying URL 'https://cran.microsoft.com/bin/macosx/contrib/4.1/cpp11_0.3.1.tgz'
Content type 'application/octet-stream' length 208052 bytes (203 KB)
==================================================
downloaded 203 KB
trying URL 'https://cran.microsoft.com/bin/macosx/contrib/4.1/e1071_1.7-7.tgz'
Content type 'application/octet-stream' length 908290 bytes (887 KB)
==================================================
downloaded 887 KB
trying URL 'https://cran.microsoft.com/bin/macosx/contrib/4.1/wk_0.4.1.tgz'
Content type 'application/octet-stream' length 532751 bytes (520 KB)
==================================================
downloaded 520 KB
trying URL 'https://cran.microsoft.com/bin/macosx/contrib/4.1/classInt_0.4-3.tgz'
Content type 'application/octet-stream' length 453300 bytes (442 KB)
==================================================
downloaded 442 KB
trying URL 'https://cran.microsoft.com/bin/macosx/contrib/4.1/DBI_1.1.1.tgz'
Content type 'application/octet-stream' length 670893 bytes (655 KB)
==================================================
downloaded 655 KB
trying URL 'https://cran.microsoft.com/bin/macosx/contrib/4.1/magrittr_2.0.1.tgz'
Content type 'application/octet-stream' length 224197 bytes (218 KB)
==================================================
downloaded 218 KB
trying URL 'https://cran.microsoft.com/bin/macosx/contrib/4.1/Rcpp_1.0.6.tgz'
Content type 'application/octet-stream' length 3205553 bytes (3.1 MB)
==================================================
downloaded 3.1 MB
trying URL 'https://cran.microsoft.com/bin/macosx/contrib/4.1/s2_1.0.6.tgz'
Content type 'application/octet-stream' length 10879373 bytes (10.4 MB)
==================================================
downloaded 10.4 MB
trying URL 'https://cran.microsoft.com/bin/macosx/contrib/4.1/units_0.7-2.tgz'
Content type 'application/octet-stream' length 1260841 bytes (1.2 MB)
==================================================
downloaded 1.2 MB
trying URL 'https://cran.microsoft.com/bin/macosx/contrib/4.1/sf_1.0-0.tgz'
Content type 'application/octet-stream' length 92779161 bytes (88.5 MB)
==================================================
downloaded 88.5 MB
The downloaded binary packages are in
/var/folders/1x/gd0b7qc97j78w7hh53s3vm1w0000gn/T//Rtmpjkjmei/downloaded_packages
> library(sf)
Linking to GEOS 3.8.1, GDAL 3.2.1, PROJ 7.2.1
> sf::st_drivers()
name long_name write copy is_raster is_vector vsi
ESRIC ESRIC Esri Compact Cache FALSE FALSE TRUE TRUE TRUE
PCIDSK PCIDSK PCIDSK Database File TRUE FALSE TRUE TRUE TRUE
netCDF netCDF Network Common Data Format TRUE TRUE TRUE TRUE FALSE
PDS4 PDS4 NASA Planetary Data System 4 TRUE TRUE TRUE TRUE TRUE
VICAR VICAR MIPL VICAR file TRUE TRUE TRUE TRUE TRUE
JP2OpenJPEG JP2OpenJPEG JPEG-2000 driver based on OpenJPEG library FALSE TRUE TRUE TRUE TRUE
PDF PDF Geospatial PDF TRUE TRUE TRUE TRUE FALSE
MBTiles MBTiles MBTiles TRUE TRUE TRUE TRUE TRUE
BAG BAG Bathymetry Attributed Grid TRUE TRUE TRUE TRUE TRUE
EEDA EEDA Earth Engine Data API FALSE FALSE FALSE TRUE FALSE
OGCAPI OGCAPI OGCAPI FALSE FALSE TRUE TRUE TRUE
ESRI Shapefile ESRI Shapefile ESRI Shapefile TRUE FALSE FALSE TRUE TRUE
MapInfo File MapInfo File MapInfo File TRUE FALSE FALSE TRUE TRUE
UK .NTF UK .NTF UK .NTF FALSE FALSE FALSE TRUE TRUE
LVBAG LVBAG Kadaster LV BAG Extract 2.0 FALSE FALSE FALSE TRUE TRUE
OGR_SDTS OGR_SDTS SDTS FALSE FALSE FALSE TRUE TRUE
S57 S57 IHO S-57 (ENC) TRUE FALSE FALSE TRUE TRUE
DGN DGN Microstation DGN TRUE FALSE FALSE TRUE TRUE
OGR_VRT OGR_VRT VRT - Virtual Datasource FALSE FALSE FALSE TRUE TRUE
REC REC EPIInfo .REC FALSE FALSE FALSE TRUE FALSE
Memory Memory Memory TRUE FALSE FALSE TRUE FALSE
BNA BNA Atlas BNA TRUE FALSE FALSE TRUE TRUE
CSV CSV Comma Separated Value (.csv) TRUE FALSE FALSE TRUE TRUE
GML GML Geography Markup Language (GML) TRUE FALSE FALSE TRUE TRUE
GPX GPX GPX TRUE FALSE FALSE TRUE TRUE
KML KML Keyhole Markup Language (KML) TRUE FALSE FALSE TRUE TRUE
GeoJSON GeoJSON GeoJSON TRUE FALSE FALSE TRUE TRUE
GeoJSONSeq GeoJSONSeq GeoJSON Sequence TRUE FALSE FALSE TRUE TRUE
ESRIJSON ESRIJSON ESRIJSON FALSE FALSE FALSE TRUE TRUE
TopoJSON TopoJSON TopoJSON FALSE FALSE FALSE TRUE TRUE
OGR_GMT OGR_GMT GMT ASCII Vectors (.gmt) TRUE FALSE FALSE TRUE TRUE
GPKG GPKG GeoPackage TRUE TRUE TRUE TRUE TRUE
SQLite SQLite SQLite / Spatialite TRUE FALSE FALSE TRUE TRUE
WAsP WAsP WAsP .map format TRUE FALSE FALSE TRUE TRUE
OpenFileGDB OpenFileGDB ESRI FileGDB FALSE FALSE FALSE TRUE TRUE
XPlane XPlane X-Plane/Flightgear aeronautical data FALSE FALSE FALSE TRUE TRUE
DXF DXF AutoCAD DXF TRUE FALSE FALSE TRUE TRUE
CAD CAD AutoCAD Driver FALSE FALSE TRUE TRUE TRUE
FlatGeobuf FlatGeobuf FlatGeobuf TRUE FALSE FALSE TRUE TRUE
Geoconcept Geoconcept Geoconcept TRUE FALSE FALSE TRUE TRUE
GeoRSS GeoRSS GeoRSS TRUE FALSE FALSE TRUE TRUE
GPSTrackMaker GPSTrackMaker GPSTrackMaker TRUE FALSE FALSE TRUE TRUE
VFK VFK Czech Cadastral Exchange Data Format FALSE FALSE FALSE TRUE FALSE
PGDUMP PGDUMP PostgreSQL SQL dump TRUE FALSE FALSE TRUE TRUE
OSM OSM OpenStreetMap XML and PBF FALSE FALSE FALSE TRUE TRUE
GPSBabel GPSBabel GPSBabel TRUE FALSE FALSE TRUE FALSE
SUA SUA Tim Newport-Peace's Special Use Airspace Format FALSE FALSE FALSE TRUE TRUE
OpenAir OpenAir OpenAir FALSE FALSE FALSE TRUE TRUE
OGR_PDS OGR_PDS Planetary Data Systems TABLE FALSE FALSE FALSE TRUE TRUE
WFS WFS OGC WFS (Web Feature Service) FALSE FALSE FALSE TRUE TRUE
OAPIF OAPIF OGC API - Features FALSE FALSE FALSE TRUE FALSE
HTF HTF Hydrographic Transfer Vector FALSE FALSE FALSE TRUE TRUE
AeronavFAA AeronavFAA Aeronav FAA FALSE FALSE FALSE TRUE TRUE
EDIGEO EDIGEO French EDIGEO exchange format FALSE FALSE FALSE TRUE TRUE
SVG SVG Scalable Vector Graphics FALSE FALSE FALSE TRUE TRUE
CouchDB CouchDB CouchDB / GeoCouch TRUE FALSE FALSE TRUE FALSE
Cloudant Cloudant Cloudant / CouchDB TRUE FALSE FALSE TRUE FALSE
Idrisi Idrisi Idrisi Vector (.vct) FALSE FALSE FALSE TRUE TRUE
ARCGEN ARCGEN Arc/Info Generate FALSE FALSE FALSE TRUE TRUE
SEGUKOOA SEGUKOOA SEG-P1 / UKOOA P1/90 FALSE FALSE FALSE TRUE TRUE
SEGY SEGY SEG-Y FALSE FALSE FALSE TRUE TRUE
XLS XLS MS Excel format FALSE FALSE FALSE TRUE FALSE
ODS ODS Open Document/ LibreOffice / OpenOffice Spreadsheet TRUE FALSE FALSE TRUE TRUE
XLSX XLSX MS Office Open XML spreadsheet TRUE FALSE FALSE TRUE TRUE
Elasticsearch Elasticsearch Elastic Search TRUE FALSE FALSE TRUE FALSE
Carto Carto Carto TRUE FALSE FALSE TRUE FALSE
AmigoCloud AmigoCloud AmigoCloud TRUE FALSE FALSE TRUE FALSE
SXF SXF Storage and eXchange Format FALSE FALSE FALSE TRUE TRUE
Selafin Selafin Selafin TRUE FALSE FALSE TRUE TRUE
JML JML OpenJUMP JML TRUE FALSE FALSE TRUE TRUE
PLSCENES PLSCENES Planet Labs Scenes API FALSE FALSE TRUE TRUE FALSE
CSW CSW OGC CSW (Catalog Service for the Web) FALSE FALSE FALSE TRUE FALSE
VDV VDV VDV-451/VDV-452/INTREST Data Format TRUE FALSE FALSE TRUE TRUE
MVT MVT Mapbox Vector Tiles TRUE FALSE FALSE TRUE TRUE
NGW NGW NextGIS Web TRUE TRUE TRUE TRUE FALSE
MapML MapML MapML TRUE FALSE FALSE TRUE TRUE
TIGER TIGER U.S. Census TIGER/Line TRUE FALSE FALSE TRUE TRUE
AVCBin AVCBin Arc/Info Binary Coverage FALSE FALSE FALSE TRUE TRUE
AVCE00 AVCE00 Arc/Info E00 (ASCII) Coverage FALSE FALSE FALSE TRUE TRUE
HTTP HTTP HTTP Fetching Wrapper FALSE FALSE TRUE TRUE FALSE
> "HTTP"%in%sf::st_drivers()$name
[1] TRUE
> "PostgreSQL"%in%sf::st_drivers()$name
[1] FALSE |
@aazaff confirmed: which I don't understand, as the recipes should be the same, I think: https://github.com/R-macos/recipes @s-u - |
I'm glad that we've isolated the issue. Unfortunately, we have reached the limits of my knowledge. Is there someone else we could ask or a different repo/forum? I didn't get any traction from stack on my original question, but maybe we could post a new one specifically about the aarch64 v intel issue? |
No need, we wait until Simon Urbanek responds. A new **sf** reached CRAN
today, so new binaries will need generating. If we can get him to update
the GDAL binary before that gets triggered, it will just happen.
Roger Bivand
Falsensvei 32
5063 Bergen
tir. 29. jun. 2021, 18:02 skrev Andrew Zaffos ***@***.***>:
… I'm glad that we've isolated the issue. Unfortunately, we have reached the
limits of my knowledge. Is there someone else we could ask or a different
repo/forum? I didn't get any traction from stack on my original question,
but maybe we could post a new one specifically about the aarch64 v intel
issue?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1703 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACNZ3BFPKSLFC6LHCNUG4HDTVHVDHANCNFSM47GHX4AQ>
.
|
@rsbivand I fear this is the old problem of the |
Thanks very much, @s-u ! I wonder whether you use version control on the corrections you make to the |
Thanks for the link to this issue. I'm still awaiting feedback from our application, I guess I should check they actually got it! |
@Robinlovelace, if you haven't seen, here is the answer from Jody Garnett: https://lists.osgeo.org/pipermail/incubator/2021-May/004331.html |
@Robinlovelace The licence issue maybe simply involves pointing to the key-value pair in all |
This seems to have evolved into more of a thread for The current strategy of having @s-u manually configure stable static builds of
Dropping some of the obscure Just to prove that this is not a completely fantastical scenario, I will mention that a few years ago I built a Shiny app on a Linux server that had something like this for the file export: output$downloadData<-downloadHandler(
filename=function() {
"output.zip"
},
content = function(file) {
Output<-switch(input$format,
"ESRI File Geodatabase" = getGDB(collection_id()),
"GeoJSON" = writeLayers(collection_id(),tempdir(),"geojson"),
"KML_COLOR" = writeLIBKML(collection_id(),tempdir()),
"ESRI Shapefile" = writeLayers(collection_id(),tempdir(),"shp")
)
zip(file,Output,flags = "-r -j -m")
},
contentType = "application/zip"
) You'll notice that in the I have no idea how hard it would be (or if it is even possible!), but a dream case for me would be something within the RConsole that works conceptually like |
@aazaff Thanks - thinking aloud about user needs is helpful. Only a few of us follow (digested) PROJ/GDAL/GEOS developer mailing lists, and we try to adapt key R packages to avoid problems. We have no idea how users of R packages might be able to feed back use cases like yours, which is all the more valuable. @Robinlovelace and others - how might the nascent community survey user practices? We only see needs when breakages cause issues, and when the issues (or R-sig-geo posts or SO ...) get filed. |
Many thanks for that @kadyb, totally missed that but see it's clearly there and in my inbox. Plan to draft a reply and get feedback here: r-spatial/discuss#44
I think surveying users on their needs is a key role for more-or-less formalised groups like r-spatial. I don't have much experience doing this but am sure there is knowhow. I recall @Nowosad put out a request for feedback on a package. If you or or anyone could share info and suggestions (e.g. Microsoft Forms, Google Forms, other best?) that could be a way to get that going, although this is again a separate issue and one that should probably be opened here: https://github.com/r-spatial/discuss/issues |
I'm catching up on the issue. Just to clarify, although it might clear by now, but just in case. If you want to use a Postgres driver with |
Does anyone know if @s-u fixed/updated the gdal configs as suggested above? |
@aazaff not sure what you mean, but you can check the current status of available binaries at https://github.com/R-macos/recipes and installation overrides are at https://svn.r-project.org/R-dev-web/trunk/QA/Simon/packages/flags.inst/ If you need anything, either file a PR (for recipes) or send me an e-mail if you need overrides. |
I don't know how or when, but the PostgreSQL driver now shows up correctly with a fresh install of the CRAN MacOS sf x86_64 binary. Closing issue! |
Contextual Comments
This is probably more support than you want to provide, but I think that if we can figure out how to do this it would be great to update https://github.com/r-spatial/sf#macos for the broader OSx
sf
community. Especially since the kyngchaos binaries are increasingly out of date and the postgresapp bundle is endorsed by postgis.net for Mac users.Question
I use the https://postgresapp.com binaries for installing PostgreSQL/PostGIS on my machine, which includes the needed libraries for PostGIS (proj, geos, and gdal). According to the postgresapp installation documentation (https://postgresapp.com/documentation/install.html) the libraries and configs are saved at the default following paths (which I can confirm):
Binaries: /Applications/Postgres.app/Contents/Versions/latest/bin
Headers: /Applications/Postgres.app/Contents/Versions/latest/include
Libraries: /Applications/Postgres.app/Contents/Versions/latest/lib
Therefore, when combined with the "sf" installation documentation my assumption is that the following should work.
Although I receive no errors or warnings, this does not seem to be working correctly as
sf::st_drivers()
still does not list the PostgreSQL driver as an option. Are there additionalconfigure.args=
arguments that need to be passed?The text was updated successfully, but these errors were encountered: