[GIS] How to export data from a feature layer in ArcGis Server

arcgis-serverarcmapexportshapefile

I'm using a public ArcGis server with some data I would like to export to shape or some other format. I know I can make a program (I'm a developer) that could query the server for all the features on that layer, but I would like something cleaner.

Is there a easy way to export data from a feature layer in ArcGis Server to Shapefile using ArcMap or via web?

Best Answer

I couldn't find an easy way to do it. I had to do it the hard way. If you have to, here are some clues to do it.

  1. You will have to use the ArcGis Api to retrieve the results. You can use the REST Api directly or can use one of the various APIs by ESRI using your language of choice.
  2. You have to know the IDs of the maps you want to retrieve data from. You can query the server to get all de maps IDs too.
  3. Query the server for results. In the 'Where' clause use '1=1' to get all the results. Remember to mark 'Retrieve Geometry' to true if that's the case and use a valid Spatial Reference if you want the result transformed.
  4. ArcGis Server has a default limit of 1000 results per query (it may be different depending of custom configuration). There's no way to paginate the results, so if the data has more than 1000 rows you have to do the following.
  5. Get the IDs of the objects (rows), there's no limit for the results of this query.
  6. Get the first 1000 IDs and query the server for them, repeat until you finish.
  7. Parse/Transform the data for your use.
  8. ???
  9. Profit

You can also do this using the web interface of ArcGis Server, if you don't know much about programming.