Skip To Content

Derive Continuous Flow

Description

The DeriveContinuousFlow task generates a raster of accumulated flow into each cell from an input surface raster with no prior sink or depression filling required.

Example applications of DeriveContinuousFlow include the following:

  • Determine flow accumulation from a surface raster without prior sink or depression filling required.
  • Specify sink or depression cell locations through the inputDepressionsData parameter and determine flow accumulation at each cell of the surface raster, allowing water flow into depression locations but not outward.

Request parameters

ParameterDetails
inputSurfaceRaster

(Required)

The input raster representing a surface.

Syntax: This parameter can be specified as a portal item ID, a URL to a raster image service layer, a cloud raster dataset, or a shared raster dataset.

Examples:

//Portal item as input raster
"inputSurfaceRaster": {"itemId": <portal item id>}

//URL as input raster
"inputSurfaceRaster": {"url": <image service layer url>}
outputFlowAccumulationRasterName

(Required)

The output flow accumulation image service name that will be created.

You can specify the name, or you can create an empty service using Portal Admin Sharing API and use the return JSON object as input to this parameter.

Syntax: A JSON object describes the name of the output or the output raster.

Output name example:

"outputFlowAccumulationRasterName":{"serviceProperties":{"name":"testrasteranalysis"}}

Output raster examples:

//Output portal item:
"outputFlowAccumulationRasterName":{"itemId": <portal item id>}

//Output url:
"outputFlowAccumulationRasterName":{"url": <image service url>}

//Output raster layer service:
"outputFlowAccumulationRasterName":{"service properties":
  {"name":"testrasteranalysis",
  "serviceUrl":"https://<server name>/server/rest/services/Hosted/testrasteranalysis/ImageServer",
  "itemProperties":{"itemId":"8cfbd3ec25584d0d8f4ed23b8ff7c43b","folderId":"sdfwerfbd3ec25584d0d8f4"}}
}
inputDepressionsData

An optional dataset that defines real depressions.

The depressions can be defined through a raster or a feature layer.

If the input is a raster, the depression cells must take a valid value, including zero, and the areas that are not depressions must be NoData.

Raster input example:


"inputDepressionsData":{"url": <image service layer url>}

Feature input examples:

//Feature layer URL
"inputDepressionsData":{"url": <feature service layer url>}

//Feature collection
"inputDepressionsData":{"layerDefinition": {}, "featureSet": {}}

inputWeightRaster

An optional input raster dataset that defines the fraction of flow that contributes to flow accumulation at each cell.

The weight is only applied to the accumulation of flow.

If no accumulation weight raster is specified, a default weight of 1 will be applied to each cell.

Example:


"inputWeightRaster":{"url": <image service layer url>}

outputFlowDirectionRasterName

The output flow direction image service name that will be created. This parameter is optional and can be left blank.

You can specify the name, or you can create an empty service using Portal Admin Sharing API and use the return JSON object as input to this parameter.

Syntax: A JSON object describes the name of the output or the output raster.

Output name example:

"outputFlowDirectionRasterName":{"serviceProperties":{"name":"testrasteranalysis"}}

Output raster examples:

//Output portal item:
"outputFlowDirectionRasterName":{"itemId": <portal item id>}

//Output url:
"outputFlowDirectionRasterName":{"url": <image service url>}

//Output raster layer service:
"outputFlowDirectionRasterName":{"service properties":
  {"name":"testrasteranalysis",
  "serviceUrl":"https://<server name>/server/rest/services/Hosted/testrasteranalysis/ImageServer",
  "itemProperties":{"itemId":"8cfbd3ec25584d0d8f4ed23b8ff7c43b","folderId":"sdfwerfbd3ec25584d0d8f4"}}
}
flowDirectionType

Specifies the flow direction type to use.

Syntax: A string describing the flow direction type, which can be one of the following:

  • D8 is for the D8 method. This method assigns flow direction to the steepest downslope neighbor. This is the default.
  • MFD is for the multiple flow direction method. Flow direction will be partitioned across downslope neighbors according to an adaptive partition exponent.
