Filter Points in Polygons

Analysis Guides

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.

  1. 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.

    Default map

    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.

  2. 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.

Data View of polygon 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.

  1. From the LAYERS pane, click the Areas of Influence layer.

  2. Click the ANALYSIS tab.

  3. Click + from Your worflow, to add a second analysis to the chain.

    Add analysis to workflow

  4. Select Filter points in polygons as the analysis.

    Filter points in polygons should only be applied to a map layer containing polygon geometries.
  5. For the FILTERING LAYER, select the A1 Clusters node of data.

    Define filters

    A1 Clusters is 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.

  6. Click APPLY.

    The result transforms the polygon areas of interest into points, around the group of customers.

    Filtered points within the polygon result

  7. Switch to the Data View of the map layer to see how your polygon data was changed.

Transformed polygon data