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

685
5
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

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

5 Replies
Orhun_Aydin
New Contributor

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
nich7905
New Contributor

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

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

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