Filter Points in Polygons
When your map contains several layers with multiple geometries, the Filter points in polygons analysis is a simple method of viewing points that fall within a polygon, without having to apply any other aggregation option.
If you are interested in choosing the aggregation method for transforming geometries into polygons, use the Group points into polygons analysis instead.
This analysis performs a spatial intersection on the polygon layer. The filtered results display only the rows that intersect with the target layer, as points.
For this guide, apply the Filter points in polygons analysis to view customer locations within the areas of influence, using the provided Sales Territories (Portland) Demo map.
Visualize Boundaries Around Groups of Customers
Create the map used for identifying sales territories around groups of customers in the Portland, Oregon area.
Import the template .carto file packaged from “Download resources” of this guide and create the map.
Click on “Download resources” from this guide to download the zip file to your local machine. Extract the zip file to view the .carto file(s) used for this guide.
Builder opens with Customer Locations as the first map layer, Centroids as the second map layer, and Areas of Influence as the third map layer.
If this map looks familiar, this is an enhanced version of the map created in the Calculate Clusters of Points guide, which calculated clusters of points to determine store locations.
The Areas of Influence layer displays the boundaries around the identified customer locations, which appears as polygon data. We will use this layer to filter points of customer locations within the area of influence.
Switch to the Data View of the map layer to visualize how the areas of influence appears as polygon data.
The Data View and Map View appear as icons on your map visualization when a map layer is selected. Click to switch between viewing your connected dataset as a table, or show the map view of your data.
Filter Customer Locations within the Area of Influence
Apply the Filter points in polygons analysis as the next chain in the workflow for the Areas of Influence layer.
From the LAYERS pane, click the Areas of Influence layer.
Click the ANALYSIS tab.
+from Your worflow, to add a second analysis to the chain.
Select Filter points in polygons as the analysis.
Filter points in polygons should only be applied to a map layer containing polygon geometries.
For the FILTERING LAYER, select the
A1 Clustersnode of data.
A1 Clustersis the result of the calculated clusters of points analysis that was applied to the original source of data (Customer Locations). View the Understanding Map Layers guide for more details about how to work with map layers in Builder.
The result transforms the polygon areas of interest into points, around the group of customers.
Switch to the Data View of the map layer to see how your polygon data was changed.
Did you like this guide?
We would love to hear from you! Was it easy to understand? Do you need more information? Let us know.