location
location
#
Geographic separation between two locations.
Measures the geographic distance between two locations using the Haversine formula. Used to ensure captures are distributed across different locations.
LocationDistanceFunction
#
Bases: BatchedDistanceFunction[Location]
Haversine great-circle distance between locations, normalized by sigma_m.
Source code in capturegraph-lib/capturegraph/scheduling/distance/location.py
__call__(a, b)
#
Haversine great-circle distance between two locations, normalized.
__init__(sigma_m=50.0)
#
extract(items)
#
Extract longitude/latitude (in radians) as a two-column feature array.
Source code in capturegraph-lib/capturegraph/scheduling/distance/location.py
pairwise(features_a, features_b)
#
Compute pairwise Haversine distances from extracted location features.
Source code in capturegraph-lib/capturegraph/scheduling/distance/location.py
location(sigma_m=50.0)
#
Create a distance function based on geographic separation.
Uses the Haversine formula to compute great-circle distance between locations on Earth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma_m
|
float
|
Normalization factor in meters. The returned distance is
|
50.0
|
Returns:
| Type | Description |
|---|---|
LocationDistanceFunction
|
A distance function with batch support: |
Source code in capturegraph-lib/capturegraph/scheduling/distance/location.py
location_distance_km(loc_a, loc_b)
#
Compute great-circle distance using the Haversine formula.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loc_a
|
Location
|
First location with longitude and latitude attributes. |
required |
loc_b
|
Location
|
Second location with longitude and latitude attributes. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Distance in kilometers. |