Beta Trace Downstream Tool - Error in results REST URL

2705
3
01-28-2014 09:12 AM
Labels (1)
DavidShaeffer
New Contributor II
In the flex 3.6 api when you call getResultData it passes the correct url per the beta downstream trace tutorial(https://developers.arcgis.com/rest/elevation/api-reference/trace-downstream.htm).

Correct syntax per documentation:
http://elevation.arcgis.com/arcgis/rest/services/Tools/Hydrology/GPServer/TraceDownstream/jobs/<jobId>/results/<output_parameter_name>?token=yourToken&f=json

If this syntax is used it will return {"error":{"code":400,"message":"Invalid URL","details":[]}}

HOWEVER:
If you use this syntax you it will return the correct result: http://elevation.arcgis.com/arcgis/rest/services/Tools/Hydrology/GPServer/TraceDownstream/job/<jobId>/results/<output_parameter_name>?token=yourToken&f=json

The difference is one URL uses "jobs" while the other uses "job". I believe this is probably an error in the way this geoprocessor was published. Should be jobs.

Esri...please fix this! In the meantime I guess I will have to create my own httpservice POST. GRRRRRR :mad:
Tags (2)
0 Kudos
3 Replies
DavidShaeffer
New Contributor II
I am getting blank results from the service. Not sure why. For example:

REQUEST: http://elevation.arcgis.com/arcgis/rest/services/Tools/Hydrology/GPServer/TraceDownstream/submitJob?.....

RESULT:
{"name":"TraceDownstream","displayName":"TraceDownstream","description":"Trace Downstream determines the path water will take from a particular location to its furthest downhill path, often this is the ocean.This service is currently undergoing beta testing and we would appreciate your feedback via the Hydro Forum.","category":"","helpUrl":"http://elevation.arcgis.com:80/arcgis/rest/directories/arcgisoutput/Tools/Hydrology_GPServer/Tools_H...","executionType":"esriExecutionTypeAsynchronous","parameters":[{"name":"InputPoints","dataType":"GPFeatureRecordSetLayer","displayName":"Input Points","description":"The point features used for calculating downstream trace. ","direction":"esriGPParameterDirectionInput","defaultValue":{"displayFieldName":"","geometryType":"esriGeometryPoint","spatialReference":{"wkid":102100,"latestWkid":3857},"fields":[{"name":"OID","type":"esriFieldTypeOID","alias":"OID"},{"name":"Name","type":"esriFieldTypeString","alias":"Name","length":60}],"features":[],"exceededTransferLimit":false},"parameterType":"esriGPParameterTypeRequired","category":""},{"name":"PointIDField","dataType":"GPString","displayName":"Point Identification Field","description":"The field used to identify to the input points.It can be an integer or string field.  The default is to use the unique ID field.","direction":"esriGPParameterDirectionInput","defaultValue":"","parameterType":"esriGPParameterTypeOptional","category":""},{"name":"DataSourceResolution","dataType":"GPString","displayName":"Data Source Resolution","description":"Keyword indicating the source data that will be used in the analysis. The keyword is an approximation of the spatial resolution of the digital elevation model used to build the foundation hydrologic database. Since many elevation sources are distributed with units of arc seconds, we provide an approximation in meters for easier understanding.Blank - during beta, leaving this parameter blank will use the 30m source in the US and 90m source in Africa. Additional areas will be available in future versions. This is the default. FINEST- FFinest resolution available at each location from all possible data sources.30m - The hydrologic source was built from 1 arc second, approximately 30 meter resolution elevation data.90m - The hydrologic source was built from 3 arc second, approximately 90 meter resolution elevation data.","direction":"esriGPParameterDirectionInput","defaultValue":" ","parameterType":"esriGPParameterTypeOptional","category":"","choiceList":[" ","FINEST","30m","90m"]},{"name":"Generalize","dataType":"GPBoolean","displayName":"Generalize Trace Line","description":"Determines if the output downstream trace lines will be smoothed into simpler lines.Unchecked\u2014 The lines will not be smoothed. The ungeneralized stream trace is more accurate but has more vertices so the result is larger. This is the default.Checked\u2014The lines  will be smoothed into simpler lines. The generalized stream trace looks best. It also has fewer vertices and therefore a smaller result file to transmit.","direction":"esriGPParameterDirectionInput","defaultValue":false,"parameterType":"esriGPParameterTypeOptional","category":""},{"name":"OutputTraceLine","dataType":"GPFeatureRecordSetLayer","displayName":"Output Trace Line","description":"","direction":"esriGPParameterDirectionOutput","defaultValue":{"displayFieldName":"","geometryType":"esriGeometryPolyline","spatialReference":{"wkt":"PROJCS[\"NAD_1983_Albers\",GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Albers\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-96.0],PARAMETER[\"Standard_Parallel_1\",29.5],PARAMETER[\"Standard_Parallel_2\",45.5],PARAMETER[\"Latitude_Of_Origin\",23.0],UNIT[\"Meter\",1.0]],VERTCS[\"Unknown VCS\",VDATUM[\"Unknown\"],PARAMETER[\"Vertical_Shift\",0.0],PARAMETER[\"Direction\",1.0],UNIT[\"User_Defined_Unit\",0.01]]"},"fields":[{"name":"OBJECTID","type":"esriFieldTypeOID","alias":"OBJECTID"},{"name":"PourPtID","type":"esriFieldTypeInteger","alias":"PourPtID"},{"name":"Description","type":"esriFieldTypeString","alias":"Description","length":50},{"name":"DataResolution","type":"esriFieldTypeString","alias":"DataResolution","length":50},{"name":"LengthKm","type":"esriFieldTypeDouble","alias":"Length Kilometers"},{"name":"Shape_Length","type":"esriFieldTypeDouble","alias":"Shape_Length"}],"features":[],"exceededTransferLimit":false},"parameterType":"esriGPParameterTypeDerived","category":""}]}
0 Kudos
KevinHibma-old
Regular Contributor III
I realize this was posted a couple weeks ago, but it should be using "jobs" - with an S.
I just tried the service, using "jobs" and it properly queried the job.
I don't exactly understand how you've got that error. Is it when consumed in the FlexAPI? Like Flex is trying to get the status using JOB, or are you saying if you manually put URLS into your browser, it only works with JOB?
0 Kudos
DavidShaeffer
New Contributor II
I realize this was posted a couple weeks ago, but it should be using "jobs" - with an S.
I just tried the service, using "jobs" and it properly queried the job.
I don't exactly understand how you've got that error. Is it when consumed in the FlexAPI? Like Flex is trying to get the status using JOB, or are you saying if you manually put URLS into your browser, it only works with JOB?


I was having trouble with the getResultData method in flex:. My stupid mistake.

I was feeding it gp.getResultData(gp.submitJobLastResult.jobId, "");

when I should have been giving it:

gp.getResultData(gp.submitJobLastResult.jobId, "OutputTraceLine");

Works now! Thanks!
0 Kudos