ArcGIS Server geoprocessing service to return distance?

724
2
11-14-2016 01:00 PM
DerekLoi
New Contributor III

What is the best way to create an ArcGIS Server Geoprocessing Service that accepts an address (such as a json object or text from the JSAPI) to geocode a point, then... find the distance to a polygon and have that service return the distance ?

I've been reading up on creating a model in model builder and then use that result to publish to ArcGIS Server.  

Would that be the correct way of achieving this?   If so, are there any examples of creating a model that utilizes the "Geocode Address" tool to accept an address/zone text string instead of an input table.

Any help would be very much appreciated.

Thanks,

Derek

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Derek,

   Yes that is the correct route. But I would not waste time with a GP. Just use the Locate task in JS API and then you have a point for the address then you can use GeometryService  distance to find the distance between the point and the polygon.

Locator | API Reference | ArcGIS API for JavaScript 3.18 

GeometryService | API Reference | ArcGIS API for JavaScript 3.18 | distance 

DerekLoi
New Contributor III

hmmm ... i totally didn't think about the geometryservice at all!!!!   thanks for the suggestion!!!

edit:  i forgot... the reason why i was thinking of using an ArcGIS Server GP service was that... I'm looking to create a REST Endpoint that returns the distance of a point from a polygon.

I'll look into Node.js and see if I can use that to create a JSAPI service which I can call from another JS Client....

0 Kudos