Can R-bridge arc.write to a Feature Service?

1888
8
Jump to solution
06-18-2021 10:05 AM
AndrewPadilla
Occasional Contributor

Hello R-ArcGIS community,

I am new to ArcGIS R-Bridge, but have moderate experience in R and ArcGIS. I am looking for a way to use R to write to a feature service. The R arcgisbindings package allows one to read a feature via arc.open but it doesn't seem to allow writing back (arc.write) to the feature service. Is there a way to accomplish this? I am looking to QA/QC the data in R as I find it more simple. Any help would be great. Thanks for your time.

0 Kudos
1 Solution

Accepted Solutions
BenjaminDorsey
New Contributor II

Hey Andrew,
I have been working through a few similar challenges with bridge. My solution right now is to use R to execute python commands. With Arc Py and the ArcGIS python libraries we can do pretty much anything. I have attached a super simple R script and Python script. That demonstrates a second approach - which is to tell R to run a python script once you have a Feature Class written to a temp data base. The python script can overwrite or append the data to a Feature Service.  Make sense?

View solution in original post

8 Replies
by Anonymous User
Not applicable

Hey Andrew,

We do not have a direct way to write to a portal, yet. The workaround would be:

1. Write feature as a feature class in a gdb using arc.write

2. Use the Share ribbon in ArcGIS Pro to share that feature class as a feature service.

I know this is not an automated approach, however. If you host data frequently you can perform the above step once and put the Share step in a scheduler in Pro.

0 Kudos
AndrewPadilla
Occasional Contributor
Hi Orhun,

Thanks for your quick response. I haven't shared a feature class before, would I be able to write over an existing feature service or would it need to be a few one?

Thanks,
Andy
0 Kudos
by Anonymous User
Not applicable

Hi Andy - thanks for the question.  Yes you can easily overwrite an existing web layer using either of the two workflows outlined here:

https://pro.arcgis.com/en/pro-app/latest/help/sharing/overview/overwrite-a-web-layer.htm

thanks!

-Nick Giner

0 Kudos
BenjaminDorsey
New Contributor II

Hey Andrew,
I have been working through a few similar challenges with bridge. My solution right now is to use R to execute python commands. With Arc Py and the ArcGIS python libraries we can do pretty much anything. I have attached a super simple R script and Python script. That demonstrates a second approach - which is to tell R to run a python script once you have a Feature Class written to a temp data base. The python script can overwrite or append the data to a Feature Service.  Make sense?

AndrewPadilla
Occasional Contributor

Hi Benjamin,
Thanks for providing me with your solution. Yes, it does make sense. I have been working with some python scripts in R so I think it shouldn't take too much.
Cheers,
Andy

0 Kudos
NicholasGiner1
Esri Contributor

@BenjaminDorsey@AndrewPadilla 

Finally, I have a positive response to this! We've recently developed and announced a new R metapackage {arcgis} with several subpackages that can read AND write feature services, amongst many other capabilities.   The goal of the project is to provide an R interface to ArcGIS location services.

  • It's free, open-source, and available on CRAN
  • It does not require an ArcGIS Pro installation/license (unlike {arcgisbinding})
  • {arcgisbinding} can still be used for working with local data or developing R-driven geoprocessing tools
  • We'll continue to develop {arcgis} and {arcgisbinding}, so stay tuned!

Blog article announcing the new R metapackage

Link to documentation + getting started and tutorials

BenjaminDorsey
New Contributor II

Wonderful news! I look forward to trying it out!

 

0 Kudos
AndrewPadilla
Occasional Contributor
That sounds great, thank you for the update. I will give it a go and see how it works!
0 Kudos