NearAnalysis Geoprocessing Service  - arcgis javascript api

820
0
02-26-2014 04:31 AM
GaneshSolai_Sambandam
New Contributor III
HI Guys,
I have created a model in model builder and published a Geoprocessing service to call that service within my arcgis javascript application. The reason for creating this Geoprocessing tool is to identify the list of 5 near features along with their distances from the input location.

The input location is a point where as near features can be point, line and polygons. when the Near feature is a line or polygon, it should query against the nearest vertex of the line or polygon rather than using the centroid of the polygon. So I have used "Generate NearTable" geoprocessing tool  and published them as a service (Please see attached png file).
The geoprocessing tool is working perfectly within ARCMap environment, not sure within arcgis javascript environment.
My only concern is the input and output datatype parameters for the geoprocessing service, I published to the server.

If you look at the Metadata for this services below, you could understand the input and output parameters required.


InputLocation: datatype is ok, as it can accept any feature set -so there is no problem with this.

NearFeatures: the problem is with the near features datatype (GPMultiValue:gpstring). I am not sure whether arcgis javascript api, will accept this datatype as an input to our feature layer within our application. Basically, feature layer can be point, line and polygon. I am planning input the near feature as featureset to the GPMultivalue datatype and I am not sure whether javascript api will accept this parameter.

any help on this would be much appreciated.



Task: NearAnalysis
Display Name: NearAnalysis

Category: 


Execution Type: esriExecutionTypeAsynchronous

Parameters: 


Parameter: InputLocation

Data Type: GPFeatureRecordSetLayer
Display Name: InputLocation
Direction: esriGPParameterDirectionInput
Default Value: 

Parameter Type: esriGPParameterTypeRequired
Category: 


Parameter: NearFeatures

Data Type: GPMultiValue:GPString
Display Name: NearFeatures
Direction: esriGPParameterDirectionInput
Default Value: null
Parameter Type: esriGPParameterTypeRequired
Category: 


Parameter: FoundNear5Features_shp

Data Type: GPFeatureRecordSetLayer
Display Name: FoundNear5Features.shp
Direction: esriGPParameterDirectionOutput
Default Value: 

Geometry Type: esriGeometryPoint
Spatial Reference: 27700
Fields: 
FID (Type: esriFieldTypeOID, Alias: FID) 
Shape (Type: esriFieldTypeGeometry, Alias: Shape) 
IN_FID (Type: esriFieldTypeInteger, Alias: IN_FID) 
NEAR_FID (Type: esriFieldTypeInteger, Alias: NEAR_FID) 
NEAR_DIST (Type: esriFieldTypeDouble, Alias: NEAR_DIST) 
NEAR_X (Type: esriFieldTypeDouble, Alias: NEAR_X) 
NEAR_Y (Type: esriFieldTypeDouble, Alias: NEAR_Y) 
Parameter Type: esriGPParameterTypeRequired
Category: 



Supported Operations:   Submit Job 

Supported Interfaces:   REST 

0 Kudos
0 Replies