capturegraph.scheduling.forecast.location
#
Location Forecast - Geographic Coverage#
Forecasts the probability of capturing a location based on geographic coverage.
locations_area(bounds, resolution_meters=1.0)
#
Generate a grid of locations within the given polygon bounds.
Creates a regular grid of points at the specified resolution, returning only those points that fall inside the polygon defined by bounds.
Handles antimeridian (International Date Line) crossings by normalizing longitude coordinates before grid generation, then converting back to standard [-180, 180] range for output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bounds
|
List[Location]
|
List of locations defining the polygon vertices. Must have at least 3 vertices. Vertices should be in order (clockwise or counter-clockwise) to define a valid polygon. |
required |
resolution_meters
|
float
|
Spacing between grid points in meters. Smaller values produce more points but take longer to compute. |
1.0
|
Returns:
| Type | Description |
|---|---|
List[Location]
|
List of locations inside the polygon. Each location has longitude |
List[Location]
|
in [-180, 180] and latitude in [-90, 90]. Altitude is not set. |
List[Location]
|
May return empty list if the polygon is too small relative to |
List[Location]
|
the resolution. |
Note
Grid generation uses a simple lat/lon mesh, which introduces distortion at high latitudes where longitude degrees are shorter. The resolution is respected at the center latitude of the bounds.
Source code in capturegraph-lib/capturegraph/scheduling/forecast/location.py
locations_perimeter(bounds, resolution_meters=1.0)
#
Generate evenly-spaced locations along the perimeter of a polygon.
Interpolates points along each edge of the polygon at the specified resolution. The polygon is automatically closed (last vertex connects back to the first).
Handles antimeridian (International Date Line) crossings by normalizing longitude coordinates during interpolation, then converting back to standard [-180, 180] range for output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bounds
|
List[Location]
|
List of locations defining the polygon vertices. Must have at least 3 vertices. Vertices should be in order (clockwise or counter-clockwise). |
required |
resolution_meters
|
float
|
Target spacing between points in meters. Actual spacing may vary slightly to ensure each vertex is included. |
1.0
|
Returns:
| Type | Description |
|---|---|
List[Location]
|
List of locations along the polygon edges, in order starting from |
List[Location]
|
the first vertex. Each edge includes its starting vertex but not |
List[Location]
|
its ending vertex (to avoid duplicates). Longitudes are normalized |
List[Location]
|
to [-180, 180]. Altitude is not set. |
Note
Uses linear interpolation in lat/lon space, which is a reasonable approximation for short edges but may deviate from true geodesics over long distances.