A join analysis resulting in a new layer that contains an additional field for average home value within census blocks.
What is a join analysis?
A join analysis is the process of combining the attributes from one feature dataset to another based on spatial and/or attribute relationships. The join data can be a feature layer or table. To execute the analysis, use the spatial analysis service and the JoinFeatures operation.
When features are joined, you can use the attributes to calculate statistics, classify the data, show additional data in popups, or visualize the data using renderers.
Real-world examples of this analysis include the following:
Joining a table of flood data to a feature layer of county boundaries to visualize affected counties.
Joining the attributes of a land use data with zoning data to see discrepencies between zoning and use for each parcel.
Combining valve inspection records to fire hydrant locations to determine which hydrants are due for inspection.
How to perform a join analysis
Review the parameters for the JoinFeatures operation.
Send a request to get the spatial analysis service URL.
Execute a job request with the following URL and parameters:
inputLayer: The point, line, polygon, or table hosted feature layer that will have attributes from the joinLayer parameter appended to its table.
joinLayer: The point, line, polygon, or table hosted feature layer that will be joined to the targetLayer parameter.
attributeRelationship: Defines an attribute relationship used to join features. Features are matched when the field values in the join layer are equal to field values in the target layer.
outputName: A string representing the name of the hosted feature layer to reutrn with the results.
The point, line, polygon, or table layer that will have attributes from the joinLayer parameter appended to its table.
{"url": <SERVICE_URL>, "filter": <where clause>}
joinLayer
The point, line, polygon, or table layer that will be joined to the targetLayer parameter.
{"url": <SERVICE_URL>, "filter": <where clause>}
Key parameters
Name
Description
Examples
attributeRelationship
Defines an attribute relationship used to join features. Features are matched when the field values in the join layer are equal to field values in the target layer.
A string representing the type of join (JoinOneToOne or JoinOneToMany) that will be applied.
"joinType":"inner"
outputName
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).
{"serviceProperties": {"name": "<SERVICE_NAME>"}}
Code examples
Join attributes from a table
This example uses the JoinFeatures operation to visualize counties with the highest recreation acreages. A feature table of recreation area values is joined to a polygon hosted feature layer by matching the Area_Name field values present in both feature layers.
In the analysis, the targetLayer value is the North Carolina regions hosted feature layer. The joinLayer value is the North Carolina resources table. The attributes of the joinLayer are appended to the targetLayer based on the values provided in the attributeRelationship parameter.
Join analysis joining a state recreation area table to polygon regions in North Carolina.
APIs
ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
This example uses the JoinFeatures operation to join home value data to census blocks. The attributes of the points that intersect with the polygons are joined, allowing you to visualize the census blocks by the average home value (AVGVAL_CY) field.
In the analysis, the targetLayer value is the Census Blocks hosted feature layer. The joinLayer is the San Francisco housing data hosted feature layer. The spatialRelationship parameter is set to intersects.
Join analysis joining average home values from a census centroid layer to census blocks in San Francisco.
APIs
ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
Learn how to perform related analyses interactively with Map Viewer and programmatically with ArcGIS API for Python, ArcGIS REST JS, and ArcGIS REST API.