Package-level declarations

Types

Link copied to clipboard
data class Coverage(val site: Site, val points: List<CoveragePoint>)

The result of a sweep.

Link copied to clipboard

Runs a real coverage prediction end to end and writes a PNG plus the GeoJSON the app imports.

Link copied to clipboard
class CoverageGrid(val site: Site, val width: Int, val height: Int, val north: Double, val south: Double, val east: Double, val west: Double, val dbm: DoubleArray)

Received signal strength on a regular lat/lon grid.

Link copied to clipboard

The color ramps the Site Planner's Display section offers, by the names it uses.

Link copied to clipboard
data class CoveragePoint(val latitude: Double, val longitude: Double, val rxDbm: Double)

One sampled receiver position and the signal predicted there.

Link copied to clipboard
class CoverageStyle(val palette: CoveragePalette = CoveragePalette.PLASMA, val minDbm: Double = DEFAULT_MIN_DBM, val maxDbm: Double = DEFAULT_MAX_DBM, val opacity: Double = DEFAULT_OPACITY)

How a CoverageGrid is drawn: the form's Display section.

Link copied to clipboard
fun interface ElevationSource

Elevation above mean sea level, meters. Backed by Mapterhorn tiles in the app; trivially fakeable in tests.

Link copied to clipboard
class LocalCoverage(elevation: ElevationSource, atmosphere: Atmosphere = Atmosphere())

RF coverage computed on the device from org.meshtastic:kp1812 (ITU-R P.1812) and an ElevationSource. It works offline once terrain is cached. P.1812 is a different model from the hosted planner's SPLAT! ITM, so predictions don't match it pixel for pixel.

Link copied to clipboard
class MapterhornElevation(bounds: GeoBounds? = null, store: TerrainTileStore? = null, zoom: Int = DEFAULT_ZOOM, http: HttpClient? = null, offline: List<RegionTerrain> = emptyList()) : ElevationSource, AutoCloseable

Real elevation from the same Mapterhorn terrain the map already uses for hillshade and contours.

Link copied to clipboard
class PolarCoverage(val site: Site, val radials: Int, val rings: Int, val firstKm: Double, val ringStepKm: Double, val dbm: DoubleArray)

Received power on a polar lattice centered on the site: radials bearings by rings ranges.

Link copied to clipboard
class RegionTerrain(val store: TerrainTileStore, val bounds: GeoBounds)

A downloaded map region's terrain: its tiles, and the ground it was downloaded for.

Link copied to clipboard
data class Site(val name: String, val latitude: Double, val longitude: Double, val frequencyMhz: Double, val txPowerDbm: Double, val rxSensitivityDbm: Double, val txHeightM: Double = 2.0, val rxHeightM: Double = 1.0, val txGainDbi: Double = 2.0, val rxGainDbi: Double = 0.0, val radiusKm: Double = 15.0, val clutterHeightM: Double = 1.0, val timePercent: Double = 50.0)

The transmitter and the radio configuration to model.

Functions

Link copied to clipboard
fun bearingDeg(lat1: Double, lon1: Double, lat2: Double, lon2: Double): Double

Initial great-circle bearing from one point to another, degrees.

Link copied to clipboard
fun destination(latDeg: Double, lonDeg: Double, bearingDeg: Double, distanceKm: Double): Pair<Double, Double>

Great-circle destination from a start point along bearingDeg for distanceKm.

Link copied to clipboard
suspend fun estimateCoverageGeoJson(params: SitePlannerParams, store: TerrainTileStore, dispatcher: CoroutineDispatcher, offlineTerrain: List<RegionTerrain> = emptyList()): String

Computes a Site Planner estimate on this device: Mapterhorn terrain for the coverage disc, cached under store, then the ITU-R P.1812 sweep, returned as the styled GeoJSON iso-bands a map layer takes.

Link copied to clipboard
fun haversineKm(lat1: Double, lon1: Double, lat2: Double, lon2: Double): Double

Great-circle distance between two points, km. Public: a consumer plotting a Coverage needs it.

Link copied to clipboard
fun rememberCoverageEstimate(offlineTerrain: List<RegionTerrain> = emptyList()): suspend (SitePlannerParams) -> String

estimateCoverageGeoJson bound to the coverage compute dispatcher and its coverage terrain cache, falling back to offlineTerrain when offline.

Link copied to clipboard
suspend fun LocalCoverage.sweepGrid(site: Site, resolution: Int = DEFAULT_GRID, profileStepKm: Double = DEFAULT_PROFILE_STEP_KM): CoverageGrid

Compute coverage onto a regular grid centered on site.

Link copied to clipboard
suspend fun LocalCoverage.sweepPolar(site: Site, radials: Int = DEFAULT_RADIALS, rings: Int = DEFAULT_RINGS, profileStepKm: Double = DEFAULT_PROFILE_STEP_KM, dispatcher: CoroutineDispatcher = coverageComputeDispatcher): PolarCoverage

Sweep coverage in polar form, one shared terrain profile per bearing.

Link copied to clipboard
fun CoverageGrid.toGeoJson(style: CoverageStyle = CoverageStyle(), bandCount: Int = DEFAULT_BANDS): String

The coverage as GeoJSON polygons with simplestyle-spec fills: what the map draws as a layer.

Link copied to clipboard
fun PolarCoverage.toGrid(resolution: Int = DEFAULT_GRID): CoverageGrid

Resample the polar lattice onto the regular grid the contour tracer needs.