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>
Thanks Jake for you prompt response! I can run successfully now. but I don't see attachment saved to my specified folder c:/data, the message is:
Executing: DownloadService true false https://services1.arcgis.com/XpTq0H1nJ5DHgofs/ArcGIS/rest/services/service_2d983d48b0c8435897ca1481fe4389ec/FeatureServer/0 # true false # # C:\Data\VehicleTripInspection.gdb\test2 true C:\Data
Start Time: Fri Oct 19 14:41:16 2018
Running script DownloadService...
Generating Token
Copying features with ObjectIDs from 0 to 1
Retrieving Attachments
Service does not have 'Sync' operation enabled
Xiuju (Judy) Zhou can you share the service to an ArcGIS Group and then invite my user account (jskinner_CountySandbox)? I can try and execute the tool and see what's going on.
Thanks! Yes. I invited your account my AGO group.
That is an ArcGIS Online Survey123 app with a form and feature service hosted by AGO. Please let me know if anything further.
Thanks!
Xiuju (Judy) Zhou
Systems Consultant
Houston Public Works-IT-GIS
611 Walker
832-395-2670
Xiuju (Judy) Zhou go to the Feature Service details page > Settings tab. Make sure 'Sync' is enabled:
Thanks Jack! I am able to download attachments now and see the folder with globalID named in hard drive . when I open the feature layer in ArcMap and identify a feature, I see globalID field without link to attachment files. How to open attachment file by clicking the globalID field or by anyway?
Xiuju (Judy) Zhou you will click in the middle where it says 'Attachments':
Thank you so much Jack! I found it. it is working now. I am also wondering how to run a python file. see screenshot. I run failed by either way of two below.
You will need to edit the python file (.py) in a text editor or IDE (i.e. PyScripter). You will want to edit the section under #Variables. Here is an example:
Thanks lots Jack! I really appreciate your great HELP! it works now. A further question, is there anyway to same data to enterprise database SDE (SQL Server or Oracle)? if yes, where to save attachments to? database or hard drive?
The attachments are written to disk temporarily and then loaded into the Attachments table (which is stored in the Geodatabase). The attachments can be deleted from disk after the tool is executed.
I tried with specified outputFC, but failed:
outputFC = r"C:\Users\e124802\AppData\Roaming\ESRI\Desktop10.5\ArcCatalog\GIMSDB_COHSDE.sde\test_login
the program tried to save data to outputFC = r"C:\Users\e124802\AppData\Roaming\ESRI\Desktop10.5\ArcCatalog\GIMSDB_COHSDE.sde\sde\test_login
why program added \sde subfolder to it?
Jake,
I tried to output to SDE enterprise database with specified outputFC, but failed:
why program added \sde subfolder to outputFC?
Xiuju (Judy) Zhou not sure why this is occurring, but try the following for the outputFC variable instead:
r"Database Connections\GIMSDB_COHSDE.sde\test_login"
Jake, yes, I changed outputFC, but get warning and no data are downloaded to database. could you advise?
baseURL = "https://services1.arcgis.com/XpTq0H1nJ5DHgofs/ArcGIS/rest/services/service_2d983d48b0c8435897ca1481fe4389ec/FeatureServer/0/query"
outputFC = r"Database Connections\GIMSDB_COHSDE.sde\test_login"
--------------------------
Xiuju (Judy) Zhou under the first line in the python script, add the following:
<SPAN class="comment token"># Disable warnings</SPAN> requests<SPAN class="punctuation token">.</SPAN>packages<SPAN class="punctuation token">.</SPAN>urllib3<SPAN class="punctuation token">.</SPAN>disable_warnings<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
Thanks Jack! Do you think if I disable the warning, data will be saved to SDE? Because data was not able to save after the warning. I am not sure Saving data is affected by warning message.
Yes, it should. If it does not, then it's most likely an enterprise geodatabase permissions issue. One way to trouble shoot this is to execute the same script but output the feature class to a File Geodatabase.
I still can’t do it. The warning message is disabled. But data is not saved to SDE and PDF file is not saved without error message.
Hi Jake,
I still can’t do it. The warning message is disabled. But data is still not saved to SDE and PDF file is not saved without error message. is any successful case for SDE database?
Xiuju (Judy) Zhou I believe I figured out the issue. When running this script outside of ArcGIS Desktop/Pro you will need to specify the full feature class name.
SQL Server:
<database name>.<owner>.<feature class>
Oracle:
<owner>.<feature class>
Here are the parameters I was able to get to work. Take note of the outputFC:
THANK you soooooooooooooooo much Jack! it is successfully! that is what I need finally! I really appreciate your great help!
Thanks for the tool. It works great to download individual hosted layers, but can it also be used to download the entire hosted feature as a GDB, similar to the functionality of Export in AGO?
Larry Jahn no this will not download a File Geodatabase. There is a sample on how to do this here. It is the Backup Hosted Services sample. These samples leverage the ArcGIS API for Python, which requires Python 3.x. Python 3.x is downloaded on any machine that has ArcGIS Pro installed.
Thanks for the quick response Jake. I'll try that.
Would I be able to copy an existing feature service in AGOL, to another (new) feature service using this?
joe rodmey you can use a combination of this tool and the following tool:
https://community.esri.com/docs/DOC-11621-update-hosted-feature-service-with-feature-class
I have used this tool successfully in the past but today I ran into this problem, any idea how to fix this:
Error: AttributeError: 'NoneType' object has no attribute 'utf_8_decode'
Thanks in advance
PJ
Pankaj Jamwal can you share the service to an ArcGIS Online Group and invite my user account (jskinner_CountySandbox)?
Thanks for your quick reply. I just shared the service with your account.
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.