Select to view content in your preferred language

Importing data from an ESRI Server connection

786
4
07-27-2023 12:29 PM
Labels (3)
AnthonyCarbo
Emerging Contributor

Hello,

I do not have any code, but I question is can you use python to import data from a ESRI Server connection into a File Geodatabase? For example, if I add the data from the Server into my workspace and use the code:

arcpy.conversion.FeatureClassToGeodatabase("Regions",r"C:\Users\name\Documents\ArcGIS\Projects\

COData\CODData.gdb")

NOTE: The code is one line, its two here because it fit better.

Works fine, but I would like to find a way to connect to the server and then automate the import for either all or a specific feature class(es). Any input would be greatly appreciated. Thank you in advance

0 Kudos
4 Replies
MarceloMarques
Esri Regular Contributor

You can write a custom python script using arcpy. Please look into the arcpy api help for more information.

ListFeatureClasses—ArcGIS Pro | Documentation

ListTables—ArcGIS Pro | Documentation

| Marcelo Marques | Esri Principal Product Engineer | Cloud & Database Administrator | OCP - Oracle Certified Professional | "In 1992, I embarked on my journey with Esri Technology, and since 1997, I have been working with ArcSDE Geodatabases, right from its initial release. Over the past 32 years, my passion for GIS has only grown stronger." | “ I do not fear computers. I fear the lack of them." Isaac Isimov |
0 Kudos
AnthonyCarbo
Emerging Contributor

Marcelo,

Thank you, that is what I am trying to do, I have scripts for importing, and other work using arcpy. I am just not sure of the way to create one that pulls the data from a server connection. For example, if I pull the data down into a workspace in Arc, I can then use a script to import it into a GDB, but I cannot figure out how to import from the connection that is in ArcCatalog.

 

0 Kudos
VinceAngelo
Esri Esteemed Contributor

Python is the world's easiest computer language to learn.

Automating ArcGIS loading is as simple as:

  • Completing the first few chapters of an intro Python book (or online class)
  • Completing at least one free online intro ArcPy training
  • Performing at least part of the task manually using Desktop
  • Going into the Geoprocessing Results log and using "Copy as Python Snippet..."
  • Pasting the snippet into a new script  with an import arcpy at the top
  • Altering the singleton command to be in a looping construct (usually a for loop)
  • Annotating your code with a ton of arcpy.AddMessage or print statements
  • Test it over and over until you've got it right.

That's it. Of course, there are many levels of complexity available with a programming language as powerful as Python, but you can start that next week.

- V

0 Kudos
AnthonyCarbo
Emerging Contributor

Sir,

Thank you, I understand, which I am learning. The issue is not so much Python, but what function to use to import data from a server connection into a GDB. Thank you again.

0 Kudos