Export Shapefile from a Map Service Inside ArcMap

12288
6
04-28-2011 08:55 AM
MapManOregon
New Contributor III
I've done quite a bit of searching on this topic.  I thought by enabling Geodata Access, I could export a shapefile.

We are going to expose a large number of map services that can be consumed by others in our community using ArcMap.  These folks are not programmers.  I want to be able to give them the ability to add a map service to ArcMap and then to export a shapefile from the layer within ArcMap.

I cannot figure how to do this.  If anybody knows of a way that does not require programming, please help.

Here's our web site with our map services.

http://services.medfordmaps.org/ArcGIS/rest/services

Thanks.

keith massie
Tags (2)
6 Replies
TonyContreras
Occasional Contributor
There is no workflow as simple as you describe, the best option is below.

If you create a map service and enable GeoData access, users can add the map service and use the Distributed Geodatabase toolbar to extract data from the service. (When a valid service has been added to ArcMap, an "Extract Data" button should be enabled on the toolbar.)

Publishing a geodata service with a map service

Copying a geodatabase using Extract Data Wizard in ArcMap
0 Kudos
EzraBoyd
New Contributor II

I'm sorry, but I have to chime in here -- You guys have to do a better job in making ArcServer layers accessible in a desktop environment.  In my experience, your technology has moved in backwards direction in recent years.

RhysDonoghue2
New Contributor III

For anyone who comes across this post, it is possible to download data from ArcGIS Server map services directly to ArcMap.  I have done it plenty of times.  The easy way is to query the data, e.g. https://[your map server]/arcgis/rest/services/[folder]/[map service name]/MapServer/0/query?where=1=1&outFields=*&f=pjson and then save the JSON response.  After that you can use the JSON to features tool in ArcToolbox.  Note that you can only export the maximum number of records allowed, which is 1000 by default.  You can either change this or use Python/JavaScript to run the request until you have all of the data.  You can check the number of records first by requesting returnCountOnly=true in the request parameters.  For a GIS developer, this should less than an hour to write a script to do this.  This is not the only way to do this.  There are other ways too.

0 Kudos
Lake_Worth_BeachAdmin
Regular Contributor

this query no longer is supported

{  "error": {   "code": 400,   "message": "Invalid or missing input parameters.",   "details": [       ]  } }
0 Kudos
RhysDonoghue2
New Contributor III

Hi Joe, thanks for your response.  Your error message is identifying the issue for you. These parameters are not enough "where=1=1&outFields=*&f=pjson".  I put them in there as an example of the key parameters you need to change.  You may still need all of the other parameters, but you can just use the default values for those parameters.  Here's an example using one of Esri's sample services:

1) Open https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3/query in your browser.

2) In the Where parameter, type 1=1

3) In the Outfields parameter, type *

4) In the Format parameter, use JSON 

5) Click Query (GET) and when the response comes back, look at the request parameters in the URL in your browser's address bar, i.e. https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3/query?where=1%3D1&tex... 

You may need those parameters in your request, even though the parameters are empty.  You may not need all of the parameters.  You will need to check by trial and error.

However, in saying that, this URL works fine without all of the parameters: https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3/query?where=1=1&outFi... 

It is possible that earlier versions of ArcGIS Server may require the full parameters but maybe later versions don't.  You can check the version via the REST Services Directory endpoint for the map server, e.g. https://sampleserver6.arcgisonline.com/arcgis/rest/services 

Let me know if it is still not working for you.

0 Kudos
MattWilkie1
Occasional Contributor II
0 Kudos