geoFilter Logic Documentation
Overview
The geoFilter logic is designed to filter rows of data based on geographic constraints, specifically a bounding box or a radius from a specified center point. This functionality is achieved using purely mathematical calculations, which eliminates the need for any external API calls. The geoFilter is especially useful in analytics scenarios that require geographical data filtering, such as locating users within a specific area or analyzing events based on geographical boundaries.
Settings
1. Latitude Column
- Input Type: String (text)
- Description: This setting specifies the column name in the input data that contains the latitude values. By providing the appropriate column name, the logic can extract latitude data for filtering.
- Default Value:
''(empty string)
2. Longitude Column
- Input Type: String (text)
- Description: This setting specifies the column name in the input data that contains the longitude values. Similar to the latitude column, it allows the logic to access the relevant data for geographical computations.
- Default Value:
''(empty string)
3. Filter Type
- Input Type: Dropdown (select)
- Description: This setting allows the user to choose the type of geographical filter to apply. The available options are:
- radius: Filters data based on a specified radius from a center point.
- bbox: Filters data based on a bounding box defined by north, south, east, and west boundaries.
- Default Value:
'radius'
4. Center Latitude
- Input Type: Numeric (number)
- Description: This setting defines the latitude of the center point from which the filtering will originate when using the radius filtering method. The center point is crucial for calculating distances.
- Default Value:
0
5. Center Longitude
- Input Type: Numeric (number)
- Description: This setting defines the longitude of the center point for the radius filtering. Like the center latitude, it is essential for determining distances to other points.
- Default Value:
0
6. Radius (km)
- Input Type: Numeric (number)
- Description: Specifies the radius, in kilometers, for the filtering operation when using the radius filter type. Rows with coordinates falling within this radius from the center will be matched.
- Default Value:
50
7. North Bound
- Input Type: Numeric (number)
- Description: Defines the northern boundary of the bounding box for filtering. Any row with a latitude greater than this value will be excluded if using the bbox filter type.
- Default Value:
90
8. South Bound
- Input Type: Numeric (number)
- Description: Specifies the southern boundary of the bounding box for filtering. Rows with latitude less than this value will be omitted under the bbox filter.
- Default Value:
-90
9. East Bound
- Input Type: Numeric (number)
- Description: Represents the eastern boundary of the bounding box. Any row with longitude greater than this value will be filtered out if using the bounding box method.
- Default Value:
180
10. West Bound
- Input Type: Numeric (number)
- Description: Defines the western boundary of the bounding box. Rows with longitude smaller than this value will be rejected under the bbox filter.
- Default Value:
-180
Input and Output Ports
Input Ports
- Data In
- ID:
data_in - Type: Data
- Description: The input data that the
geoFilterwill process.
- ID:
Output Ports
-
Matched
- ID:
data_out - Type: Data
- Description: The rows that have passed the geo-filter criteria.
- ID:
-
Rejected
- ID:
rejected - Type: Data
- Description: The rows that did not meet the filtering criteria.
- ID:
Data Expectations
- The
geoFilterexpects input data to be structured as either an array of objects or a single object. - Each object should contain the latitude and longitude values specified by the
latColumnandlngColumnsettings for the filtering to occur correctly.
Use Cases & Examples
Use Case 1: Real Estate Analysis
A real estate company wants to identify all properties within a 10 km radius of a specific landmark to focus their marketing efforts on nearby listings.
Use Case 2: Geographic Marketing Campaigns
A marketing team aims to narrow down their campaign target audience by selecting users located within a certain geographical area defined by a bounding box, e.g., targeting customers in a particular city.
Detailed Example
Use Case: Real Estate Analysis
Scenario: A company wants to filter out properties located within a 10 km radius of a city center located at latitude 37.7749 and longitude -122.4194.
Configuration:
- Latitude Column:
property_lat - Longitude Column:
property_lng - Filter Type:
radius - Center Latitude:
37.7749 - Center Longitude:
-122.4194 - Radius (km):
10
By configuring the geoFilter with the above settings, the logic will process an input dataset of properties, outputting only those within 10 kilometers from the defined center point in San Francisco.
This empowers the real estate team to target their efforts efficiently and potentially drive higher engagement with suitable clients.
Additional Information
- The
geoFilterdoes not integrate with any external AI services but offers critical functionalities for geographic data analysis. - There are no direct billing impacts associated with the usage of the
geoFilter, but the performance may depend on the volume of data being processed. Higher amounts of input data may lead to longer execution times.