J'ai rencontré de nombreux utilisateurs qui ont demandé la possibilité de télécharger les services de fonctionnalités hébergés ArcGIS Online et les services de fonctionnalités/cartes ArcGIS Server. Voir l'outil ci-joint pour faire exactement cela. L'outil vous permettra également de télécharger les pièces jointes des services de fonctionnalités hébergés ArcGIS Online. J'espère que les utilisateurs trouveront cela utile et pratique.<\/P>
<\/P>
Mise à jour 10\/08\/17:<\/STRONG> L'outil téléchargera désormais les domaines de valeurs codées dans la géodatabase. De plus, consolidation des versions 2x et 3x en un seul outil. L'outil peut être exécuté depuis ArcGIS Pro ou ArcGIS Desktop.<\/P>Mise à jour 13\/11\/17: <\/STRONG>L'outil prend désormais en charge l'utilisation d'une clause where pour interroger le service.<\/P>Mise à jour 14\/03\/17:<\/STRONG> Mise à jour vers un script unique pour ArcMap\/Pro utilisant le module requests<\/P>Mise à jour 17\/01\/19:<\/STRONG> Merci à Adam Eversole<\/A> d'avoir signalé que la fonctionnalité de cet outil peut désormais être prise en charge par l'outil Feature Class to Feature Class<\/A> d'ArcGIS Pro :<\/P><\/P><\/BODY><\/HTML>
<\/P><\/BODY><\/HTML>
I was able to poll SAML using this code here. https://github.com/DOI-BLM/requests-arcgis-auth
My script does not "sync" it just sends a request to download a GDB, then renames and adds that GDB to a local directory each night.
I can download feature data, but not related tabular. Script fails at line 391, "fs.load(fsURL)": RecordSetObject: Cannot open table for Load.Going through all the comments here, this seems to have been resolved a while ago. I've installed all the python dependencies that error logging caught (request, chardet, idna, certifi). Can't seem to figure out if this issue is related to settings on the feature service or not, or with the OBJECTID field....
Chris Czerwinski can you share the service to a Group in ArcGIS Online and invite my user account (jskinner_CountySandbox). I'll take a look to see if I can figure out what's going on.
Thanks , you should have access now.
Chris Czerwinski I could not reproduce this error in ArcGIS Desktop for either table. Here is how I had the tool set up:
Weird, as far as I can tell I'm using the same input parameters. As mentioned, I had to add a few python modules (request, chardet, idna, certifi) to get this tool to go. This error message is a bit more ambiguous for me, but I'm wondering if I'm still missing something. Tool works great for retrieving the feature class, but continues to crash when retrieving either of the two related tables (GlobalID to GUID relationship class 1:M). Could I be missing something in my python libraries?
Chris Czerwinski what version of ArcGIS Desktop are you using? I tested with 10.6.1.
Currently 10.4.1. I tested this small script suggested here: https://pro.arcgis.com/en/pro-app/arcpy/functions/recordset-and-featureset-properties.htm to see if I could work with featureset in a local environment, and I get this:
Chris Czerwinski I would try upgrading to 10.6.1 or 10.7 and see if you receive the same error.
Okay - thanks for your time on this. Unfortunately upgrading is out of my control. Until that happens, what would you suggest as an alternative data retrieval workflow. I'm really not a fan of downloading a GDB to my AGOL account, and then downloading that locally. Especially when some of our local geodatabases, need to be updated weekly, or even daily.
Chris Czerwinski if you have access to ArcGIS Pro, you can use the Table to Table tool there. You will enter the URL to the service, i.e. https://services1.arcgis.com/d0ZCwU7eGKVeNiEE/arcgis/rest/services/RVCA_PLF_SiteVisit_Service/FeatureServer/2 , for the input table.
First time using ArcPro, but that works on the feature class and related tables. Unfortunately, I can't preserve the GlobalIDs (in the FC) and their counterpart GUID (in the related tables) that make up the relationship classes. There's an environment setting to preserve this data for the Feature Class to Feature Class tool (but doesn't seem to work), but not the table to table tool. I tried the append (since it has a preserve GlobalID environment setting), but that also doesn't work.
Jake Skinner
Thank you!
Christal Higdon currently this tool will not download related data. You can run the tool again and download the related table, but the relationship class will need to be created afterwards. Creating the relationship class could also be a script. You can execute the Create Relationship Class tool in ArcMap and then copy the result as a python snippet from the Results window.
I'll be working on a script soon to automate downloading multiple services (with related tables) from AGOL on a scheduled task (probably weekly). If successful, I'll share the workflow here.
Thank you Chris! I’m looking forward to it ☺
These scripts work for me in ArcPro or Jupyter Notebook (python3). There's only a few lines that need editing or revisions to make it work for a specific service layer:
https://community.esri.com/thread/208467-download-feature-service-as-file-geodatabase
https://esri.jiveon.com/docs/DOC-10441-downloading-feature-layer-attachments?commentID=56737For lines 123 and 137 in the DownloadAttchments.py, I had to edit from "renameFile(currentAttachmentPath, newAttachmentPath)" to "renameFile(currentAttachmentPath[0], newAttachmentPath)".
Was looking all over for this. It worked great for me. Thank you!
I have a weird issue - I don't get any errors and I don't get the feature class either. Any ideas why?
Have you tried it without the [County = 'Ventura'] condition?
Not sure why this tool is failing, but ArcGIS Pro's Feature Class to Feature Class tool will work:
This tool works great.
I wonder if you could show me what to change in the script if I want to export the same feature service to the same geodatabase every day.
Thank you very much.
Keisuke Nozaki if you are using ArcGIS Desktop you can execute the tool and then go to the Results window > right-click on the result > Copy as Python Snippet. This is explained in the below link:
Understanding tool syntax—Help | ArcGIS Desktop
The same can be applied using ArcGIS Pro. You can then setup Windows Task Scheduler to execute the python script at a given interval.
I think variables need to be changed but do not understand a difference between agsService and baseURL.
May I also ask what cwd is?
Thank you.
Keisuke Nozaki the cwd is the path to where the Attachments will be written. Here is an example of how the variables are set up for an ArcGIS Online hosted feature service. This will download the data, including attachments, to a feature class called Property_Damage:
It worked, thank you very much.
Is it possible to download my feature service in .csv format?
Anthony Von Moos you can add the script tool to a Model, and then simply append the Table to Table tool at the end to write the feature class table to a CSV.
I need some help with getting this tool to run. Here is my current setup:
If I download it as Tabular Data, everything runs smoothly; however, if I try to do this as a Feature Data, I received this error:
I am using ArcGIS Pro 2.4.0.
Hervey Lee this will be a little difficult to trouble shoot with the REST service not being externally accessible.
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.