Skip To Content

Find Dwell Locations

Description

FindDwellLocations

The Find Dwell Locations task works with time-enabled points of type instant to find where points dwell within a specific distance and duration.

Dwell locations are determined using time (timeTolerance) and distance (distanceTolerance) values. First, the tool assigns features to a track using a unique identifier. Track order is determined by the time of features. Next, the distance between the first observation in a track and the next is calculated. Features are considered to be part of a dwell if two temporally consecutive points stay within the given distance for at least the given duration. When two features are found to be part of a dwell, the first feature in the dwell is used as a reference point, and the tool finds consecutive features that are within the specified distance of the reference point in the dwell. Once all features within the specified distance are found, the tool collects the dwell features and calculates their mean center. Features before and after the current dwell are added to the dwell if they are within the given distance of the dwell location's mean center. This process continues until the end of the track.

For example, ecologists and conservation workers can use the Find Dwell Locations tool to improve the safety of elk during migratory seasons. Use the results to implement or improve protected areas in locations where the animals are spending the most time.

For another example, let's say you work with the Department of Transportation and you want to improve traffic congestion on highways near exits. Using the Find Dwell Locations tool, you can isolate areas experiencing congestion by identifying vehicle tracks that stay within a certain distance for a certain amount of time.

Request parameters

ParameterDetails
inputLayer

(Required)

The time-enabled point features from which dwell locations will be found.

Syntax: As described in Feature input, this parameter can be one of the following:

  • A URL to a feature service layer with an optional filter to select specific features
  • A URL to a big data catalog service layer with an optional filter to select specific features
  • A feature collection

REST examples:

//REST web example
{"url": "https://myportal.domain.com/server/rest/services/Hosted/hurricaneTrack/FeatureServer/0", "filter": "Month = 'September'"}

//REST scripting example
"inputLayer" : {"url": "https://myportal.domain.com/server/rest/services/Hosted/hurricaneTrack/FeatureServer/0", "filter": "Month = 'September'"}

trackFields

(Required)

The fields used to identify distinct tracks. There can be multiple trackFields.

REST examples:

//REST web example
Hurricane Name

//REST scripting Example
"trackFields": "BoatName, ConvoyID"

distanceMethod

(Required)

The method used to calculate distances between points. There are two methods from which to choose: Planar and Geodesic. The Planar method joins points using a planar method and will not cross the international date line. This method is appropriate for local analysis on projected data. This is the default. The Geodesic method joins points geodesically and will allow tracks to cross the international date line. This method is appropriate for large areas and geographic coordinate systems.

REST Examples

//REST web example
Geodesic

//REST scripting example
"distanceMethod": "Planar"
distanceTolerance

(Required)

The dwell distance tolerance is the maximum distance between points to be considered in a single dwell location.

Dwell locations are determined using distance and time (timeTolerance).

REST Examples

//REST web example
12

//REST scripting example
"distanceTolerance": 5.5
distanceToleranceUnit

(Required)

The unit of the distanceTolerance.

REST Examples

//REST web example
Kilometers

//REST scripting example
"distanceToleranceUnit": "NauticalMiles"
timeTolerance

(Required)

The dwell time tolerance is the minimum time duration of a dwell to be considered in a single dwell location.

Dwell locations are determined using distance (distanceTolerance) and time.

REST Examples

//REST web example
7

//REST scripting example
"timeTolerance": 12
timeToleranceUnit

(Required)

The unit of the timeTolerance.

REST Examples

//REST web example
Days

//REST scripting example
"timeToleranceUnit": "Hours"
summaryFields

(Optional)

A list of field names and statistical summary types you want to calculate. Note that the count of points in a dwell is always returned.

By default, all statistics are returned if the outputType specified is DwellMeanCenters (this is the default) or DwellConvexHulls.

Only the count is returned if the outputType specified is DwellFeatures or AllFeatures.

onStatisticField specifies the name of the fields in the target layer. statisticType is one of the following:

  • Count—For numeric fields, this totals the number of values for all the points in each dwell. For string fields, this totals the number of strings for all the points in each dwell.
  • Sum—Adds the total value of all the points in each dwell. This is for numeric fields.
  • Mean—Calculates the average of all the points in each dwell. This is for numeric fields.
  • Max—Calculates the largest value of all the points in each dwell. This is for numeric fields.
  • Range—Finds the difference between the Min and Max values. This is for numeric fields.
  • Stddev—Finds the standard deviation of all the points in each dwell. This is for numeric fields.
  • Var—Finds the variance of all the points in each dwell. This is for numeric fields.
  • Any—Returns a sample string of a point in each dwell. This is for string and numeric fields.
  • First—Returns the first value of a specified field in the summarized track. This is for string and numeric fields. This parameters was introduced at ArcGIS Enterprise 10.8.1.
  • Last—Returns the last value of a specified field in the summarized track. This is for string and numeric fields. This parameters was introduced at ArcGIS Enterprise 10.8.1.

REST Examples

//REST web examples
[{"statisticType": "Mean", "onStatisticField": "Annual_Sales"},{"statisticType": "Sum", "onStatisticField": "Annual_Sales"}]

//REST scripting example
"summaryFields": ["statisticType": "Mean", "onStatisticField": "Annual_Sales"},{"statisticType": "Sum", "onStatisticField": "Annual_Sales"}]

