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>
Is there any way to get this tool to work with ArcGIS Pro's Basic license? I am receiving the following message after running the tool:
! ArcGIS for Desktop Standarad license is required to extract attachments!Failed to execute (DownloadService).
Anyone had an issue with the ArcGIS Pro tool where the feature class downloads but the features do not display as they have '0' in the Shape_Length and Shape_Area field? A point dataset downloaded fine from the same service URL.
This tool is extremely helpful, and I just wanted to thank @JakeSkinner for creating this.
I was able to pull services from GIS Rest Service for a county, that otherwise, had no publicly available .shp, .DWG, etc.
Thanks again and curious to see where else I might be able to implement this.
Jamie Leitch instead of using this tool, you can simply use ArcGIS Pro's Feature Class to Feature Class tool.
The script works great when downloading a hosted feature layer from AGOL to a file geodatabase in ArcPro. However, when I change the Output Feature Class/Table parameter to an enterprise geodatabase I get the error:
When I choose the output feature class it automatically adds [Database name].SDE in front of the feature class name:
Is there a way to get this to work with an enterprise geodatabase?
thanks
Many thanks for this tool. It has saved me much time that would have otherwise been spent comparing multiple browser windows to answer questions that the Map App authors didn't anticipate. (Are polygons X & Y from 2013 or 2015? click, change layers, click, change layers, click, ...)
Also note that even though FeatureClass to FeatureClass in ArcGIS Pro in can also convert services to local data, this tool will retrieve features from services that fc2fc fails with. So keep this one in your toolbox stash too!
Hi Jake,
Thank you for the tool. I amusing it for some time. And now the Fc to Fc tool in the ArcPro does the job as expected.
I was trying to use the tool to download the records from the Tracker for ArcGIS service that is in use for some time. The service by default have maxRecordCount value set at 28800. The service have more records, but when either of the two tools used, the resulting FC will only contain 28800 records equivalent to maxRecordCount limit. I believe the tool works as expected for other services. Does the Location Tracking service have different configueration? If so Is there a way to overcome this issue?
Thanks,
A
for reference:
Is there a way to download web map service published by ArcGIS Server if I connect to it as a user?
Hi Jake, thanks for share your tool. I was learning more python just inspecting it. Im curious about this:
Which WhereClause is faster to load features:
a) where = "{0} IN ({1})".format(OID, ids)
b) where = OID + '>' + str(y) + 'AND ' + OID + '<=' + str(x)
c) Make a list of OID's and put it directly in the URL query like this: "......./query?objectIds={[OID's List]}&returnGeometry=true...
What are the differences betwen the these? In which situations use them? Cold you tell me where can i find documentation about this?
Thank you for your time.
Regards
Juan Julio
I'll have to check, trying to run the tool remotely on a client's machine with their data. I would assume they do have Pro, but I can definitely test it locally. Thanks for the quick reply....
John Watson do you have ArcGIS Pro installed? You can use the Table to Table tool to download the related table. This tool will download the attachments as well.
FWIW, we opted to implement James' solution and have it running on a Windows Server 2012 via a scheduled task. Not sure if Jake's is the same but I liked the idea of appending to the existing FGDB originally downloaded rather than creating a new copy. This is mostly because we are moving features down from an ESRI tracker service to archive prior to any purge.
From what I recall, I had to work the .py source just a bit to make it work (nothing too crazy) but may be an issue if you're without any python dev support. One big mistake I made initially was to name the FC's with an underscore "_" in them, which this caused most of the failure I had been having with it. Once I did that it all worked pretty smoothly.
Hey Jake, I've had mixed results with both your script and James Tedrick's...Currently I am trying to run it on a hosted feature layer. Back story: I have a survey built with a hosted feature layer and a related table; the related table has attachments with photos. Your tool will download each individually (which, if you ask me, the next enhancement should be the ability to download both at the same time), but I cannot get it to download the attachments. My latest attempt resulted in this error:
Traceback (most recent call last): File "D:\GIS_Workspace\EBA\GIS_Library\Toolboxes\DownloadServicewithAttachments.py", line 661, in <module> if hasrow == True:NameError: name 'hasrow' is not defined
Now, I was able to retrieve the pictures as part of a two step manual process using the MapPhotos toolbox that I believe James created, but I had to first export then download the hosted feature data as a geodatabase.That's not super ideal and I'd rather get yours to run without having to constantly download a file geodatabase offline. Thoughts?
Kathy Smikrud a Standard license is required to enable attachments on a feature class. See the licensing information for the Enable Attachments tool:
Enable Attachments—Data Management toolbox | Documentation
Also just for clarification, the feature class to feature class tool does not allow hosted AGOL feature layer downloads in ArcMap correct only thru your tool Jake?
Yes, that is correct.
Hi Jake Skinner and Adam Eversole,
I've using ArcGIS Pro's Feature Class to Feature Class tool: that you mention above in a script tool for other staff to use and it has been working great to download hosted AGOL feature layer data. However today I noticed that even though the Feature Class to Feature Class—Conversion toolbox | Documentation says it works with Basic, Standard and Advanced I'm getting a warning that the tool completes but with errors. The error is 001102: You must have at least the standard license to run this tool with the specified data. Apparently features with attachments must have a license level other than ArcGIS Desktop Basic to be copied. Ugh I had been working with an advanced ArcGIS Pro license but I'm glad I switched to basic to see this error since the script tool/workflow process I'm working on is for staff that use the basic version. I'm frustrated to find this error and wonder why a person has to have a standard license or higher to download attachments?
Thanks for your help,
Kathy
That's quite a strange error; I don't think I've ever seen this one before. I guess I'll try to finish out the remaining records manually. I can see them in ArcGIS Pro, so I know that the geometry exists (at least for most of the polygons that are missing. I wonder if there is a record that doesn't have any geometry that's throwing this error. Thanks for the script, Jake Skinner. It seem to work well provided the service doesn't have any issues.
Matthew Bradbury I believe there is an issue with the service. If you go to the REST service URL:
https://spatialservices.conservation.ca.gov/arcgis/rest/services/CGS/QuaternarySurficialDepositsSouthernCA/MapServer/138/query
And try to execute the query OBJECTID > 129000 it will fail:
It appears to be something with the geometry. If you choose not to return the geometry the query is successful.
Jake Skinner, that was the first thing I did. I tried a few different ways of writing the object ID (OID, OBJECTID, objectID, ObjectID, ect), and none of those worked. It gives this error every time I try to pass it any kind of where clause, even for a field that I know exists in the data:
Error loading features: RecordSetObject: Cannot open table for LoadCompleted script DownloadService...Failed to execute (DownloadService).Failed at Tue Nov 5 11:29:46 2019 (Elapsed Time: 3.47 seconds)
I'm trying to see if there's a way to force it to just download the last 420 records in the set, as it downloaded 129k records without an issue. This is an ArcGIS Server service. If you'd like to see what I'm seeing, this is the service URL:
Layer: Geology Polygons (ID: 138)
Matthew Bradbury you can specify a where clause within the tool. Ex: OBJECTID > 129420
Hi Jake Skinner,
Is there a way to have to script start at a specific object ID? I'm downloading a dataset that has 129,420 records, and it got to 129,000 and gave an error. I looked through the script to try and get it to start at a specific object ID, but it looks like the way it iterates, there's no simple way to have it just start at a specific ID.
Hi Jack,
Thanks for the reply. I am unable to download off a different map service from the same Map instance (10.5).
I have also tried it on Host Feature Services from AGO but I receive a different error.
I have also tried it on our Feature Instance, which is on 10.5, and it gave me the same error as my Map Instance.
Xiuju (Judy) Zhou if you have access to their API, you can query it using something such as Python and write the data to a feature class.
Hi Jake, one quick question, can Waze data be consumed other than GeoEvent?
Thanks!
Xiuju (Judy) Zhou
Systems Consultant
Houston Public Works-IT-GIS
611 Walker
832-395-2670
Hervey Lee this will be a little difficult to trouble shoot with the REST service not being externally accessible.
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.
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.
Is it possible to download my feature service in .csv format?
It worked, thank you very much.
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:
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.
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.