Find Nearest feature and Distance using ArcGIS Server / REST Services

Discussion created by Alagappan on May 6, 2014

We have a requirement to find the nearest feature and its distance from another layer in our web application. In other words, We have a source point featureclass 'location' and if a new location is created in the web application , we have to find its nearest competitor & its distance from 'competition' featureclass. For this, we have created a geoprocessing service and in that, Spatial Join tool is used to find the closest feature and its distance. There is a random failure in this service. Please help if there is any other alternative way using arcgis server rest apis / urls to meet this requirement.

We are using ArcGIS Desktop 10.1 Desktop standard and ArcGIS Server 10.1. Since we have arcgis desktop 10.1 standard licence, we are not able to use generate near table or near related tools, so we used spatial join.