Looking to code a feature service export to a shapefile. Preferably in .NET. Any idea?
Try looking into making direct calls to the Rest API from your application. Shapefile is an output format in both tools:
ArcGIS REST API
Authentication details: ArcGIS REST API
Here is a good example of how you would do this with Python: Download ArcGIS Online Feature Service or ArcGIS Server Feature/Map Service
Or this standard tool shipped with ArcGIS: Geoprocessing service example: Clip And Ship—ArcMap | ArcGIS Desktop
Any additional info on why you prefer .NET? Or why this might be required? What will be the "client implementation"?
Thank you. This does the trick. It exports the data from a feature service to a locally stored shapefile.
I prefer .NET because I am writing in in a desktop application that uses C# and I was looking to be consistent. To give you a little bit more information:
The program I am working on uses a PGDB and it has a method to export the PGDB Feature Class to a shapefile for field editing in ArcPad. I am looking to enhance the product by writing a shapefile export for use in AGOL.
So far, I was able to:
1)export the PGDB feature class to a hosted feature service in AGOL using ArcREST and JSON.
3) Iand used .NET interfaces to read and import the data from a locally stored shapefile back to the PGDB Feature Class.
This all works great. However, I am missing a step between #2 and #3 above. I don't know how to export my data from a hosted feature service to a shapefile that is stored locally on my PC. This option does not seem to be present in ArcREST, but maybe i'm just missing it. I the started looking at ArcObjects for.NET and I don't see an interface that states it can perform a feature service to shapefile conversion/export.
I would think this operation would be straightforward as any user, with the proper credentials, can simply login to their AGOL account and export a feature service to a shapefile and then store it locally. I would just like to code this so my users don't have to do this every time they want to import their data.
Any ideas where one may want to look.
Thank you. I ended up using ArcREST Create Replica. Hs an example for anyone else who may be looking for an example.
Thank you Kelly, I was looking in the authentication details as I will need to generate a token so I can create my replica. The referrer parameter suggests that I will need a base url for the web app. Is this the case? If so, do you know if I need to register my application? Any help/suggestions/examples would be great if you have time.
You can use Arcgis.com as your referrer if you are making direct rest calls. If you have a web app url, submit the web app url.
Retrieving data ...