location
location
#
Candidate capture places: the points a survey polygon could be captured from.
The polygon's longitudes are first made continuous across the antimeridian,
the polygon is sampled — a grid inside it (locations_area) or a walk along
its edges (locations_perimeter) — and the samples wrap back to [-180, 180].
locations_area(bounds, resolution_meters=1.0)
#
Generate a grid of locations within the given polygon bounds.
The grid is a plain latitude/longitude mesh, so it distorts at high latitudes where longitude degrees are shorter; the resolution holds at the centre latitude of the bounds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bounds
|
Array[Location]
|
The polygon's vertices, at least three, in winding order (either direction). |
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 |
|---|---|
Array[Location]
|
The grid points inside the polygon, longitudes in [-180, 180] and no |
Array[Location]
|
altitude — empty when the polygon is small relative to the resolution. |
Source code in capturegraph-recipes/capturegraph_recipes/scheduling/forecast/location.py
locations_perimeter(bounds, resolution_meters=1.0)
#
Generate evenly-spaced locations along the perimeter of a polygon.
Each edge is interpolated linearly in latitude/longitude — close to the geodesic for short edges — and the polygon is closed from the last vertex back to the first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bounds
|
Array[Location]
|
The polygon's vertices, at least three, in winding order (either direction). |
required |
resolution_meters
|
float
|
Target spacing between points in meters. Actual spacing varies slightly so every vertex is included. |
1.0
|
Returns:
| Type | Description |
|---|---|
Array[Location]
|
The points along the edges in order from the first vertex, each edge |
Array[Location]
|
contributing its start vertex but not its end. Longitudes are in |
Array[Location]
|
[-180, 180] and no altitude is set. |