Export Shape File from Web Application

03-12-2020 12:02 PM
New Contributor II

I have posted about this in the past with no luck. I'm getting desperate. Here's what I have:

Web Application with map powered by Javascript API version 3.x. I have a ArcGIS Server with a published mxd with a set of defined layers. On the Web Application, the user can perform a data query and the web application will create a graphics layer representing the query results that is added to the map on the browser.

I want the user to be able to click and download a spatial file with the current extent of the map with all displayed layers AND the layer representing the dynamically added graphics layer.

Simple question: is this even possible? If so, can somebody give me an idea of how. I looked into ExtractData, but ran into many issues with that just trying to extract the shape file from the layers on the server. I didn't even get as far as trying to get the dynamically created layer exported.

If I can't figure this out soon, I'm gonna take up brain surgery. I feel like that would be much easier.

Thanks in advance!

0 Kudos
3 Replies
MVP Esteemed Contributor


   What you are wanting is technically possible, but not easy even for an experienced developer. The first challenge is that a map and it's data are two different entities. Though the ExtractData task will get you the data that is used in a map service the map can be made up of many map services and then you add the complexity of the queried results of a layer that is added to the map as graphics that the server knows nothing about so the ExtractData task is useless for that.  Needless to say this is something you would need to hire consulting company to help you with, as a custom geoprocessing task using python is likely the best route.

New Contributor II

As a very experienced programmer (more than 30 years) I couldn't agree with you more. I have the capability of writing python scripts and all the javascript needed for this, I just don't have a clue where to begin. I actually have a pretty simple map with a single map service and the graphics being created is based on a simple point layer in the map service. But, I'm not going to tackle this. I'm going to suggest to the customer that she hire a GIS consultant to accomplish this task.

Thanks for the info. It helped!

0 Kudos
Esri Regular Contributor

Hi Tom Lewis‌,

You might want to interest in looking into this one Export Item—ArcGIS REST API: Users, groups, and content | ArcGIS for Developers 

It seems from your enterprise portal rest end point you can export the shapefile, from js api 3.x , it should be able to call post request. 

0 Kudos