- URL:https://<geoanalytics-url>/GroupByProximity
- Version Introduced:10.9.1
Description
The GroupByProximity tool groups features that are within spatial or spatiotemporal proximity of each other.
The following are examples:
- Which roads are connected?
- Where do I have gaps in my data?
- Which GPS points are within 1 mile of each other within 10 minutes?
Note:
Sliver features may be excluded based on the tolerance of the processing spatial reference.
The output result is a copy of the input with a new field named group_id. The group_id field represents the grouping of features. Features with the same group_id value are in the same group. The group numbers represent membership in a particular group and don't imply value. The group numbers may not be sequential or the same number in repeat use of the tool.
Request parameters
Parameter | Description |
---|---|
inputLayer (Required) | The point, line, or polygon features that will be grouped. Syntax: As described in Feature input, this parameter can be one of the following:
REST examples
|
spatialRelationship (Required) | The type of relationship to group by. For more information on the values for this parameter, see the Spatial relationships section below. Values: Intersects | Touches | NearGeodesic | NearPlanar REST examples
|
spatialNearDistance (Required if spatialRelationship is NearGeodesic or NearPlanar | A double value used for the search distance to determine if features are near one another. This is only applied if NearGeodesic or NearPlanar is the selected spatialRelationship. You can enter a single distance value. The units of the distance values are supplied by the spatialNearDistanceUnit parameter. Analysis using a Near spatial relationship requires that the targetLayer or processing extent (processSR) have a projected coordinate system. REST examples
|
spatialNearDistanceUnit (Required if spatialRelationship is NearPlanar or NearGeodesic) | The linear unit to be used with the distance value specified in spatialNearDistance. The default value is Meters. Values: Meters | Kilometers | Feet | FeetInt | FeetUS | Miles | MilesInt | MilesUS | NauticalMiles | NauticalMilesInt | NauticalMilesUS | Yards | YardsInt | YardsUS REST examples
|
temporalRelationship (Optional) | The type of temporal relationship to group by. For more information on the values for this parameter, see the Temporal relationships section below. Values: Intersects | Near REST examples
|
temporalNearDistance (Required if temporalRelationship is Near | A double value used for the temporal search distance to determine if features are near one another. This is only applied if Near is the selected temporalRelationship parameter. You can enter a single distance value. The units of the distance values are supplied by the temporalNearDistanceUnit parameter. REST examples
|
temporalNearDistanceUnit (Required if temporalRelationship is Near) | The temporal unit to be used with the distance value specified in temporalNearDistance. Values: Milliseconds | Seconds | Minutes | Hours | Days | Weeks| Months | Years REST examples
|
attributeRelationship (Optional) | Introduced at ArcGIS Enterprise 11.0. An attribute relationship to group features by. The attribute expression is a symmetric operation. The tool takes an input layer that's compared against itself to find groups. Because of this, the input layer is denoted as both a and b, and all expressions should include both a and b. REST examples
|
outputName (Required) | The task will create a feature service of the results. You define the name of the service. REST examples
|
context (Optional) | The context parameter contains additional settings that affect task execution. For this task, there are four settings:
|
f | The response format. The default response format is html. Values: html | json |
Spatial relationships
The tables below describe the overlay relationships supported by the spatialRelationship parameter.
Spatial Relationship | Description |
---|---|
Intersects | Computes a geometric intersection of the input layers. Features or portions of features that overlap are grouped. This is the default. Intersects supports the following geometries as inputs:
|
Touches | A feature touches another feature if they have an intersecting vertex, but the features do not overlap. Touches supports the following geometries as inputs:
|
NearPlanar | Conceptually, these operators buffer the features using the specified distance and return all the features that intersect the join features with the buffer applied. The distance calculation uses a planar distance. NearPlanar supports the following geometries as inputs:
|
NearGeodesic | Conceptually, these operators buffer the features using the specified distance and return all the features that intersect the join features with the buffer applied. The distance calculation uses a geodesic distance. NearGeodesic supports the following geometries as inputs:
|
Temporal relationships
The table below describes the temporal relationships supported by the temporalRelationship parameter.
Temporal relationship | Description |
---|---|
Intersects | When any part of a feature's time overlaps another. Intersects supports the following time types as inputs:
|
Near | A feature is near another if the time is within a given temporal distance of the other feature.
|
Example usage
The following is a sample request URL for GroupByProximity:
https://machine.domain.com/webadaptor/rest/services/System/GeoAnalyticsTools/GPServer/GroupByProximity/submitJob?&inputLayer={"url":"https://webadaptor.domain.com/server/rest/services/Hurricane/hurricaneTrack/0"}&spatialRelationship=Intersects&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.
{
"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>/GroupByProximity/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>/GroupByProximity/jobs/<jobId>/results/output?token=<your token>&f=json
Response | Description |
---|---|
output | The features that are the result of the grouping with a new field called group_id that represents the grouping of features. The type of feature (point, line, or polygon) depends on the input layers.
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. See Feature output for more information about how the result layer is accessed. |