Using the R-Arc GIS Bridge on Posit's Shiny Server

118
6
a week ago
AnthonyCastelletto
New Contributor II

Hello community,

 

I'm a new member and new the R bridge in general. I just installed the packages in R and the dependencies worried me. What I want to do is use the bridge in a Shiny app hosted on our Posit subscription. Has anyone tried to use use the bridge this way? What were the pitfalls you ran into and how did you work around them?

Thanks in advance for any advice.

0 Kudos
6 Replies
JosiahParry
New Contributor II

Hi Anothony, there are a number of packages that you might be referring to. Which package did you install and want to use within a shiny application? Which dependencies make you worried? They're quite standard for geospatial packages. 

 

Thanks 🙂 

0 Kudos
AnthonyCastelletto
New Contributor II

Bear in mind, I am completely new to this so I might be using incorrect terms or trying something weird.  Anyhow, I installed the arcgis package in R through my desktop R Studio. The then wanted to compile arcgisutils and arcgisbinding. Both of these required the installation of the rust compiler and that required me to install additional modules along the way. That's my worry. I want to make what I'm creating available as a script other people in my work group can run and we're spread across several institutions and countries. So my natural thought was to throw it on my Shiny subscription and figure out some kind of authentication.

0 Kudos
EricaNova
Occasional Contributor II

The dependencies that worry me are that it needs to connect to an active license (which makes sense), but it probably wouldn't be able to do that from a Shiny Server...

 

0 Kudos
JosiahParry
New Contributor II

{arcgisbinding} which utilizes ArcGIS Pro's capabilities and thus requires and active ArcGIS Pro license is not compatible with Linux so it would not work with Shiny Server. 

The other packages—{arcgislayers}, {arcgisgeocode}, and {arcgisplaces}—can work in any OS.

Unless it is for writing to a fGDB you can do most everything else in {arcgisbinding} with {sf} or {terra}.

 

AnthonyCastelletto
New Contributor II

This was my worry. Thanks Josiah. I'm trying to write to a feature layer on Arc GIS Online. This tells me the better route is probably a Python notebook.

0 Kudos
JosiahParry
New Contributor II

Hi Anthony, I think you might have misunderstood me and the messages from RStudio. 

Firstly, {arcgisbinding} is not part of {arcgis} and is not available on CRAN. So you were not prompted to install it or compile it.

 

Additionally, I recently published new versions of the packages some of which use Rust. When a package is published on CRAN it is available in two forms: in the source form or the binary form. The binary is "precompiled" meaning that it has already installed from source and compiled the Rust code. This is very common with R packages. 

 

When RStudio prompted you it asked if you wanted to install from source to which you said "yes i do". Rather, instead, since you do not have Rust, you should type "no" so it installs an older binary. 

 

CRAN only serves binaries for MacOS and Windows. If you wish to install a binary for Linux you can either use https://p3m.dev/ or https://r-arcgis.r-universe.dev/.

 

You can write to a feature layer in AGOL using `{arcgislayers}` . Please see the documentation at https://r.esri.com/r-bridge-site/docs/layers/publishing.html

 

It is a one line command :

JosiahParry_0-1720382916448.png

As you can see the binaries in `arcgisutils` are provided for the latest version for Windows and Mac. 

JosiahParry_1-1720383036259.png

 

 

additionally, binaries are provided for Ubuntu via r-universe 

JosiahParry_2-1720383093121.png

 

0 Kudos