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 swear I posted this already not sure where it went. You could also try the ArcRest tools to do it. You can specify the layers you want (0,1,2,3 etc). Note i did have an issue when i put in too many layers it died. I have an open ticket for this.
Here is the code I use. Note you must install ArcRest. Also note this just changed due to ArcRest changes.
from arcrest.security import AGOLTokenSecurityHandlerfrom arcrest.agol import FeatureServicefrom arcrest.common.filters import LayerDefinitionFilter
username = "put here"password = "put here"url = "put here"outDir = r"put here"
#Get a local replica of the HFS
# Set layers list to what you wantproxy_port = Noneproxy_url = NoneagolSH = AGOLTokenSecurityHandler(username=username,password=password)fs = FeatureService(url=url, securityHandler=agolSH, proxy_port=proxy_port, proxy_url=proxy_url, initialize=True)result = fs.createReplica(replicaName='Backup', layers=[0,1,2,3,4], dataFormat='filegdb', out_path=outDir, wait=False)
# can look at this result and see if it worked
Hi CableClear,
dougbrowning is correct that you can do this using ArcREST. ArcREST will use the 'CreateReplica' command to create a File Geodatabase of the data. However, SYNC needs to be enabled on the feature service in order to use the CreateReplica command.
I went ahead and updated the tool so that you can export data from hosted feature service tables. So if your related data is in a table, you can now download this. Just make sure you have 'Downloading Tabular Data' checked. Also, it will not maintain the relationship class. You will have to recreate this.
Hello Jake, Doug, Many thanks for taking a look.
Jake I have downloaded (v14) of your tool and tried but I seem to get errors trying it on a dataset which has one Feature Class and two related table. and which are joined with a Relationship Class on BayID.
I have uploaded a sample reduced dataset and made it public so no username/PW.There are two layers /0 (bays) and /1(customers).
https://services7.arcgis.com/uQ6sp1S1EdnR7QVS/arcgis/rest/services/DownloadServiceTest/FeatureServer.
Be very appreciative if you could take a look.
Cheers, Graham
Hi GrahamMi,
When you download the related table do you have 'Tabular Data' checked. I was able to download both the feature class and table successfully. You will need to recreate the relationship class, but the data downloaded successfully. Below is how I had the tool set up:
Jake,
Neat tool! I'm able to get the features, but am having issues with the attachments. See error below.
mimiller,
Can you share the service to a Group and invite my ArcGIS Online account to this group? My username is jskinner_CountySandbox. I can test downloading the service with attachments.
Hi Jake,
Thanks so much for testing.
I download the Service to C:\Test , extract the zip file and from inside ArcMap v 10.4.1 run the script from this shared folder.
When I start your Download Service toolbox it looks like this.
However as soon as I tick "Hosted Service layer" the "Download Feature Data" and "Download Tabular Data" grays out. I am then unable to tick the box.
I have found that if I tick the "Download tabular data" first (before anything else) I can tick it but then as soon as I tick "Hosted Feature Service" it grays out again.
Possible a version issue in ArcMap? Or me being stupid?
Hope thsi helps and you can see the issue. Really need to get his working after spending so much time setting up a related tables solution. Will massively appreciate your help.
Many thanks Jake.
This should blow your mind.
Messing around I tried using the "ArcGIS Server Service" even though it is hosted on AGOL. I get none of the greying out issues as post above, and it seems to work perfectly! I get the Customer data out fine.
If I then try and download ...FeatureServer/0 using "ArcGIS Server Service" and selecting "Downloading Feature Data" it also seems to works fine!
I checked again downloading ...FeatureServer/0 using "ArcGIS Feature Service" and it also works fine!
Too much for my little mind!
Graham Misselhorn, if you downloaded the latest version of the tool, you should have the option to check 'Downloading Feature/Tabular Data' when 'Hosted Feature Service' is checked:
I sent you an invite to this group: http://iplan.maps.arcgis.com/home/group.html?id=4cdf9a4328404f8d868d6bf7ca703eb2 . Only one feature layer in the group.
Thanks!
Hi,
Seem to be a great tool, but unfortunately, it doesn't work for me with Arcgis Pro 1.3
here is the message error i get even with my FL or a public FL
Any ideas?
Thank you
Michael Miller,
I believe I found the issue. The OBJECTID field in AGOL is OBJECTID_1. When you download the feature service to a feature class, the OBJECTID_1 field is converted to OBJECTID. This was causing the script to fail. Open the script in a text editor and you can the following line before line 329:
OID = "OBJECTID"
Ex:
lodecombe_DirEtudes,
Unfortunately, this tool will not work in ArcGIS Pro. Pro uses Python 3.4, while ArcGIS Desktop uses Python 2.7. This tool was written using Python 2.7.
Thanks Jake! Really appreciate sleuthing it out and sharing the solution.
Hi Jake
works perfectly with Arcmap. thanks.
However, is it possible to adapt the script because it seems that we have some proxy issues with our company. Work fine with personal internet connexion but not with company connexion.
Thanks
NB: i've used also Show Attachments in Web Map Popup. work fine at home but not in my company. For sure, it's a proxy connexion issues. Any idea to resolve it? Where to put the proxy adress?
I have multiple attachments/photos with the majority of points in a feature class, but only one image attachment is downloading with the script. Is there a way to enable all attachments to download? I've tried multiple other suggested options such as creating a replica via Rest/JSON, but the service continually fails to download.
Thanks,
Geoff
Have you tried the ArcRest method I posted? If so when you look at the result out it will tell you the error it is getting. Also make sure Sync is enabled on the HFS.
Thanks. Sync is enabled on the feature service. Just getting a generic error of "Exporting data for layer 0 failed." in the Rest web interface. I also tried installing ArcRest and using the code you provided above, adding in the attachment parameters and still no luck. The error code is the same and it says please check parameters:
{u'error': {u'message': u'Unable to create replica. Please check your parameters.', u'code': 500, u'details': [u'Exporting data for layer 0 failed.']}}
I also tried this github sample: ArcREST/create_replica_fs.py at master · Esri/ArcREST · GitHub with no luck. In both cases I tried just creating a replica of the features with no attachments with no luck. I feel like somehow my feature service has become corrupted. In both cases the feature service has been successfully referenced when the script runs, so no issues with authentication.
Do you have a field called Date? That is reserved and was my issue when that happened.
gschwitz, would you be able to create a Group in AGOL, share the service with this group and then invite my user account (jskinner_CountySandbox)? I can take a look to see what's going on.
Doug,
I'm not using any reserved words as field names.
I had a support request opened with syncing issues in collector, but I think this is all related. The case # is 01845850 if that helps you at all. The support analyst is currently a member of the group. I just added you to the group too. The feature service is USC_Backflow_Valves.
gschwitz I update the tool where it will download multiple attachments now.
Thanks! That was a big help. Is there anyway to include the ability to export any attribute domains within the feature service?
running into SSL issue with this tool, see image below.
running 10.2.2
Dave
dtenney when you enter the REST URL to the service in a web browser, do you receive a warning that the web site is not trusted?
i do not, it is however a secured service so i am prompted to enter my un/pw, which is the same as i enter into the tool.
are there any known issues with secured services or any known issues with Desktop Version issues?
thanks
Finally got it to work...
one question...
We have a service that is published to arcgis server.
1) view is created in arcgis desktop from a sql database connection
2) view shows QC errors that are populated within the sql database as client updates data
3) the created view is then published to arcgis server for the client to view.
our current test service only has 7 features in it and the download service tool took almost 6minutes to download those 7 features. is it normal for it to take that long? our real world service will have 100s if not 1000s of features, see the problem?
dave
Dave Tenney, it should not take that long. Couple things to try:
1. Does downloading a service based on a feature class, rather than a view, take as long?
2. Try downloading a service from another resource, i.e.:
https://sampleserver6.arcgisonline.com/arcgis/rest/services
feature class (countywide roads) downloads very fast. so it seems that the tool may not like the view that is published.
thanks for your help
Hi All,
Could i use this tool to extract an orthophoto services?
Best
Rawan
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.