I am performing spatial data analysis within R Studio using datasets stored in our ArcGIS Enterprise. To access these datasets, I am using the arcgisutils and arcgislayers packages, and I've set up an authenticator application in our enterprise portal which allows me to connect to our portal in R Studio using user authentication.
I have been successfully accessing data stored within our enterprise portal using the following steps:
- Obtain the service url for the desired sublayer in a feature layer item using the item's itemID within the arcgislayers::arc_open() function, and passing the result to the arcgislayers::get_layer() function
- Extract the desired sublayer as an sf object using the service url within the arcgislayers::arc_open() function, and passing the result to the arcgislayers::arc_select() function
When I try applying this workflow to data accessible in the Living Atlas, though, I receive a 498 error and a message that the token is invalid. Based on backtracing, it appears that the error is being thrown during the first step of the workflow.
When I navigate to the Living Atlas item in our portal interface, I can open the dataset in a map or view the data table in the Data view without any authentication issues. So, I don't think the issue is that my arcgis login just hasn't had that content shared with it. Is it possible that access to Living Atlas items in the portal interface is driven by a different mechanism than access to items stored in our enterprise, and that this difference in mechanisms is being exposed when trying to connect to the Living Atlas items in R Studio?