Working with Enterprise Geodatabase (SDE) data in R using the R-ArcGIS Bridge

2022
3
01-22-2018 03:27 PM
SimonAllard2
New Contributor III

Is it possible to read data from the enterprise geodatabase directly into R and write back to the enterprise geodatabase using the R-ArcGIS bridge?

Cheers,

Simon

0 Kudos
3 Replies
ShaunWalbridge
Esri Regular Contributor

Hello Simon,

To access data stored in an enterprise geodatabase, you have a couple of options: if it's just one layer you're working with, you can save a .lyr file, and work with that directly as a filepath. Otherwise, you can reference tables relative to their SDE connection file, see this answer for more details.

Cheers,
Shaun

0 Kudos
SimonAllard2
New Contributor III

Thanks for the answer Shaun, I know know how to read from the .lyr file or a direct connection to enterprise geodatabase.

What about writing back to SDE using R, is this currently possible?

Cheers,

Simon Allard

GIS Analyst

Bay of Plenty Regional Council Toi Moana

0 Kudos
ShaunWalbridge
Esri Regular Contributor

Simon,

Yes, you can use the same pattern to point at a layer file or direct connection when using arc.write to write the results out:

  arc.write('c:/path/to/my.sde/dbname.layername', results.df)

Where results.df is the data frame after you've made modifications.

Cheers,

Shaun

0 Kudos