Select to view content in your preferred language

Geoprocessing with Javascript Graphic

989
2
09-18-2014 12:29 PM
LoganCaraway
Emerging Contributor

I am interested in having a user draw a line on the client side and then passing that to a geoprocessing service to preform further functions. Can you create a Graphics Layer and pass it as a polyline parameter?

Further more, can that graphic also be exported as a Shapefile from the browser? I've found some documentation online involving binaries but it was a little above my head. Didn't know if there was a easier way to do so? Or if there was any resources I could check out. 

0 Kudos
2 Replies
TimWitt2
MVP Alum

Yes you can use it as a parameter in a GeometryService, to get for example the lines length: geometryservice-amd | API Reference | ArcGIS API for JavaScript

Or use editing in the API: Edit rivers and waterbodies

PaulCrickard1
Deactivated User

To save as a shapefile, you could pass the geometry to a server via AJAX and then write it out. I have an example that uses a single point and returns a shapefile using python.

Shapefile Creator Website Using Cherrypy | Architecture and Planning