//Only return Count
"summaryFields": []
outputType

(Optional)

Determines which features are returned and the format. Four types are available:

  • DwellMeanCenters—A point representing the centroid of each discovered dwell location. This is the default.
  • DwellConvexHulls—Polygons representing the convex hull of each dwell group.
  • DwellFeatures—All of the input point features determined to belong to a dwell are returned.
  • AllFeatures—All of the input point features are returned.

REST Examples

//REST web example
DwellFeatures

//REST scripting example
"outputType": "DwellConvexHulls"
timeBoundarySplit

(Optional)

A time boundary allows you to analyze values within a defined time span. For example, if you use a time boundary of 1 day, starting on January 1, 1980, tracks will be analyzed 1 day at a time. The time boundary parameter was introduced in ArcGIS Enterprise 10.8.1.

The timeBoundarySplit parameter defines the scale of the time boundary. In the case above, this would be 1. See the portal documentation for this tool to learn more.

REST scripting example: "timeBoundarySplit" : 1

REST web example: 2

REST Examples

//REST web example
1

//REST scripting example
"timeBoundarySplit": 2
timeBoundarySplitUnit

(Required if timeBoundarySplit is specified)

The unit applied to the time boundary. timeBoundarySplitUnit is required if a timeBoundarySplit is provided.

Values: Milliseconds | Seconds | Minutes | Hours | Days | Weeks| Months | Years

REST Examples

//REST web example
Weeks

//REST scripting example
"timeBoundarySplitUnit": "Days"
timeBoundaryReference

(Optional)

A date that specifies the reference time to align the time boundary to, represented in milliseconds from epoch. The default is January 1, 1970, at 12:00 a.m. (epoch time stamp 0). This option is only available if the timeBoundarySplit and timeBoundarySplitUnit are set.

REST Examples

//REST web example
9466835800000

//REST scripting example
"timeBoundaryReference": 946684800000
outputName

(Required)

The task will create a feature service of the results. You define the name of the service.

REST examples:

//REST web example
myOutput

//REST scripting example
"outputName": "myOutput"

context

(Optional)

The context parameter contains additional settings that affect task execution. For this task, there are four settings:

  • Extent (extent)—A bounding box that defines the analysis area. Only those features that intersect the bounding box will be analyzed.
  • Processing spatial reference (processSR)—The features will be projected into this coordinate system for analysis.
  • Output spatial reference (outSR)—The features will be projected into this coordinate system after the analysis to be saved. The output spatial reference for the spatiotemporal big data store is always WGS84.
  • Data store (dataStore)—Results will be saved to the specified data store. The default is the spatiotemporal big data store.

Syntax:
{
"extent" : {extent},
"processSR" : {spatial reference},
"outSR" : {spatial reference},
"dataStore":{data store}
}
f

The response format. The default response format is html.

Values: html | json

Example usage

Below is a sample request URL for FindDwellLocations:

https://machine.domain.com/webadaptor/rest/services/System/GeoAnalyticsTools/GPServer/FindDwellLocations/submitJob?inputLayer={"url":"https://webadaptor.domain.com/server/rest/services/Hurricane/hurricaneTrack/0"}&trackFields=Hurricane Name&distanceMethod=Geodesic&distanceTolerance=5.5&distanceToleranceUnit=Miles&timeTolerance=1&timeToleranceUnit=Weeks&outputType=DwellMeanCenters&outputName=myOutput&context={"extent":{"xmin":-122.68,"ymin":45.53,"xmax":-122.45,"ymax":45.6,"spatialReference":{"wkid":4326}}}&f=json

Response

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

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

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

https://<analysis url>/FindDwellLocations/jobs/<jobId>

Access results

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://<analysis-url>/FindDwellLocations/jobs/<jobId>/results/output?token=<your token>&f=json

ResponseDescription
output

The geometry of the output features will differ depending on the outputType specified.

In addition to summaryStatistics, the following fields will be returned:

  • DwellID—This is a unique ID for each dwell location.
  • DwellDuration—The total duration (in milliseconds) between the start and endpoints in a dwell location.
  • MeanX—The x-coordinate of the center of the dwell points.
  • MeanY—The y-coordinate of the center of the dwell points.
  • MeanDistance—The average distance between two temporally consecutive points within a dwell.
  • Count—The number of points included in the dwell group.
  • instant_datetime—The time the dwell feature occurred. This will only be returned if the output type is AllFeatures or DwellFeatures with time type instant.
  • start_time—The time the object began dwelling. This will only be returned if the output type is DwellConvexHulls or DwellMeanCenters.
  • end_time—The time the object stopped dwelling. This will only be returned if the output type is DwellConvexHulls or DwellMeanCenters.

Note that the fields specified as trackFields are always returned.

{"url": "https://<analysis-url>/FindDwellLocations/jobs/<jobId>/results/output"}

The result has properties for parameter name, data type, and value. The contents of value depend on the outputName parameter provided in the initial request. The value contains the URL of the feature service layer.

{
"paramName":"output", 
"dataType":"GPRecordSet",
"value":{"url":"<hosted featureservice layer url>"}
}

See Feature output for more information about how the result layer is accessed.