POST https://hydro.arcgis.com/arcgis/rest/services/Tools/Hydrology/GPServer/Watershed/submitJob HTTP/1.1
content-type: application/x-www-form-urlencoded
f=json
&token=<ACCESS_TOKEN>
&InputPoints={"geometryType":"esriGeometryPoint","features":[{"geometry":{"x":-11946425.36295705,"y":4930494.072505761,"spatialReference":{"wkid":102100,"latestWkid":3857}}}],"sr":{"wkid":102100,"latestWkid":3857}}
&SnapDistance=500
&SnapDistanceUnits=Meters
&SourceDatabase=FINEST
&Generalize=True
Hydrology analysis service
The hydrology analysis service performs hydrological analysis based on authoritative elevation and hydrologic data. The service is available at different geographic areas and spatial resolutions. See the Hydrology analysis data coverage section for more information.
Key features
- Use Trace downstream to determine the downstream flow path from a given location.
- Delineate the catchment area of a particular location using Watershed.
Access the service
To access the hydrology analysis service you need the following:
- An ArcGIS Developer account or an ArcGIS Online account.
- An access token (API key or OAuth 2.0).
Tip:
To learn more about API keys and OAuth 2.0, go to Security and authentication in the Mapping and location services guide.
Example
This example shows you how to delineate the watershed of a point located at southern Colorado, USA using the Watershed request.
1. Send a job request to delineate the watershed. Note that the InputPoints parameter contains the spatial information of the point of interest:
{
"jobId":"<unique job identifier>",
"jobStatus":"esriJobSubmitted",
"results":{}
},
"inputs":{},
"messages":[]
}
2. Check the job status using the provided jobID until the job has succeeded or failed. Learn more about submitting GP Jobs.
POST https://hydro.arcgis.com/arcgis/rest/services/Tools/Hydrology/GPServer/Watershed/jobs/<unique job identifier> HTTP/1.1
content-type: application/x-www-form-urlencoded
f=json
&token=<ACCESS_TOKEN>
{
"jobId":"<unique job identifier>",
"jobStatus":"esriJobSucceeded",
"results":{"WatershedArea":{"paramUrl":"results/WatershedArea"},"SnappedPoints":{"paramUrl":"results/SnappedPoints"}}
},
"inputs":{},
"messages":[]
}
3. Once the job has succeeded, get the results for watershed polygons from parameter WatershedArea.
POST https://https://hydro.arcgis.com/arcgis/rest/services/Tools/Hydrology/GPServer/Watershed/jobs/<jobID>/results/WatershedArea HTTP/1.1
content-type: application/x-www-form-urlencoded
f=json
&token=<ACCESS_TOKEN>
&returnType="data"
{
"paramName": "WatershedArea",
"dataType": "GPFeatureRecordSetLayer",
"value": {
"displayFieldName": "",
"geometryType": "esriGeometryPolygon",
"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": "Pour Point ID"
},
{
"name": "Description",
"type": "esriFieldTypeString",
"alias": "Description",
"length": 50
},
{
"name": "DataResolution",
"type": "esriFieldTypeString",
"alias": "Data Resolution",
"length": 50
},
{
"name": "AreaSqKm",
"type": "esriFieldTypeDouble",
"alias": "Area Square Kilometers"
},
{
"name": "Shape_Length",
"type": "esriFieldTypeDouble",
"alias": "Shape_Length"
},
{
"name": "Shape_Area",
"type": "esriFieldTypeDouble",
"alias": "Shape_Area"
}
],
"features": [{
"attributes": {
"OBJECTID": 1,
"PourPtID": 1,
"Description": "NED 30m processed by Esri",
"DataResolution": "30.0",
"AreaSqKm": 4.74840003239477,
"Shape_Length": 12840,
"Shape_Area": 4748400
},
"geometry": {"rings": [[
[
-951945,
1991295
],
[
-952155,
1991295
],
[
-952155,
1991325
],
...
additional points in the geometry
...
]]}
}],
"exceededTransferLimit": false
}
}