Spatial Filter can be used to create a result dataset that contains a copy of the features on your map that meet a series of criteria based on a spatial query.
Example
A city's police department is conducting an analysis to determine if there is a relationship between violent crimes and unemployment rates. An expanded summer job program will be implemented for high schools in areas where there is high violent crime and high unemployment. Spatial Filter can be used to copy high schools within the remediation areas.
Use Spatial Filter
Spatial Filter can be run on maps with two layers (points, lines, or areas).
Complete the following steps to run Spatial Filter:
- If necessary, click the map card to activate it. A card is active when the toolbar and Action button appear.
- Click the Action button, then choose Spatial Filter.
- For Choose layer to filter, select the layer you want to filter.
- For Choose layer to filter by, select the layer with which you want to filter the first layer.
- For Choose type of filter, select the spatial relationship you want to use for the filter. See Usage notes for more information.
- Click Run.
Tip:
Spatial Filter can also be run by dragging a dataset onto the Filter by selected feature drop zone on an existing map.
Usage notes
The Choose layer to filter parameter is the input point, line, or area layer that you want to filter. The result dataset will be a subset of this layer.
The Choose layer to filter by parameter is the input point, line, or area layer that will be used to filter the first layer.
Tip:
You can use selected features in Spatial Filter. For example, if you have a dataset of store locations across the United States but you only want to analyze stores in California, you can select California in your layer of US States, drag the selected feature to your map of store locations, and drop the selected feature in the Filter by selected feature drop zone.
The Choose type of filter parameter is used to specify the relationship between the two input datasets. The following filter types are available in Insights:
Filter type | Description |
---|---|
Intersects | If a feature in the first layer intersects a feature in the second layer, the feature in the first layer is included in the output. |
Doesn't Intersect | If a feature in the first layer intersects a feature in the second layer, the feature in the first layer is excluded from the output. |
Contains | If a feature in the first layer contains a feature in the second layer, the feature in the first layer is included in the output. |
Doesn't Contain | If a feature in the first layer contains a feature in the second layer, the feature in the first layer is excluded from the output. |
Limitations
When you perform spatial aggregation or spatial filtering on data from the same database connection, you must ensure that all the data is stored in the same spatial reference system. For datasets from Microsoft SQL Server, the data must also have the same data type (geography or geometry).
SAP HANA does not support ST_Contains for geographic ("round-earth") coordinate systems. Spatial filtering using the Contains and Doesn't Contain filter types will fail for SAP HANA datasets with a geographic coordinate system.