Module sampling

Module sampling 

Source
Expand description

The sampled-dilation membership rule.

Expanded coverage is not stored as geometry. A region’s effective membership is defined as: a position belongs to a region if any point of a fixed sample pattern — the position itself, six points at half the region’s expansion distance, and twelve at the full distance — lands inside the region’s core. The pattern is the semantics, not an approximation of something else, which is what lets every implementation agree exactly: each computes the same nineteen spherical destinations and runs the same integer point-in-polygon test.

This mirrors tools/regiondb-build/src/regiondb_build/sampling.py operation for operation.

Constants§

EARTH_RADIUS_M
Mean Earth radius, matching the suggested-default tie-break.
FULL_RING_BEARINGS
Bearings of the full-distance ring, degrees clockwise from north.
HALF_RING_BEARINGS
Bearings of the half-distance ring.

Functions§

destination
Spherical direct problem: where distance_m at bearing_deg lands.
sample_positions
Every position to test against core geometry, the position itself first.