HOW TO

Define a hosted feature layer view using a shape from another layer

Last Published: February 23, 2023

Summary

In Portal for ArcGIS or ArcGIS Online, the owner of a hosted feature layer view or an administrator can define the features available in the view using one of the three options: 'Add filter', 'Area of interest', or 'Fields'. In some cases, it is necessary to create a filtered view of the layer based on the shape from another layer. Although it is currently not possible to use another feature layer to define a feature layer view, this article describes a workaround to achieve a similar output.

In this article, a feature layer containing point features of school locations in a part of Oregon is filtered based on a polygon feature in the Washington county layer to display only the schools within the county. The image below shows the school point features in Oregon.

Image of school locations within the state of Oregon, U.S.

Procedure

Note:
If all the required layers are hosted within a single feature layer in Portal for ArcGIS or ArcGIS Online, proceed to Step 3. If the layers are hosted as single feature layers, follow the workflow from Step 1.
  1. In an ArcGIS Pro project, create a new map, and add the feature layer to be filtered spatially and the feature layer containing the features to define the spatial filter. In this example, the layer to be filtered is Schools, and the layer to define the spatial filter is Washington_County.
Note:
If the feature layers are hosted in Portal for ArcGIS or ArcGIS Online, download the layers to the local machine as shapefiles, and add the layers to a new, blank map in ArcGIS Pro. Refer to How To: Download publicly shared data from ArcGIS Online to the local machine as shapefiles.
The feature layers are added to ArcGIS Pro.
  1. Share the map as a web feature layer to Portal for ArcGIS or ArcGIS Online. For the Layer Type parameter, select Feature. Refer to Share a web feature layer for the workflow.
  2. In Portal for ArcGIS or ArcGIS Online, create a hosted feature layer view from the published feature layer. Refer to Create hosted feature layer views for the workflow.
    1. In the Choose layers section, ensure both layers are selected. Click Next.
Ensure both layers are selected to create the filtered view.
  1. In the Define view section, select the layer containing features to be filtered. In this example, the layer name is Schools.
  2. In the Layer definitions pane, select the Area of interest option, click the Polygon button, and trace the outline of the boundary layer. The image below shows the boundary from the layer is in black, and the drawn area of interest is in red.
Image of the drawn area of interest to create the filtered view.
  1. Optionally, click the arrow next to Layer definitions, click Back to go to the Choose layers section, and deselect the boundary layer to turn it off.
  2. To set definitions for other layers in the view, repeat Steps 3(a) through 3(c) for each layer.
  3. Click Next. In the Create view section, set all the parameters, and click Create to create the hosted feature layer view.
The image below shows the filtered view of school point features based on the boundary of the Washington county.
Image of the filtered view of the Schools layer.

Article ID: 000029329

Software:
  • ArcGIS Online
  • Portal for ArcGIS

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options