What is an overlay analysis?
An overlay analysis is the process of combining two or more feature datasets using either intersect, union, or erase methods. To execute the analysis, use the spatial analysis service and the Overlay
operation.
The overlay methods you can use depends on whether the input and overlay feature layers are points, polylines, or polygons.
When using the Erase overlay method, the input features must be of the same or lesser order feature type of the overlay layer. The following erase options are supported:
- A point feature can be erased by point, line, or area features.
- A line feature can be erased by line or area features.
- An area feature can be erased by area features.
The table below outlines each overlay method:
Overlay method | Input features | Overlay features | Description |
---|---|---|---|
Points, Polylines, or Polygons | Points, Polylines, or Polygons | The input features (or portions of features) that overlap with the overlay features are kept. | |
Polygons | Polygons | The input and overlay areas are combined. | |
Points | Points, Polylines, or Polygons | The input features (or portions of features) that do not overlap with the areas in the overlay layer are erased. | |
Polylines | Polylines, or Polygons | ||
Polygons | Polygons |
The type of result features will depend on the overlay method and inputs. All of the attributes from the input and overlay feature data will be carried over to the result feature data.
Real-world examples of this analysis include the following:
- Determining which parcels are within the 100-year floodplain.
- Finding what types of roads are within a county.
- Locating the wells that are within an abandoned military base.
How to perform an overlay analysis
The general steps to performing an overlay analysis are as follows:
- Review the parameters for the
Overlay
operation.Layers - Send a request to get the spatial analysis service URL.
- Execute a job request with the following URL and parameters:
- URL:
https
:// <YOUR _ANALYSIS _SERVICE >/arcgis/rest/services/tasks/ GP Server/ Overlay Layers/submit Job - Parameters:
input
: Your hosted featurelayer dataset or feature collection.Layer overlay
: The features that will be overlaid with theLayer input
parameter features.Layer overlay
: The type of overlay to be performed.Type output
: The name of the resulting feature layer.Name
- URL:
- Check the status.
- Get the output layer results.
To see examples using ArcGIS API for Python, ArcGIS REST JS, and the ArcGIS REST API, go to Examples below.
URL request
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/OverlayLayers/submitJob?<parameters>
Required parameters
Name | Description | Examples |
---|---|---|
f | The format of the data returned | f=json f=pjson |
token | An OAuth 2.0 access token. | token= |
input | The point, line, or polygon features that will be overlayed with the overlay parameter. | {"url" |
overlay | The features that will be overlaid with the inputLayer parameter features. | {"url" |
Key parameters
Name | Description | Examples |
---|---|---|
overlay | The type of overlay to be performed. [Intersect, Union, Erase] | "overlay |
output | The type of intersection to be found. This parameter is only valid when the overlayType parameter value is Intersect . [Input,Line,Point] | "output |
output | A string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON). | {"service |
Example
Overlay parks with bike paths
This example uses the Overlay
operation to find areas of parks that are within 500 feet of bike routes.
In the analysis, the input
value is the Park polygons hosted feature layer. The overlay
value is the 500 foot Buffer of bike routes. The overlay
value uses the default intersect
method.
To learn how to generate buffers, go to Create buffers.
APIs
input_layer = "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Park_Polygons/FeatureServer/0"
overlay_layer = "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Bike_routes_500_ft_buffer/FeatureServer/0"
results = overlay_layers(
input_layer=input_layer,
overlay_layer=overlay_layer,
overlay_type="intersect",
output_type="Input",
# Outputs results as a new hosted feature layer
output_name="Overlay layers results",
)
result_features = results.layers[0].query()
print(f"overlayer layer result item created {results.itemid}")
Service requests
Request
POST arcgis.com/sharing/rest/portals/self HTTP/1.1
Content-Type: application/x-www-form-urlencoded
&f=json
&token=<ACCESS_TOKEN>
Response (JSON)
{
"helperServices": {
// Other parameters
"analysis": {
"url": "https://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer"
},
"geoenrichment": {
"url": "https://geoenrich.arcgis.com/arcgis/rest/services/World/GeoenrichmentServer"
}
}
}