5 min readUpdated Mar 2, 2026

Vantage Geo Distance Logic Documentation

Overview

The geoDistance logic in Vantage calculates the distance between two geographic points specified by their latitude and longitude coordinates. It employs the Haversine formula, which computes distances on the surface of a sphere, making it well-suited for geographical calculations. This logic does not depend on external APIs, ensuring its operations are self-contained and efficient.

Purpose

The main function of this logic is to enable users to derive the distance between two sets of geographic coordinates for various analytical needs, such as:

Settings

1. Latitude 1 Column (lat1Column)

2. Longitude 1 Column (lng1Column)

3. Latitude 2 Column (lat2Column)

4. Longitude 2 Column (lng2Column)

5. Output Column Name (outputColumn)

6. Unit (unit)

I/O Ports

How It Works

The geoDistance logic executes the following steps:

  1. It retrieves the configuration values provided by the user for both the latitudes and longitudes of the two points.
  2. It processes the input data, extracting the latitude and longitude values from the specified columns.
  3. Using the Haversine formula, it calculates the distance between the specified geographic points.
  4. Depending on the user's choice of units, the distance is converted accordingly (to miles if specified).
  5. The calculated distance is added to each row in the output data under the provided output column name, which defaults to 'distance'.

Data Expectations

Use Cases & Examples

Use Cases

  1. Logistics and Route Optimization: A delivery service can use the geoDistance logic to compute distances between various delivery points to optimize routes, reducing fuel costs and delivery times.

  2. Real Estate Analytics: A real estate platform can utilize this logic to calculate the distance from properties to key locations (schools, parks, shops) to provide valuable data to potential buyers.

  3. Location-Based Marketing: A marketing platform can employ this logic to target customers based on their proximity to retail stores or events, enhancing promotional strategies.

Example Configuration

Use Case: Delivery Service Route Optimization

Scenario: A delivery service needs to calculate distances from their depot to various delivery locations.

Sample Input Data:

json
[
    {"location": "Customer A", "lat1": "34.0522", "lng1": "-118.2437", "lat2": "34.0520", "lng2": "-118.2500"},
    {"location": "Customer B", "lat1": "34.0522", "lng1": "-118.2437", "lat2": "34.0600", "lng2": "-118.2400"}
]

Sample Configuration:

json
{
    "lat1Column": "lat1",
    "lng1Column": "lng1",
    "lat2Column": "lat2",
    "lng2Column": "lng2",
    "outputColumn": "distanceToCustomer",
    "unit": "km"
}

Expected Output:

json
[
    {"location": "Customer A", "lat1": "34.0522", "lng1": "-118.2437", "lat2": "34.0520", "lng2": "-118.2500", "distanceToCustomer": 1.42},
    {"location": "Customer B", "lat1": "34.0522", "lng1": "-118.2437", "lat2": "34.0600", "lng2": "-118.2400", "distanceToCustomer": 0.86}
]

AI Integrations

While the geoDistance logic currently operates independently of AI integrations, it can be beneficial in conjunction with machine learning models that predict or optimize routes based on distance metrics. By providing precise distance calculations, this logic can enhance predictive analytics and decision-making processes in various applications.

Billing Impacts

Since the geoDistance logic performs calculations without relying on external services, it does not incur any additional API usage fees. The billing would be limited to the costs associated with the data processing capabilities of the Vantage platform. However, heavier usage (processing larger datasets) may influence pricing based on the usage tier of the Vantage service plan.