forceFlow

Specifies whether edge cells will always flow outward or follow normal flow rules.

Syntax: A Boolean value as either false or true.

  • false—If the maximum drop on the inside of an edge cell is greater than zero, the flow direction will be determined as usual. Otherwise, the flow direction will be toward the edge. Cells that should flow from the edge of the surface to the raster inward will do so. This is the default.
  • true—All cells at the edge of the surface raster will flow outward from the surface raster.
context

Contains additional settings that affect task processing. This task has the following settings:

  • Extent (extent)—A bounding box that defines the analysis area.
  • Output Spatial Reference (outSR)—The output raster will be projected into the output spatial reference.
  • Snap Raster (snapRaster)—The output raster will have its cells aligned with the specified snap raster.
  • Cell Size (cellSize)—The output raster will have the resolution specified by cell size.
  • Mask (mask)—Only cells that fall within the analysis mask will be considered in the operation.
f

The response format. The default response format is html.

Values: html | json | pjson

Flow direction type additional information

The following section contains details on the available flow direction methods in the flowDirectionType parameter.

The DeriveContinuousFlow task supports the D8 and multiple flow direction (MFD) modeling algorithms.

  • When the D8 option is specified for flowDirectionType, flow can take a single direction, which is toward the steepest drop. The steepest drop is calculated by taking the difference in z-value divided by the path length between cell centers (1 for cardinal cells and the square root of 2 for diagonal cells) (Jenson and Domingue, 1988). The output raster takes only integer values from 1 to 255. The values from the center of each direction are specified in the following diagram:

    Flow Direction codes

    If a cell has the same change in z-value in multiple directions, the D8 flow direction is undefined. In this case, the value for such cell in the output flow direction raster will be the sum of the possible directions.
  • When the MFD option is specified for flowDirectionType, flow is partitioned across all downslope neighbors. Flow partition across neighboring cells (as a fraction) is estimated as a function of maximum slope gradient, which considers local terrain conditions (Qin et al., 2007). The optional output flow direction raster takes only integer values showing the predominant flow direction (toward the cell that receives the largest fraction of flow according to the partition scheme) for ease of interpretation. However, the output flow accumulation raster reflects the flow partition scheme.

Response

When you submit a request, the task assigns a unique job ID for the transaction.

{
  "jobId": "<unique job identifier>",
  "jobStatus": "<job status>"
}

After the initial request is submitted, you can use the jobId to periodically check the status of the job and messages as described in Checking job status. Once the job has successfully completed, you use the jobId to retrieve the results. To track the status, you can make a request of the following form:

https://<raster analysis tools url>/DeriveContinuousFlow/jobs/<jobId>

When the status of the job request is esriJobSucceeded, you can access the results of the analysis by making a request of the following form:

https://<raster analysis tools url>/DeriveContinuousFlow/jobs/<jobId>/results/<output parameter>

Example usage

Below is a sample request URL for DeriveContinuousFlow.

https://services.myserver.com/arcgis/rest/services/System/RasterAnalysisTools/GPServer/DeriveContinuousFlow/submitJob

JSON Response example

The response returns the outputFlowAccumulationRaster and outputFlowDirectionRaster output parameters, which have properties for parameter name, data type, and value. The content of value is the output raster dataset itemId and the image service URL.

{
  "paramName": "outputFlowAccumulationRaster",
  "dataType": "GPString",
  "value": {
    "itemId": "f121390b85ef419790479fc75b493efd",
    "url": "https://<server name>/arcgis/rest/services/Hosted/<service name>/ImageServer"
  }
}

References

  • Jenson, S. K., and Domingue, J. O. 1988. "Extracting Topographic Structure from Digital Elevation Data for Geographic Information System Analysis." Photogrammetric Engineering and Remote Sensing 54 (11): 1593–1600.

  • Qin, C., Zhu, A. X., Pei, T., Li, B., Zhou, C., & Yang, L. 2007. "An adaptive approach to selecting a flow partition exponent for a multiple flow direction algorithm." International Journal of Geographical Information Science 21(4): 443-458.

Related topics