weather: on-device wx/v1 bundle from static tiles (#weather-r2)
- Commit
cd1644bbf7bc687d591e846dc1f450a408e87e33- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-13 23:30 UTC (22 days ago)
- Parents
9433d6e
What: a pure-Kotlin port of the server's weather bundle computation and decoders for the static weather objects the server will publish on Cloudflare R2, plus a parity test against server-generated fixtures. This commit adds no network path; the next one wires it in. Why: the owner is moving weather off the API to static files on R2 so server weather cost no longer grows with users (today: ~49k /wx/v1/bundle calls a day, each reading ~60 Open-Meteo chunks). The app must then compute the bundle itself, and it has to be the SAME bundle the server would send, or the switch silently changes what users see. How (domain/wx/, pure, no Android): - WxTiles: decoders for the server's `WXT1` tile (one model run's series for a ~1°×1° block of ICON cells, CAMS cells, DEM cell means, zone offset tables) and `WXG1` geo block (Terrarium point elevations + zone grid). Brotli via the org.brotli:dec the app already links, crc32 + version checked. - WxGrid: the server's cell/tile/pixel math (om::cell_index incl. its mod-2879 wrap, dem::tile_frac / cell_node), and the reference client: picks the point's cells, stitches the run tile with the finished-day history tiles, NaN-fills like the server's fetch_window. - WxMath / WxAstro / WxCompute: derive.rs, aqi.rs, astro.rs and compute.rs ported operation for operation, producing the existing WxBundle DTO (so the mapper, Room cache, widgets are untouched). Rust semantics reproduced where Kotlin differs: round half away from zero, rem_euclid, NaN-ignoring max/min, std's asinh formula, saturating casts, float Sum starting at −0.0, max_by keeping the later tie. Transcendentals use StrictMath so every device computes the same. - Tiles carry two exact shortcuts the server computes once per run: the per-hour US AQI (instead of six pollutants) and a "sunny hour" flag (instead of the two radiation series). Verified: WxParityTest runs 33 server fixtures (11 metros across both CAMS domains, DST/non-DST zones, both hemispheres, +5:30; three "now" values from tile generation to 30 h later) through the port: every bundle equals the server's /wx/v1/bundle JSON value for value. The fixtures (src/test/resources/wx, 1.4 MB) come from the server's `server wx fixtures`, which also checks its own Rust tile path against the real bundle path (57/57 identical).
Diff
weather/src/main/java/com/vayunmathur/weather/domain/wx/WxAstro.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/domain/wx/WxAstro.kt b/weather/src/main/java/com/vayunmathur/weather/domain/wx/WxAstro.ktnew file mode 100644index 0000000000..59397d6efb--- /dev/null+++ b/weather/src/main/java/com/vayunmathur/weather/domain/wx/WxAstro.kt@@ -0,0 +1,151 @@+package com.vayunmathur.weather.domain.wx++import kotlin.math.abs++/**+ * Port of the server's `weather/astro.rs` (NOAA sun, truncated lunar theory)+ * for the on-device bundle. Operation-for-operation identical to the Rust;+ * see [WxMath] for the Rust-semantics helpers.+ */+internal object WxAstro {+ private const val PI = Math.PI+ private const val SUN_ZENITH_DEG = 90.833+ private const val SYNODIC_DAYS = 29.530588853+ private const val REF_NEW_MOON_EPOCH = 947_182_440L++ private fun d2r(d: Double) = d * PI / 180.0+ private fun r2d(r: Double) = r * 180.0 / PI++ private fun julianCentury(epoch: Long): Double {+ val jd = epoch.toDouble() / 86400.0 + 2440587.5+ return (jd - 2451545.0) / 36525.0+ }++ private fun floorMod(a: Long, b: Long) = Math.floorMod(a, b)++ /** `(sunrise, sunset)` of the UTC day containing [dayEpoch], null for polar day/night. */+ @Suppress("LongMethod")+ private fun sunTransitRiseSet(dayEpoch: Long, lat: Double, lon: Double): Pair<Long, Long>? {+ val dayStart = dayEpoch - floorMod(dayEpoch, 86400)+ val t = julianCentury(dayStart + 43200)+ val l0 = WxMath.remEuclid(280.46646 + t * (36000.76983 + t * 0.0003032), 360.0)+ val m = 357.52911 + t * (35999.05029 - 0.0001537 * t)+ val mRad = d2r(m)+ val c = (1.914602 - t * (0.004817 + 0.000014 * t)) * StrictMath.sin(mRad) ++ (0.019993 - 0.000101 * t) * StrictMath.sin(2.0 * mRad) ++ 0.000289 * StrictMath.sin(3.0 * mRad)+ val trueLon = l0 + c+ val omega = 125.04 - 1934.136 * t+ val lambda = trueLon - 0.00569 - 0.00478 * StrictMath.sin(d2r(omega))+ val epsilon0 = 23.0 + (26.0 + (21.448 - t * (46.815 + t * (0.00059 - t * 0.001813))) / 60.0) / 60.0+ val epsilon = epsilon0 + 0.00256 * StrictMath.cos(d2r(omega))+ val decl = r2d(StrictMath.asin(StrictMath.sin(d2r(epsilon)) * StrictMath.sin(d2r(lambda))))+ val y = StrictMath.cos(d2r(epsilon)) * StrictMath.sin(d2r(lambda))+ val x = StrictMath.cos(d2r(lambda))+ var ra = WxMath.remEuclid(r2d(StrictMath.atan2(y, x)), 360.0)+ ra /= 15.0+ val l0Hours = l0 / 15.0+ val eot = l0Hours * 60.0 - ra * 60.0+ val solarNoonUtcMin = 720.0 - 4.0 * lon - eot+ val latRad = d2r(lat)+ val declRad = d2r(decl)+ val cosH = (StrictMath.cos(d2r(SUN_ZENITH_DEG)) - StrictMath.sin(latRad) * StrictMath.sin(declRad)) /+ (StrictMath.cos(latRad) * StrictMath.cos(declRad))+ if (cosH > 1.0 || cosH < -1.0) return null+ val hMin = r2d(StrictMath.acos(cosH)) * 4.0+ val sunrise = dayStart + WxMath.rround((solarNoonUtcMin - hMin) * 60.0).toLong()+ val sunset = dayStart + WxMath.rround((solarNoonUtcMin + hMin) * 60.0).toLong()+ return sunrise to sunset+ }++ fun polarDaylight(dayEpoch: Long, lat: Double): Long {+ val t = julianCentury(dayEpoch - floorMod(dayEpoch, 86400) + 43200)+ val l0 = WxMath.remEuclid(280.46646 + t * (36000.76983 + t * 0.0003032), 360.0)+ val m = d2r(357.52911 + t * (35999.05029 - 0.0001537 * t))+ val lambda = d2r(l0 + 1.914602 * StrictMath.sin(m))+ val decl = StrictMath.asin(StrictMath.sin(d2r(23.44)) * StrictMath.sin(lambda))+ // Rust f64::signum: ±1 by sign bit (±0.0 → ±1.0).+ val sign = if (lat.isNaN()) Double.NaN else StrictMath.copySign(1.0, lat)+ val maxAlt = 90.0 - abs(lat) + r2d(decl) * sign+ return if (maxAlt > 0.0) 86400 else 0+ }++ fun sunriseSunset(dayEpoch: Long, lat: Double, lon: Double, offsetSecs: Int): Pair<Long?, Long?> {+ val shifted = dayEpoch + offsetSecs+ val shiftedDay = shifted - floorMod(shifted, 86400)+ val r = sunTransitRiseSet(shiftedDay + 43200, lat, lon) ?: return null to null+ return r.first to r.second+ }++ fun isDay(t: Long, lat: Double, lon: Double): Boolean {+ val dayStart = t - floorMod(t, 86400)+ val today = sunTransitRiseSet(t, lat, lon)+ if (today != null && t >= today.first && t < today.second) return true+ val prev = sunTransitRiseSet(dayStart - 43200, lat, lon)+ if (prev != null && t >= prev.first && t < prev.second) return true+ return polarDaylight(t, lat) == 86400L && today == null && prev == null+ }++ fun moonPhase(epoch: Long): Double {+ val days = (epoch - REF_NEW_MOON_EPOCH).toDouble() / 86400.0+ return WxMath.remEuclid(days, SYNODIC_DAYS) / SYNODIC_DAYS+ }++ private fun moonAltitude(lat: Double, lon: Double, epoch: Long): Double {+ val d = epoch.toDouble() / 86400.0 - 10957.5+ val l0 = WxMath.remEuclid(218.316 + 13.176396 * d, 360.0)+ val mm = d2r(WxMath.remEuclid(134.963 + 13.064993 * d, 360.0))+ val ms = d2r(WxMath.remEuclid(357.529 + 0.98560028 * d, 360.0))+ val dd = d2r(WxMath.remEuclid(297.850 + 12.190749 * d, 360.0))+ val ff = d2r(WxMath.remEuclid(93.272 + 13.229350 * d, 360.0))+ val elong = l0 + 6.289 * StrictMath.sin(mm) + 1.274 * StrictMath.sin(2.0 * dd - mm) ++ 0.658 * StrictMath.sin(2.0 * dd) - 0.186 * StrictMath.sin(ms) - 0.114 * StrictMath.sin(2.0 * ff)+ val elat = 5.128 * StrictMath.sin(ff)+ val elongR = d2r(elong)+ val elatR = d2r(elat)+ val eps = d2r(23.4393 - 3.563e-7 * d)+ val ra = StrictMath.atan2(+ StrictMath.sin(elongR) * StrictMath.cos(eps) - StrictMath.tan(elatR) * StrictMath.sin(eps),+ StrictMath.cos(elongR),+ )+ val decl = StrictMath.asin(+ StrictMath.sin(elatR) * StrictMath.cos(eps) ++ StrictMath.cos(elatR) * StrictMath.sin(eps) * StrictMath.sin(elongR),+ )+ val gmst = d2r(WxMath.remEuclid(18.697374558 + 24.06570982441908 * d, 24.0) * 15.0)+ var ha = WxMath.remEuclid(gmst + d2r(lon) - ra, 2.0 * PI)+ if (ha > PI) ha -= 2.0 * PI+ val latR = d2r(lat)+ return r2d(+ StrictMath.asin(+ StrictMath.sin(latR) * StrictMath.sin(decl) ++ StrictMath.cos(latR) * StrictMath.cos(decl) * StrictMath.cos(ha),+ ),+ )+ }++ fun moonriseMoonset(dayEpoch: Long, lat: Double, lon: Double, offsetSecs: Int): Pair<Long?, Long?> {+ val shifted = dayEpoch + offsetSecs+ val start = shifted - floorMod(shifted, 86400) - offsetSecs+ val step = 600L+ var rise: Long? = null+ var set: Long? = null+ var prevT = start+ var prevA = moonAltitude(lat, lon, start)+ var t = start + step+ while (t <= start + 86400) {+ val a = moonAltitude(lat, lon, t)+ if (prevA <= 0.0 && a > 0.0 && rise == null) {+ val f = -prevA / (a - prevA)+ rise = prevT + WxMath.rround((t - prevT).toDouble() * f).toLong()+ } else if (prevA >= 0.0 && a < 0.0 && set == null) {+ val f = prevA / (prevA - a)+ set = prevT + WxMath.rround((t - prevT).toDouble() * f).toLong()+ }+ prevT = t+ prevA = a+ t += step+ }+ return rise to set+ }+}
weather/src/main/java/com/vayunmathur/weather/domain/wx/WxCompute.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/domain/wx/WxCompute.kt b/weather/src/main/java/com/vayunmathur/weather/domain/wx/WxCompute.ktnew file mode 100644index 0000000000..5ae4de989a--- /dev/null+++ b/weather/src/main/java/com/vayunmathur/weather/domain/wx/WxCompute.kt@@ -0,0 +1,298 @@+package com.vayunmathur.weather.domain.wx++import com.vayunmathur.weather.network.WxAq+import com.vayunmathur.weather.network.WxBundle+import com.vayunmathur.weather.network.WxCurrent+import com.vayunmathur.weather.network.WxDaily+import com.vayunmathur.weather.network.WxHourly+import com.vayunmathur.weather.network.WxMin15+import java.time.LocalDate+import java.util.Locale+import java.util.TreeMap++/**+ * Port of the server's `weather/compute.rs::compute_bundle`: the `wx/v1`+ * bundle from one point's model series, computed on device from a static R2+ * tile. Must stay operation-for-operation identical to the Rust (parity test+ * `WxParityTest` runs server-generated fixtures through it).+ */+internal object WxCompute {+ private const val FETCH_MARGIN = 24+ private const val N_FETCH = 337 + FETCH_MARGIN+ private const val N_OUT = 337+ private const val NO_CODE = Int.MIN_VALUE+ private const val SUNNY_SW = 1000.0++ class CurrentGap : Exception("current step unavailable (chunk read gap)")++ private fun r2(v: Double) = WxMath.round2(v)++ /** Local calendar date (yyyy-mm-dd) of [epoch] in the zone table. */+ fun localDay(z: WxTiles.Zone, epoch: Long): String {+ val d = LocalDate.ofEpochDay(Math.floorDiv(epoch + z.offsetAt(epoch), 86400L))+ return String.format(Locale.ROOT, "%04d-%02d-%02d", d.year, d.monthValue, d.dayOfMonth)+ }++ private class Steps(n: Int) {+ val temp = DoubleArray(n) { Double.NaN }+ val feels = DoubleArray(n) { Double.NaN }+ val rh = DoubleArray(n) { Double.NaN }+ val dew = DoubleArray(n) { Double.NaN }+ val code = IntArray(n) { NO_CODE }+ val pprob = IntArray(n)+ val precip = DoubleArray(n) { Double.NaN }+ val wspd = DoubleArray(n) { Double.NaN }+ val wdir = IntArray(n)+ val pres = DoubleArray(n) { Double.NaN }+ val vis = DoubleArray(n) { Double.NaN }+ val cloud = IntArray(n)+ val gust = DoubleArray(n) { Double.NaN }+ val day = IntArray(n)+ val sw = DoubleArray(n) { Double.NaN }+ }++ private fun get(m: Map<String, FloatArray>, k: String, idx: Int): Double =+ m[k]?.let { s -> if (idx < s.size) s[idx].toDouble() else Double.NaN } ?: Double.NaN++ @Suppress("CyclomaticComplexMethod", "LongMethod")+ private fun steps(lat: Double, lon: Double, hFetchLo: Long, lapse: Double, icon: Map<String, FloatArray>): Steps {+ val s = Steps(N_FETCH)+ val sunny = icon[WxGrid.SUNNY_VAR]+ for (k in 0 until N_FETCH) {+ val tRaw = get(icon, "temperature_2m", k)+ val t = if (tRaw.isFinite()) tRaw + lapse else tRaw+ val r = get(icon, "relative_humidity_2m", k)+ val p = get(icon, "precipitation", k)+ val cl = get(icon, "cloud_cover", k)+ val u = get(icon, "wind_u_component_10m", k) / 3.6+ val v = get(icon, "wind_v_component_10m", k) / 3.6+ s.temp[k] = t+ s.rh[k] = r+ s.precip[k] = p+ s.pres[k] = get(icon, "pressure_msl", k)+ s.cloud[k] = if (cl.isFinite()) WxMath.rround(cl).toInt() else 0+ s.dew[k] = WxDerive.dewPoint(t, r) ?: Double.NaN+ val spd = if (u.isFinite() && v.isFinite()) StrictMath.hypot(u, v) else Double.NaN+ s.feels[k] = WxDerive.apparentTemperature(t, r, spd) ?: Double.NaN+ val wc = get(icon, "weather_code", k)+ s.code[k] = if (wc.isFinite()) WxMath.rround(wc).toInt() else NO_CODE+ s.pprob[k] = WxDerive.precipProbability(p, cl, r) ?: 0+ WxDerive.windSpdDir(u, v)?.let { (sp, d) ->+ s.wspd[k] = sp+ s.wdir[k] = d+ }+ s.vis[k] = WxDerive.visibility(p, r) ?: Double.NaN+ s.gust[k] = get(icon, "wind_gusts_10m", k)+ s.sw[k] = if (sunny != null) {+ // Tile: exact sunny flag instead of the radiation pair.+ val f = if (k < sunny.size) sunny[k].toDouble() else Double.NaN+ when {+ f.isNaN() -> Double.NaN+ f > 0.5 -> SUNNY_SW+ else -> 0.0+ }+ } else {+ WxDerive.shortwave(get(icon, "diffuse_radiation", k), get(icon, "direct_radiation", k)) ?: Double.NaN+ }+ s.day[k] = if (WxAstro.isDay((hFetchLo + k) * 3600, lat, lon)) 1 else 0+ }+ for (a in listOf(s.temp, s.feels, s.dew, s.precip, s.wspd, s.pres, s.vis, s.gust, s.sw)) {+ for (k in a.indices) if (a[k].isFinite()) a[k] = r2(a[k])+ }+ return s+ }++ private fun codeOut(c: Int) = if (c == NO_CODE) 0 else c++ /** The bundle (all sections) for (lat, lon) at [now]; throws [CurrentGap] like the server's 502. */+ fun computeBundle(lat: Double, lon: Double, now: Long, runIso: String, s: WxPointSeries): WxBundle {+ val w = WxWindows.at(now)+ val lapse = s.elevations?.let { (point, mean) -> WxDerive.lapseCorrection(mean, point) } ?: 0.0+ val st = steps(lat, lon, w.hFetchLo, lapse, s.icon)+ var hourlyLen = N_FETCH+ val firstGap = st.temp.indexOfFirst { !it.isFinite() }+ if (firstGap >= 0) {+ hourlyLen = if ((firstGap until N_FETCH).all { !st.temp[it].isFinite() }) firstGap else 0+ }+ val nowK = maxOf(w.nowH - w.hFetchLo, 0L).toInt()+ val k = minOf(nowK, N_FETCH - 1)+ if (!st.temp[k].isFinite()) throw CurrentGap()+ val current = WxCurrent(+ time = w.nowH * 3600, temp = r2(st.temp[k]), feels = r2(st.feels[k]),+ rh = WxMath.rround(st.rh[k]).toInt(), dew = r2(st.dew[k]), code = codeOut(st.code[k]),+ windSpd = r2(st.wspd[k]), windDir = st.wdir[k], pres = r2(st.pres[k]), vis = r2(st.vis[k]),+ cloud = st.cloud[k], gust = r2(st.gust[k]), day = st.day[k],+ )+ val uv = s.cams[WxGrid.CAMS_UV_VAR]+ val hourly = if (hourlyLen > FETCH_MARGIN) hourly(w, st, hourlyLen, uv) else null+ val daily = if (hourlyLen > FETCH_MARGIN) daily(lat, lon, s.tz, now, w.hFetchLo, st, hourlyLen, uv) else null+ return WxBundle(+ v = 1,+ lat = WxMath.rround(lat * 100.0) / 100.0,+ lon = WxMath.rround(lon * 100.0) / 100.0,+ tz = s.tzName,+ tzAbbr = s.tz.abbrAt(now),+ utcOffset = s.tz.offsetAt(now),+ model = "dwd_icon",+ run = runIso,+ current = current,+ hourly = hourly,+ daily = daily,+ min15 = min15(w, s.precipM),+ aq = aq(w, s.cams, s.pollen),+ )+ }++ private fun hourly(w: WxWindows, st: Steps, hourlyLen: Int, uv: FloatArray?): WxHourly {+ val n = minOf(hourlyLen - FETCH_MARGIN, N_OUT)+ val r = FETCH_MARGIN until FETCH_MARGIN + n+ fun sl(a: DoubleArray) = r.map { a[it] }+ fun sli(a: IntArray) = r.map { a[it] }+ return WxHourly(+ start = w.hLo * 3600, step = 3600, count = n,+ temp = sl(st.temp), feels = sl(st.feels),+ rh = r.map { if (st.rh[it].isFinite()) WxMath.rround(st.rh[it]).toInt() else 0 },+ dew = sl(st.dew), code = r.map { codeOut(st.code[it]) }, pprob = sli(st.pprob), precip = sl(st.precip),+ windSpd = sl(st.wspd), windDir = sli(st.wdir), pres = sl(st.pres), vis = sl(st.vis),+ uv = List(n) { kk ->+ val v = if (uv != null && kk < uv.size) uv[kk].toDouble() else Double.NaN+ if (v.isFinite()) r2(v) else null+ },+ cloud = sli(st.cloud), gust = sl(st.gust), day = sli(st.day),+ )+ }++ private fun min15(w: WxWindows, precipM: FloatArray): WxMin15? {+ val vals = ArrayList<Double>(288)+ for (k in 0 until 72) {+ val p = if (k < precipM.size) precipM[k].toDouble() else Double.NaN+ if (!p.isFinite()) return null+ val q = r2(p / 4.0)+ repeat(4) { vals.add(q) }+ }+ return WxMin15(start = w.mLo * 3600, step = 900, count = 288, precip = vals)+ }++ private fun aq(w: WxWindows, cams: Map<String, FloatArray>, pollen: Map<String, FloatArray>): WxAq? {+ val k = maxOf(w.nowH - w.hLo, 0L).toInt()+ fun at(m: Map<String, FloatArray>, key: String): Double =+ m[key]?.let { s -> if (k < s.size) s[k].toDouble() else Double.NaN } ?: Double.NaN+ fun mean8(key: String): Double {+ val s = cams[key] ?: return Double.NaN+ val end = minOf(k, maxOf(s.size - 1, 0))+ return WxAqi.trailingMean8h(DoubleArray(s.size) { s[it].toDouble() }, end) ?: Double.NaN+ }+ val aqi = if (cams.containsKey(WxGrid.US_AQI_VAR)) {+ // Tile: the generator's per-hour AQI (same computation).+ at(cams, WxGrid.US_AQI_VAR).takeIf { !it.isNaN() }?.toInt() ?: return null+ } else {+ WxAqi.usAqi(+ at(cams, "pm2_5"), at(cams, "pm10"), mean8("ozone"),+ at(cams, "nitrogen_dioxide"), at(cams, "sulphur_dioxide"), mean8("carbon_monoxide"),+ ) ?: return null+ }+ fun opt(key: String): Double? = at(pollen, key).let { if (it.isFinite()) r2(it) else null }+ return WxAq(+ time = w.nowH * 3600, usAqi = aqi, grass = opt("grass_pollen"), birch = opt("birch_pollen"),+ olive = opt("olive_pollen"), alder = opt("alder_pollen"), ragweed = opt("ragweed_pollen"),+ mugwort = opt("mugwort_pollen"),+ )+ }++ private fun foldMax(idxs: List<Int>, f: (Int) -> Double): Double =+ idxs.map(f).filter { it.isFinite() }.fold(Double.NaN, WxMath::fmax)++ private fun foldMin(idxs: List<Int>, f: (Int) -> Double): Double =+ idxs.map(f).filter { it.isFinite() }.fold(Double.NaN, WxMath::fmin)++ /** Rust `max_by(partial_cmp → Equal on NaN)`: ties keep the LATER index. */+ private fun maxPrecipIdx(idxs: List<Int>, precip: DoubleArray): Int {+ var best = idxs[0]+ for (y in idxs.drop(1)) {+ val a = precip[best]+ val b = precip[y]+ val greater = !a.isNaN() && !b.isNaN() && a > b+ if (!greater) best = y+ }+ return best+ }++ @Suppress("LongParameterList", "LongMethod", "CyclomaticComplexMethod")+ private fun daily(+ lat: Double,+ lon: Double,+ z: WxTiles.Zone,+ now: Long,+ hLo: Long,+ st: Steps,+ len: Int,+ uv: FloatArray?,+ ): WxDaily {+ val days = TreeMap<String, MutableList<Int>>()+ for (k in 0 until len) days.getOrPut(localDay(z, (hLo + k) * 3600)) { ArrayList() }.add(k)+ val today = localDay(z, now)+ val keys = days.keys.toList()+ val todayPos = keys.indexOf(today).takeIf { it >= 0 } ?: maxOf(keys.size - 8, 0)+ val startPos = maxOf(todayPos - 7, 0)+ val sel = keys.subList(startPos, minOf(startPos + 15, keys.size))+ val code = ArrayList<Int>()+ val tmax = ArrayList<Double>()+ val tmin = ArrayList<Double>()+ val fmax = ArrayList<Double>()+ val fmin = ArrayList<Double>()+ val sunrise = ArrayList<Long>()+ val sunset = ArrayList<Long>()+ val daylight = ArrayList<Long>()+ val sunshine = ArrayList<Long>()+ val uvMax = ArrayList<Double?>()+ val pprobMax = ArrayList<Int>()+ val precipSum = ArrayList<Double>()+ val moonPhase = ArrayList<Double>()+ val moonrise = ArrayList<Long?>()+ val moonset = ArrayList<Long?>()+ for (key in sel) {+ val idxs = days.getValue(key)+ tmax.add(foldMax(idxs) { st.temp[it] })+ tmin.add(foldMin(idxs) { st.temp[it] })+ fmax.add(foldMax(idxs) { st.feels[it] })+ fmin.add(foldMin(idxs) { st.feels[it] })+ var sum = -0.0 // Rust's float Sum starts at −0.0+ for (k in idxs) if (st.precip[k].isFinite()) sum += st.precip[k]+ precipSum.add(r2(sum))+ pprobMax.add(idxs.maxOf { st.pprob[it] })+ uvMax.add(+ uv?.let { u ->+ // UV starts 24 h after the fetch window (no margin).+ val best = foldMax(idxs) { k ->+ if (k in 24 until 24 + u.size) u[k - 24].toDouble() else Double.NaN+ }+ if (best.isFinite()) r2(best) else null+ },+ )+ code.add(codeOut(st.code[maxPrecipIdx(idxs, st.precip)]))+ sunshine.add(idxs.count { st.sw[it].isFinite() && st.sw[it] > WxConsts.SUNSHINE_SW_WM2 }.toLong() * 3600)+ val anchor = (hLo + idxs[0]) * 3600+ val off = z.offsetAt(anchor)+ val (sr, ss) = WxAstro.sunriseSunset(anchor, lat, lon, off)+ if (sr != null && ss != null) {+ sunrise.add(sr)+ sunset.add(ss)+ daylight.add(ss - sr)+ } else {+ sunrise.add(0)+ sunset.add(0)+ daylight.add(WxAstro.polarDaylight(anchor, lat))+ }+ val (mr, ms) = WxAstro.moonriseMoonset(anchor, lat, lon, off)+ moonrise.add(mr)+ moonset.add(ms)+ moonPhase.add(r2(WxAstro.moonPhase(anchor + 43200)))+ }+ return WxDaily(+ start = sel.firstOrNull() ?: "", count = sel.size, code = code, tmax = tmax, tmin = tmin,+ feelsMax = fmax, feelsMin = fmin, sunrise = sunrise, sunset = sunset, daylight = daylight,+ sunshine = sunshine, uvMax = uvMax, pprobMax = pprobMax, precipSum = precipSum,+ moonPhase = moonPhase, moonrise = moonrise, moonset = moonset,+ )+ }+}
weather/src/main/java/com/vayunmathur/weather/domain/wx/WxGrid.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/domain/wx/WxGrid.kt b/weather/src/main/java/com/vayunmathur/weather/domain/wx/WxGrid.ktnew file mode 100644index 0000000000..2cb1ccf516--- /dev/null+++ b/weather/src/main/java/com/vayunmathur/weather/domain/wx/WxGrid.kt@@ -0,0 +1,199 @@+package com.vayunmathur.weather.domain.wx++/**+ * Grid math + tile → bundle inputs: the port of the server's `om::cell_index`,+ * `dem` pixel math and the reference static client+ * (`weather/export/client.rs::series_from_tile`).+ */+internal object WxGrid {+ class ModelDef(val lat0: Double, val lon0: Double, val dy: Double, val dx: Double)++ val ICON = ModelDef(-90.0, -180.0, 0.125, 0.125)+ val CAMS_GLOBAL = ModelDef(-90.0, -180.0, 0.4, 0.4)+ val CAMS_EUROPE = ModelDef(30.05, -24.95, 0.1, 0.1)++ val ICON_VARS = listOf(+ "temperature_2m", "relative_humidity_2m", "precipitation", "pressure_msl", "cloud_cover", "weather_code",+ "wind_u_component_10m", "wind_v_component_10m", "wind_gusts_10m", "diffuse_radiation", "direct_radiation",+ )+ val CAMS_AQ_VARS = listOf("pm2_5", "pm10", "ozone", "nitrogen_dioxide", "sulphur_dioxide", "carbon_monoxide")+ const val CAMS_UV_VAR = "uv_index"++ /** Tile stand-in for the radiation pair (exact sunny-hour flag). */+ const val SUNNY_VAR = "sunny"++ /** Tile stand-in for the six AQ pollutants (per-hour US AQI). */+ const val US_AQI_VAR = "us_aqi"+ private val RADIATION = setOf("diffuse_radiation", "direct_radiation")++ /** ICON variables a tile carries. */+ val TILE_ICON_VARS = ICON_VARS.filter { it !in RADIATION } + SUNNY_VAR+ val POLLEN_VARS = listOf(+ "grass_pollen", "birch_pollen", "olive_pollen", "alder_pollen", "ragweed_pollen", "mugwort_pollen",+ )++ fun hourOf(epoch: Long): Long = Math.floorDiv(epoch, 3600L)++ fun europeContains(lat: Double, lon: Double): Boolean =+ lat >= 30.05 && lat <= 71.95 && lon >= -24.95 && lon <= 44.95++ /** `om::cell_index`: lon wraps, j clamps. */+ fun cellIndex(def: ModelDef, lat: Double, lon: Double, ny: Int, nx: Int): Pair<Int, Int> {+ val wrapped = WxMath.remEuclid(lon + 180.0, 360.0) - 180.0+ val j = WxMath.rround((lat - def.lat0) / def.dy).toLong()+ var i = WxMath.rround((wrapped - def.lon0) / def.dx).toLong()+ val jj = j.coerceIn(0, ny.toLong() - 1).coerceAtLeast(0)+ if (nx > 0) i = ((i % nx) + nx) % nx+ return jj.toInt() to i.coerceAtLeast(0).toInt()+ }++ /** `dem::cell_node`: unclamped, unwrapped node of the DEM cell box. */+ fun cellNode(lat: Double, lon: Double): Pair<Long, Long> {+ val wrapped = WxMath.remEuclid(lon + 180.0, 360.0) - 180.0+ return WxMath.rround((lat - -90.0) / ICON.dy).toLong() to WxMath.rround((wrapped - -180.0) / ICON.dx).toLong()+ }++ /** `dem::tile_frac` at zoom 10. */+ fun tileFrac(lat: Double, lon: Double): Pair<Double, Double> {+ val n = 1024.0+ val fx = (lon + 180.0) / 360.0 * n+ val fy = (1.0 - WxMath.asinh(StrictMath.tan(StrictMath.toRadians(lat))) / Math.PI) / 2.0 * n+ return fx to fy+ }++ /** Rust `f64 as u32` (saturating, NaN → 0), kept in a Long. */+ private fun asU32(v: Double): Long = if (v.isNaN()) 0 else v.toLong().coerceIn(0L, 0xFFFF_FFFFL)++ class GeoKey(val x: Int, val y: Int, val b: Int, val px: Int, val py: Int)++ /** The geo block + pixel `dem::point_elev` samples; null off the z10 grid. */+ fun geoOf(lat: Double, lon: Double): GeoKey? {+ val (fx, fy) = tileFrac(lat, lon)+ val xt = asU32(StrictMath.floor(fx))+ val yt = asU32(StrictMath.floor(fy))+ if (xt >= 1024 || yt >= 1024) return null+ val px = minOf(asU32((fx - xt.toDouble()) * 256.0), 255L).toInt()+ val py = minOf(asU32((fy - yt.toDouble()) * 256.0), 255L).toInt()+ return GeoKey(xt.toInt(), yt.toInt(), (py / 64) * 4 + px / 64, px % 64, py % 64)+ }++ /** ICON tile (ty, tx) of a point. */+ fun tileOf(lat: Double, lon: Double, ny: Int, nx: Int, cells: Int): Pair<Int, Int> {+ val (j, i) = cellIndex(ICON, lat, lon, ny, nx)+ return j / cells to i / cells+ }++ class Unavailable(msg: String) : Exception(msg)++ /** History days (epoch hour / 24) a bundle at [now] needs before hour [runH0]. */+ fun histDaysNeeded(now: Long, runH0: Long): LongRange =+ Math.floorDiv(WxWindows.at(now).hFetchLo, 24L) until Math.floorDiv(runH0, 24L)++ /** Cell [c] over `[lo, hi)`: run block, earlier hours from the history days. */+ private fun stitched(run: WxTiles.VarBlock, hist: List<WxTiles.VarBlock>, c: Int, lo: Long, hi: Long): FloatArray {+ val v = run.window(c, lo, hi)+ var h = lo+ while (h < minOf(run.h0, hi)) {+ val b = hist.firstOrNull { h >= it.h0 && h < it.h0 + it.nt } ?: throw Unavailable("missing history hour $h")+ v[(h - lo).toInt()] = b.values[c * b.nt + (h - b.h0).toInt()]+ h+++ }+ return v+ }++ /**+ * Bundle inputs for (lat, lon) at [now] from the run tile, the history+ * day tiles before it and the point's geo block; throws [Unavailable]+ * when they cannot serve it.+ */+ @Suppress("LongMethod", "ThrowsCount", "CyclomaticComplexMethod", "ComplexCondition")+ fun seriesFromTile(+ t: WxTiles.Tile,+ hist: List<WxTiles.Tile>,+ g: WxTiles.GeoBlock,+ lat: Double,+ lon: Double,+ now: Long,+ ): WxPointSeries {+ val w = WxWindows.at(now)+ val icon = t.section(WxTiles.MODEL_ICON) ?: throw Unavailable("no ICON section")+ val (j, i) = cellIndex(ICON, lat, lon, icon.ny, icon.nx)+ val c = icon.cell(j, i) ?: throw Unavailable("point outside tile")+ val histIcon = hist.mapNotNull { it.section(WxTiles.MODEL_ICON) }+ if (histIcon.any { it.j0 != icon.j0 || it.i0 != icon.i0 || it.nj != icon.nj || it.ni != icon.ni }) {+ throw Unavailable("history tile of another block")+ }+ val iconM = HashMap<String, FloatArray>()+ for (v in TILE_ICON_VARS) {+ val b = icon.variable(v) ?: throw Unavailable("tile lacks $v")+ val hb = histIcon.mapNotNull { it.variable(v) }+ iconM[v] = WxDerive.applyUnitSeries(v, stitched(b, hb, c, w.hFetchLo, w.hHi))+ }+ val pb = icon.variable("precipitation") ?: throw Unavailable("tile lacks precipitation")+ val precipM = stitched(pb, histIcon.mapNotNull { it.variable("precipitation") }, c, w.mLo, w.mHi)+ val inEurope = europeContains(lat, lon)+ val def = if (inEurope) CAMS_EUROPE else CAMS_GLOBAL+ val sec = t.section(if (inEurope) WxTiles.MODEL_CAMS_EUROPE else WxTiles.MODEL_CAMS_GLOBAL)+ ?: throw Unavailable("tile lacks the CAMS section")+ val (cj, ci) = cellIndex(def, lat, lon, sec.ny, sec.nx)+ val cc = sec.cell(cj, ci) ?: throw Unavailable("CAMS cell outside tile")+ val camsNames = if (inEurope) listOf(US_AQI_VAR) else listOf(US_AQI_VAR, CAMS_UV_VAR)+ val cams = camsNames.associateWith { v ->+ val b = sec.variable(v) ?: throw Unavailable("tile lacks $v")+ WxDerive.applyUnitSeries(v, b.window(cc, w.hLo, w.hHi))+ }+ val pollen = if (!inEurope) emptyMap() else POLLEN_VARS.associateWith { v ->+ val b = sec.variable(v) ?: throw Unavailable("tile lacks $v")+ b.window(cc, w.hLo, w.hHi)+ }+ val key = geoOf(lat, lon) ?: throw Unavailable("off the DEM grid")+ if (key.x != g.x || key.y != g.y || key.b != g.b) throw Unavailable("wrong geo block")+ val (nj, ni) = cellNode(lat, lon)+ val point = g.elevation(key.px, key.py)+ val mean = t.cellMean(nj, ni)+ val tzName = g.zone(key.px, key.py) ?: throw Unavailable("no zone")+ val zone = t.zone(tzName) ?: throw Unavailable("tile lacks zone $tzName")+ return WxPointSeries(+ tzName = tzName,+ tz = zone,+ icon = iconM,+ precipM = precipM,+ cams = cams,+ pollen = pollen,+ elevations = if (point != null && mean != null) point to mean else null,+ inEurope = inEurope,+ )+ }+}++/** `compute::Windows`. */+internal class WxWindows(+ val nowH: Long,+ val hLo: Long,+ val hHi: Long,+ val hFetchLo: Long,+ val mLo: Long,+ val mHi: Long,+) {+ companion object {+ fun at(now: Long): WxWindows {+ val nowH = WxGrid.hourOf(now)+ val hLo = nowH - 7 * 24+ val mLo = nowH - 24+ return WxWindows(nowH, hLo, hLo + 337, hLo - 24, mLo, mLo + 72)+ }+ }+}++/** `compute::PointSeries` (series in display units, NaN = missing). */+internal class WxPointSeries(+ val tzName: String,+ val tz: WxTiles.Zone,+ val icon: Map<String, FloatArray>,+ val precipM: FloatArray,+ val cams: Map<String, FloatArray>,+ val pollen: Map<String, FloatArray>,+ /** (point m, cell mean m), null = no lapse correction. */+ val elevations: Pair<Double, Double>?,+ val inEurope: Boolean,+)
weather/src/main/java/com/vayunmathur/weather/domain/wx/WxMath.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/domain/wx/WxMath.kt b/weather/src/main/java/com/vayunmathur/weather/domain/wx/WxMath.ktnew file mode 100644index 0000000000..3cbcd7b47c--- /dev/null+++ b/weather/src/main/java/com/vayunmathur/weather/domain/wx/WxMath.kt@@ -0,0 +1,242 @@+package com.vayunmathur.weather.domain.wx++import kotlin.math.abs++/**+ * Port of the server's `weather/derive.rs` + `aqi.rs` (location_share_server)+ * for the on-device bundle ([WxCompute]). Every function mirrors its Rust+ * counterpart operation for operation: the app must produce the server's+ * bundle bit for bit (parity test `WxParityTest`). Transcendentals go+ * through [StrictMath] (fdlibm) so every device computes the same thing.+ */+internal object WxMath {+ /** Rust `f64::round`: half away from zero (Kotlin's `round` is half-even). */+ fun rround(x: Double): Double {+ if (x.isNaN() || x.isInfinite()) return x+ val t = if (x < 0) StrictMath.ceil(x) else StrictMath.floor(x)+ return if (abs(x - t) >= 0.5) t + StrictMath.signum(x) else t+ }++ /** Rust `f64::rem_euclid`. */+ fun remEuclid(a: Double, b: Double): Double {+ val r = a % b+ return if (r < 0.0) r + abs(b) else r+ }++ /** Rust `f64::max` (NaN ignored). */+ fun fmax(a: Double, b: Double): Double = when {+ a.isNaN() -> b+ b.isNaN() -> a+ else -> if (a >= b) a else b+ }++ /** Rust `f64::min` (NaN ignored). */+ fun fmin(a: Double, b: Double): Double = when {+ a.isNaN() -> b+ b.isNaN() -> a+ else -> if (a <= b) a else b+ }++ /** Rust `f64::asinh` (std's own formula, not libm). */+ fun asinh(x: Double): Double {+ val ax = abs(x)+ val ix = 1.0 / ax+ val r = StrictMath.log1p(ax + ax / (StrictMath.hypot(1.0, ix) + ix))+ return StrictMath.copySign(r, x)+ }++ fun round2(v: Double): Double = rround(v * 100.0) / 100.0+}++/** `derive::consts`. */+internal object WxConsts {+ const val MAGNUS_B = 17.625+ const val MAGNUS_C = 243.04+ const val ES0_HPA = 6.112+ const val AT_VP = 0.35+ const val AT_WIND = 0.48+ const val AT_OFFSET = 4.5+ const val CALM_KMH = 0.5+ const val MS_TO_KMH = 3.6+ const val VIS_PRECIP_MIN = 0.1+ const val VIS_WET_M = 1000.0+ const val VIS_DAMP_M = 8000.0+ const val VIS_HAZE_M = 15000.0+ const val VIS_CLEAR_M = 24000.0+ const val VIS_EXP_SCALE = 20000.0+ const val VIS_EXP_K = 1.5+ const val VIS_RH_WET = 95.0+ const val VIS_RH_DAMP = 85.0+ const val VIS_RH_HAZE = 75.0+ const val PPROB_HEAVY_MM = 0.5+ const val PPROB_LIGHT_MM = 0.1+ const val PPROB_HEAVY = 90+ const val PPROB_LIGHT = 70+ const val PPROB_OVERCAST_WET = 40+ const val PPROB_CLOUDY = 20+ const val PPROB_BASE = 5+ const val PPROB_OVERCAST_CLOUD = 80.0+ const val PPROB_OVERCAST_RH = 85.0+ const val PPROB_CLOUDY_CLOUD = 50.0+ const val SUNSHINE_SW_WM2 = 120.0+}++/** `derive.rs` per-step derivations (NaN in → null out). */+internal object WxDerive {+ /** Stored → display unit map (`UNIT_SCALE`): only the wind vars scale. */+ private val UNIT_SCALE = mapOf(+ "wind_u_component_10m" to 3.6f,+ "wind_v_component_10m" to 3.6f,+ "wind_gusts_10m" to 3.6f,+ )++ /** `fetch_window` applies the map only when it is not the identity. */+ fun applyUnitSeries(varName: String, v: FloatArray): FloatArray {+ val s = UNIT_SCALE[varName] ?: return v+ return FloatArray(v.size) { k -> if (v[k].isNaN()) Float.NaN else v[k] * s + 0.0f }+ }++ private fun svp(t: Double): Double =+ WxConsts.ES0_HPA * StrictMath.exp((WxConsts.MAGNUS_B * t) / (WxConsts.MAGNUS_C + t))++ fun dewPoint(t: Double, rhPct: Double): Double? {+ if (!t.isFinite() || !rhPct.isFinite() || rhPct <= 0.0) return null+ val rh = WxMath.fmin(rhPct, 100.0)+ val e = rh / 100.0 * svp(t)+ val ln = StrictMath.log(e / WxConsts.ES0_HPA)+ return WxConsts.MAGNUS_C * ln / (WxConsts.MAGNUS_B - ln)+ }++ fun apparentTemperature(t: Double, rhPct: Double, windMs: Double): Double? {+ if (!t.isFinite() || !rhPct.isFinite() || !windMs.isFinite()) return null+ val rh = rhPct.coerceIn(0.0, 100.0)+ val e = rh / 100.0 * svp(t)+ return t + WxConsts.AT_VP * e - WxConsts.AT_WIND * windMs - WxConsts.AT_OFFSET+ }++ fun windSpdDir(u: Double, v: Double): Pair<Double, Int>? {+ if (!u.isFinite() || !v.isFinite()) return null+ val spd = StrictMath.sqrt(u * u + v * v) * WxConsts.MS_TO_KMH+ if (spd < WxConsts.CALM_KMH) return spd to 0+ val dir = WxMath.rround(WxMath.remEuclid(180.0 + StrictMath.toDegrees(StrictMath.atan2(u, v)), 360.0)).toInt()+ return spd to dir+ }++ fun visibility(precip: Double, rhPct: Double): Double? {+ val p = precip.takeIf { it.isFinite() }+ val r = rhPct.takeIf { it.isFinite() }+ if (p == null && r == null) return null+ if (p != null && p >= WxConsts.VIS_PRECIP_MIN) {+ return WxMath.fmax(WxConsts.VIS_WET_M, WxConsts.VIS_EXP_SCALE * StrictMath.exp(-WxConsts.VIS_EXP_K * p))+ }+ if (r != null) {+ if (r >= WxConsts.VIS_RH_WET) return WxConsts.VIS_WET_M+ if (r > WxConsts.VIS_RH_DAMP) return WxConsts.VIS_DAMP_M+ if (r > WxConsts.VIS_RH_HAZE) return WxConsts.VIS_HAZE_M+ }+ return WxConsts.VIS_CLEAR_M+ }++ fun precipProbability(precip: Double, cloud: Double, rh: Double): Int? {+ if (!precip.isFinite() && !cloud.isFinite()) return null+ if (precip.isFinite()) {+ if (precip >= WxConsts.PPROB_HEAVY_MM) return WxConsts.PPROB_HEAVY+ if (precip >= WxConsts.PPROB_LIGHT_MM) return WxConsts.PPROB_LIGHT+ }+ if (cloud.isFinite()) {+ if (cloud > WxConsts.PPROB_OVERCAST_CLOUD && rh.isFinite() && rh > WxConsts.PPROB_OVERCAST_RH) {+ return WxConsts.PPROB_OVERCAST_WET+ }+ if (cloud > WxConsts.PPROB_CLOUDY_CLOUD) return WxConsts.PPROB_CLOUDY+ }+ return WxConsts.PPROB_BASE+ }++ fun shortwave(diffuse: Double, direct: Double): Double? =+ if (!diffuse.isFinite() || !direct.isFinite()) null else diffuse + direct++ /** `dem::lapse_correction`. */+ fun lapseCorrection(cellMeanM: Double, pointM: Double): Double = (cellMeanM - pointM) * (6.5 / 1000.0)+}++/** `aqi.rs`: US EPA AQI from CAMS concentrations. */+internal object WxAqi {+ private class Bp(val cLo: Double, val cHi: Double, val iLo: Int, val iHi: Int)++ private val PM25 = listOf(+ Bp(0.0, 12.0, 0, 50), Bp(12.1, 35.4, 51, 100), Bp(35.5, 55.4, 101, 150),+ Bp(55.5, 150.4, 151, 200), Bp(150.5, 250.4, 201, 300), Bp(250.5, 350.4, 301, 400),+ Bp(350.5, 500.0, 401, 500),+ )+ private val PM10 = listOf(+ Bp(0.0, 54.0, 0, 50), Bp(55.0, 154.0, 51, 100), Bp(155.0, 254.0, 101, 150),+ Bp(255.0, 354.0, 151, 200), Bp(355.0, 424.0, 201, 300), Bp(425.0, 504.0, 301, 400),+ Bp(505.0, 604.0, 401, 500),+ )+ private val O3 = listOf(+ Bp(0.0, 53.0, 0, 50), Bp(54.0, 100.0, 51, 100), Bp(101.0, 168.0, 101, 150),+ Bp(169.0, 208.0, 151, 200), Bp(209.0, 748.0, 201, 300),+ )+ private val NO2 = listOf(+ Bp(0.0, 53.0, 0, 50), Bp(54.0, 100.0, 51, 100), Bp(101.0, 360.0, 101, 150),+ Bp(361.0, 649.0, 151, 200), Bp(650.0, 1249.0, 201, 300), Bp(1250.0, 2049.0, 301, 400),+ )+ private val SO2 = listOf(+ Bp(0.0, 35.0, 0, 50), Bp(36.0, 75.0, 51, 100), Bp(76.0, 185.0, 101, 150), Bp(186.0, 304.0, 151, 200),+ )+ private val CO = listOf(+ Bp(0.0, 4.4, 0, 50), Bp(4.5, 9.4, 51, 100), Bp(9.5, 12.4, 101, 150), Bp(12.5, 15.4, 151, 200),+ Bp(15.5, 30.4, 201, 300), Bp(30.5, 40.4, 301, 400), Bp(40.5, 50.4, 401, 500),+ )++ private fun truncate(v: Double, decimals: Int): Double {+ var m = 1.0+ repeat(decimals) { m *= 10.0 }+ return StrictMath.floor(v * m) / m+ }++ private fun subIndex(conc: Double, table: List<Bp>): Int? {+ if (!conc.isFinite() || conc < 0.0) return null+ for (bp in table) {+ if (conc <= bp.cHi) {+ val c = WxMath.fmax(conc, bp.cLo)+ val i = (bp.iHi - bp.iLo).toDouble() / (bp.cHi - bp.cLo) * (c - bp.cLo) + bp.iLo.toDouble()+ return WxMath.rround(i).toInt()+ }+ }+ return null+ }++ private fun ppb(ugm3: Double, molar: Double) = ugm3 * 24.45 / molar+ private fun ppm(ugm3: Double, molar: Double) = ugm3 * 24.45 / molar / 1000.0++ /** Trailing 8-h mean ending at [hourIdx] (inclusive), null when all NaN. */+ fun trailingMean8h(series: DoubleArray, hourIdx: Int): Double? {+ if (series.isEmpty()) return null+ val end = minOf(hourIdx, series.size - 1)+ val start = maxOf(end - 7, 0)+ var sum = 0.0+ var n = 0+ for (k in start..end) {+ if (series[k].isFinite()) {+ sum += series[k]+ n+++ }+ }+ return if (n == 0) null else sum / n+ }++ /** Overall AQI = max sub-index; null when every pollutant is missing. */+ @Suppress("LongParameterList")+ fun usAqi(pm25: Double, pm10: Double, o38h: Double, no2: Double, so2: Double, co8h: Double): Int? {+ val subs = listOf(+ subIndex(truncate(pm25, 1), PM25),+ subIndex(truncate(pm10, 0), PM10),+ subIndex(truncate(ppb(o38h, 48.0), 0), O3),+ subIndex(ppb(no2, 46.0), NO2),+ subIndex(ppb(so2, 64.0), SO2),+ subIndex(truncate(ppm(co8h, 28.0), 1), CO),+ )+ return subs.filterNotNull().maxOrNull()+ }+}
weather/src/main/java/com/vayunmathur/weather/domain/wx/WxTiles.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/domain/wx/WxTiles.kt b/weather/src/main/java/com/vayunmathur/weather/domain/wx/WxTiles.ktnew file mode 100644index 0000000000..53eac73c7c--- /dev/null+++ b/weather/src/main/java/com/vayunmathur/weather/domain/wx/WxTiles.kt@@ -0,0 +1,271 @@+package com.vayunmathur.weather.domain.wx++import org.brotli.dec.BrotliInputStream+import java.io.ByteArrayInputStream+import java.util.zip.CRC32++/**+ * Decoders for the static weather objects on R2 (format spec and encoder:+ * location_share_server `src/handlers/weather/tile.rs`):+ * - `WXT1` tile: one run's model series for a block of ICON cells,+ * - `WXG1` geo block: point elevations + time-zone grid (static).+ * Both: `magic | u8 version | u8 flags | u32 body_len | u32 crc32 | brotli(body)`.+ */+internal object WxTiles {+ const val VERSION = 1+ const val MODEL_ICON = 0+ const val MODEL_CAMS_GLOBAL = 1+ const val MODEL_CAMS_EUROPE = 2+ private const val CODEC_LINEAR = 0+ private const val CODEC_DICT = 1+ private const val NAN_CODE = 0x7FFF+ const val GEO_PX = 64+ const val GEO_TZ = 16++ class Tile(+ val ty: Int,+ val tx: Int,+ val cells: Int,+ val genEpoch: Long,+ val iconRunIso: String,+ val iconRunMod: Long,+ val sections: List<Section>,+ val cellMeans: List<CellMeans>,+ val zones: List<Zone>,+ ) {+ fun section(model: Int): Section? = sections.firstOrNull { it.model == model }+ fun cellMean(j: Long, i: Long): Double? = cellMeans.firstNotNullOfOrNull { it.get(j, i) }+ fun zone(name: String): Zone? = zones.firstOrNull { it.name == name }+ }++ class Section(+ val model: Int,+ val ny: Int,+ val nx: Int,+ val j0: Int,+ val i0: Int,+ val nj: Int,+ val ni: Int,+ val vars: List<VarBlock>,+ ) {+ fun cell(j: Int, i: Int): Int? {+ val lj = j - j0+ val li = Math.floorMod(i - i0, nx)+ return if (lj in 0 until nj && li < ni) lj * ni + li else null+ }+ fun variable(name: String): VarBlock? = vars.firstOrNull { it.name == name }+ }++ /** One variable over hours `[h0, h0+nt)`, cell-major stored (pre-unit) values. */+ class VarBlock(val name: String, val h0: Long, val nt: Int, val values: FloatArray) {+ /** Values of cell [c] over `[hLo, hHi)`, NaN outside the stored range. */+ fun window(c: Int, hLo: Long, hHi: Long): FloatArray = FloatArray((hHi - hLo).toInt().coerceAtLeast(0)) { k ->+ val t = hLo + k - h0+ if (t in 0 until nt) values[c * nt + t.toInt()] else Float.NaN+ }+ }++ class CellMeans(val j0: Long, val i0: Long, val nj: Int, val ni: Int, val values: DoubleArray) {+ fun get(j: Long, i: Long): Double? {+ val lj = j - j0+ val li = i - i0+ if (lj !in 0 until nj || li !in 0 until ni) return null+ val v = values[(lj * ni + li).toInt()]+ return if (v.isFinite()) v else null+ }+ }++ /** UTC-offset intervals `(from, offset, abbr)`, ascending. */+ class Zone(val name: String, val from: LongArray, val offset: IntArray, val abbr: List<String>) {+ private fun idx(epoch: Long): Int {+ var lo = 0+ var hi = from.size // first index with from > epoch+ while (lo < hi) {+ val mid = (lo + hi) ushr 1+ if (from[mid] <= epoch) lo = mid + 1 else hi = mid+ }+ return maxOf(lo - 1, 0)+ }+ fun offsetAt(epoch: Long): Int = offset[idx(epoch)]+ fun abbrAt(epoch: Long): String = abbr[idx(epoch)]+ }++ class GeoBlock(+ val x: Int,+ val y: Int,+ val b: Int,+ val zones: List<String>,+ val tz: ByteArray,+ val elev: IntArray?,+ ) {+ /** `dem::point_elev` value at block pixel (px, py). */+ fun elevation(px: Int, py: Int): Double? {+ val c = elev?.getOrNull(py * GEO_PX + px) ?: return null+ return WxMath.fmax((c.toDouble() - 8_388_608.0) / 256.0, -500.0)+ }+ fun zone(px: Int, py: Int): String? = zones.getOrNull(tz[(py / 4) * GEO_TZ + px / 4].toInt() and 0xFF)+ }++ class FormatException(msg: String) : Exception(msg)++ private class Reader(val b: ByteArray) {+ var p = 0+ fun take(n: Int): Int {+ if (n < 0 || p + n > b.size) throw FormatException("truncated")+ val at = p+ p += n+ return at+ }+ fun u8(): Int = b[take(1)].toInt() and 0xFF+ fun u16(): Int = u8() or (u8() shl 8)+ fun u32(): Long = (u16().toLong()) or (u16().toLong() shl 16)+ fun i32(): Int = u32().toInt()+ fun i64(): Long = u32() or (u32() shl 32)+ fun f32(): Float = Float.fromBits(i32())+ fun f64(): Double = Double.fromBits(i64())+ fun str(): String {+ val n = u8()+ val at = take(n)+ return String(b, at, n, Charsets.UTF_8)+ }+ }++ @Suppress("ThrowsCount")+ private fun unframe(magic: String, bytes: ByteArray): ByteArray {+ if (bytes.size < 14 || String(bytes, 0, 4, Charsets.US_ASCII) != magic) throw FormatException("not $magic")+ if (bytes[4].toInt() != VERSION) throw FormatException("$magic version ${bytes[4]}")+ val hdr = Reader(bytes).apply { p = 6 }+ val len = hdr.u32()+ val crc = hdr.u32()+ if (len > 64L shl 20) throw FormatException("body too large")+ val body = ByteArray(len.toInt())+ BrotliInputStream(ByteArrayInputStream(bytes, 14, bytes.size - 14)).use { s ->+ var off = 0+ while (off < body.size) {+ val n = s.read(body, off, body.size - off)+ if (n < 0) throw FormatException("short body")+ off += n+ }+ if (s.read() != -1) throw FormatException("long body")+ }+ val c = CRC32().apply { update(body) }.value+ if (c != crc) throw FormatException("checksum mismatch")+ return body+ }++ /** Undo `pack_codes`: byte planes → per-cell deltas (+ previous cell) → codes. */+ private fun unpack(b: ByteArray, at: Int, ncell: Int, nt: Int): IntArray {+ val n = ncell * nt+ val r = IntArray(n) { k -> (b[at + k].toInt() and 0xFF) or ((b[at + n + k].toInt() and 0xFF) shl 8) }+ for (c in 1 until ncell) for (t in 0 until nt) r[c * nt + t] = (r[c * nt + t] + r[(c - 1) * nt + t]) and 0xFFFF+ for (c in 0 until ncell) {+ var prev = 0+ for (t in 0 until nt) {+ prev = (prev + r[c * nt + t]) and 0xFFFF+ r[c * nt + t] = prev+ }+ }+ return r+ }++ @Suppress("ThrowsCount")+ private fun readVar(r: Reader, ncell: Int): VarBlock {+ val name = r.str()+ val h0 = r.i64()+ val nt = r.u32().toInt()+ val codec = r.u8()+ val scale = r.f32()+ val offset = r.f32()+ val dict = if (codec == CODEC_DICT) FloatArray(r.u32().toInt()) { r.f32() } else FloatArray(0)+ val plen = r.u32().toInt()+ if (plen != ncell * nt * 2) throw FormatException("$name payload $plen")+ val codes = unpack(r.b, r.take(plen), ncell, nt)+ val values = when (codec) {+ CODEC_LINEAR -> FloatArray(codes.size) { k ->+ val c = codes[k]+ // `.om` decode, in float: (code as i16) / scale − offset.+ if (c == NAN_CODE) Float.NaN else c.toShort().toFloat() / scale - offset+ }+ CODEC_DICT -> FloatArray(codes.size) { k -> dict.getOrNull(codes[k]) ?: throw FormatException("dict code") }+ else -> throw FormatException("codec $codec")+ }+ return VarBlock(name, h0, nt, values)+ }++ fun decodeTile(bytes: ByteArray): Tile {+ val r = Reader(unframe("WXT1", bytes))+ val ty = r.u16()+ val tx = r.u16()+ val cells = r.u8()+ val gen = r.i64()+ val runIso = r.str()+ val runMod = r.i64()+ r.i64()+ r.i64() // CAMS run ids (debugging only)+ val sections = List(r.u8()) {+ val model = r.u8()+ val ny = r.u32().toInt()+ val nx = r.u32().toInt()+ val j0 = r.u32().toInt()+ val i0 = r.u32().toInt()+ val nj = r.u16()+ val ni = r.u16()+ val vars = List(r.u8()) { readVar(r, nj * ni) }+ Section(model, ny, nx, j0, i0, nj, ni, vars)+ }+ val means = List(r.u8()) {+ val j0 = r.i64()+ val i0 = r.i64()+ val nj = r.u16()+ val ni = r.u16()+ CellMeans(j0, i0, nj, ni, DoubleArray(nj * ni) { r.f64() })+ }+ val zones = List(r.u8()) {+ val name = r.str()+ val n = r.u16()+ val from = LongArray(n)+ val off = IntArray(n)+ val abbr = ArrayList<String>(n)+ for (k in 0 until n) {+ from[k] = r.i64()+ off[k] = r.i32()+ abbr.add(r.str())+ }+ Zone(name, from, off, abbr)+ }+ if (r.p != r.b.size) throw FormatException("trailing bytes")+ return Tile(ty, tx, cells, gen, runIso, runMod, sections, means, zones)+ }++ @Suppress("ThrowsCount")+ fun decodeGeo(bytes: ByteArray): GeoBlock {+ val r = Reader(unframe("WXG1", bytes))+ val x = r.u16()+ val y = r.u16()+ val b = r.u8()+ val zones = List(r.u8()) { r.str() }+ val tzAt = r.take(GEO_TZ * GEO_TZ)+ val tz = r.b.copyOfRange(tzAt, tzAt + GEO_TZ * GEO_TZ)+ if (tz.any { (it.toInt() and 0xFF) >= zones.size }) throw FormatException("zone index")+ val elev = if (r.u8() == 0) {+ null+ } else {+ val n = GEO_PX * GEO_PX+ val at = r.take(n * 4)+ val e = IntArray(n)+ for (k in 0 until n) {+ val d = (r.b[at + k].toInt() and 0xFF) or ((r.b[at + n + k].toInt() and 0xFF) shl 8) or+ ((r.b[at + 2 * n + k].toInt() and 0xFF) shl 16) or ((r.b[at + 3 * n + k].toInt() and 0xFF) shl 24)+ val prev = when {+ k % GEO_PX != 0 -> e[k - 1]+ k >= GEO_PX -> e[k - GEO_PX]+ else -> 0+ }+ e[k] = prev + d+ }+ e+ }+ if (r.p != r.b.size) throw FormatException("trailing bytes")+ return GeoBlock(x, y, b, zones, tz, elev)+ }+}
weather/src/test/java/com/vayunmathur/weather/domain/wx/WxParityTest.kt
diff --git a/weather/src/test/java/com/vayunmathur/weather/domain/wx/WxParityTest.kt b/weather/src/test/java/com/vayunmathur/weather/domain/wx/WxParityTest.ktnew file mode 100644index 0000000000..dd961e5243--- /dev/null+++ b/weather/src/test/java/com/vayunmathur/weather/domain/wx/WxParityTest.kt@@ -0,0 +1,98 @@+package com.vayunmathur.weather.domain.wx++import com.vayunmathur.weather.network.WxBundle+import kotlinx.serialization.json.Json+import kotlinx.serialization.json.JsonArray+import kotlinx.serialization.json.JsonElement+import kotlinx.serialization.json.JsonNull+import kotlinx.serialization.json.JsonObject+import kotlinx.serialization.json.JsonPrimitive+import kotlinx.serialization.json.doubleOrNull+import kotlinx.serialization.json.jsonArray+import kotlinx.serialization.json.jsonObject+import kotlinx.serialization.json.jsonPrimitive+import kotlinx.serialization.json.long+import org.junit.Assert.assertEquals+import org.junit.Assert.assertTrue+import org.junit.Assert.fail+import org.junit.Test+import java.util.zip.GZIPInputStream++/**+ * App vs server parity for the static R2 weather path.+ *+ * Fixtures (`src/test/resources/wx/`) come from the server repo's+ * `server wx fixtures`: for each (point, now) the server's own `/wx/v1/bundle`+ * JSON (its real fetch path over the same Open-Meteo chunk files, gzipped),+ * plus the exported `WXT1` run tile, history-day tiles and `WXG1` geo block+ * the app would download. The+ * server already checked its Rust tile path against that JSON; this checks+ * the Kotlin port ([WxGrid.seriesFromTile] + [WxCompute.computeBundle])+ * produces the same bundle, value for value.+ */+class WxParityTest {+ private val json = Json { ignoreUnknownKeys = true }++ private fun res(path: String): ByteArray =+ javaClass.classLoader!!.getResourceAsStream("wx/$path")?.use { it.readBytes() }+ ?: error("missing fixture wx/$path")++ /** First difference between two JSON trees (numbers compared as doubles). */+ private fun diff(path: String, a: JsonElement, b: JsonElement): String? = when {+ a is JsonObject && b is JsonObject -> (a.keys + b.keys).firstNotNullOfOrNull { k ->+ diff("$path.$k", a[k] ?: JsonNull, b[k] ?: JsonNull)+ }+ a is JsonArray && b is JsonArray ->+ if (a.size != b.size) "$path: len ${a.size} != ${b.size}"+ else a.indices.firstNotNullOfOrNull { k -> diff("$path[$k]", a[k], b[k]) }+ a is JsonPrimitive && b is JsonPrimitive && !a.isString && !b.isString && a !is JsonNull && b !is JsonNull ->+ if (a.doubleOrNull == b.doubleOrNull) null else "$path: $a != $b"+ else -> if (a == b) null else "$path: $a != $b"+ }++ @Test+ fun `every fixture bundle computed on device equals the server bundle`() {+ val cases = json.parseToJsonElement(res("cases.json").decodeToString()).jsonArray+ assertTrue("fixtures present", cases.size >= 30)+ val failures = mutableListOf<String>()+ for (c in cases) {+ val o = c.jsonObject+ val lat = o["lat"]!!.jsonPrimitive.content.toDouble()+ val lon = o["lon"]!!.jsonPrimitive.content.toDouble()+ val now = o["now"]!!.jsonPrimitive.long+ val tile = WxTiles.decodeTile(res(o["tile"]!!.jsonPrimitive.content))+ val hist = o["hist"]!!.jsonArray.map { WxTiles.decodeTile(res(it.jsonPrimitive.content)) }+ val geo = WxTiles.decodeGeo(res(o["geo"]!!.jsonPrimitive.content))+ val gz = res(o["expected"]!!.jsonPrimitive.content)+ val expected = json.parseToJsonElement(GZIPInputStream(gz.inputStream()).readBytes().decodeToString())+ val series = WxGrid.seriesFromTile(tile, hist, geo, lat, lon, now)+ val bundle = WxCompute.computeBundle(lat, lon, now, tile.iconRunIso, series)+ val ours = json.encodeToJsonElement(WxBundle.serializer(), bundle)+ diff("", expected, ours)?.let { failures += "$lat,$lon @$now: $it" }+ }+ if (failures.isNotEmpty()) fail("${failures.size}/${cases.size} differ:\n" + failures.joinToString("\n"))+ }++ @Test+ fun `grid math matches the server anchors`() {+ // Berlin: ICON cell (1140, 1547), z10 tile (550, 335).+ assertEquals(1140 to 1547, WxGrid.cellIndex(WxGrid.ICON, 52.52, 13.41, 1441, 2879))+ val k = WxGrid.geoOf(52.52, 13.41)!!+ assertEquals(550 to 335, k.x to k.y)+ // Points past ICON's last column wrap into tile 0 (server: i mod 2879).+ assertEquals(0, WxGrid.tileOf(0.0, 179.99, 1441, 2879, 8).second)+ assertEquals(720L to 2880L, WxGrid.cellNode(0.0, 179.99))+ assertEquals(null, WxGrid.geoOf(-89.0, 0.0))+ }++ @Test+ fun `rust rounding semantics`() {+ assertEquals(-3.0, WxMath.rround(-2.5), 0.0)+ assertEquals(3.0, WxMath.rround(2.5), 0.0)+ assertEquals(0.0, WxMath.rround(0.49999999999999994), 0.0)+ assertEquals(1.0 / Double.NEGATIVE_INFINITY, WxMath.rround(-0.4), 0.0) // −0.0+ assertEquals(0.01, WxMath.round2(0.005), 0.0)+ assertEquals(359.5, WxMath.remEuclid(-0.5, 360.0), 0.0)+ assertEquals(2.0, WxMath.fmax(Double.NaN, 2.0), 0.0)+ }+}
weather/src/test/resources/wx/cases.json
diff --git a/weather/src/test/resources/wx/cases.json b/weather/src/test/resources/wx/cases.jsonnew file mode 100644index 0000000000..f5967dfa8b--- /dev/null+++ b/weather/src/test/resources/wx/cases.json@@ -0,0 +1,563 @@+[+ {+ "expected": "expected/40.71_-74.01_1794600000.json.gz",+ "geo": "geo/v1/301/385/1.wxg",+ "hist": [+ "hist/20762/130/106.wxt",+ "hist/20763/130/106.wxt",+ "hist/20764/130/106.wxt",+ "hist/20765/130/106.wxt",+ "hist/20766/130/106.wxt",+ "hist/20767/130/106.wxt",+ "hist/20768/130/106.wxt",+ "hist/20769/130/106.wxt"+ ],+ "lat": 40.71,+ "lon": -74.01,+ "now": 1794600000,+ "tile": "runs/2026111312-1794600000/t/130/106.wxt"+ },+ {+ "expected": "expected/34.05_-118.24_1794600000.json.gz",+ "geo": "geo/v1/175/408/14.wxg",+ "hist": [+ "hist/20762/124/61.wxt",+ "hist/20763/124/61.wxt",+ "hist/20764/124/61.wxt",+ "hist/20765/124/61.wxt",+ "hist/20766/124/61.wxt",+ "hist/20767/124/61.wxt",+ "hist/20768/124/61.wxt",+ "hist/20769/124/61.wxt"+ ],+ "lat": 34.05,+ "lon": -118.24,+ "now": 1794600000,+ "tile": "runs/2026111312-1794600000/t/124/61.wxt"+ },+ {+ "expected": "expected/33.45_-112.07_1794600000.json.gz",+ "geo": "geo/v1/193/410/12.wxg",+ "hist": [+ "hist/20762/123/67.wxt",+ "hist/20763/123/67.wxt",+ "hist/20764/123/67.wxt",+ "hist/20765/123/67.wxt",+ "hist/20766/123/67.wxt",+ "hist/20767/123/67.wxt",+ "hist/20768/123/67.wxt",+ "hist/20769/123/67.wxt"+ ],+ "lat": 33.45,+ "lon": -112.07,+ "now": 1794600000,+ "tile": "runs/2026111312-1794600000/t/123/67.wxt"+ },+ {+ "expected": "expected/51.51_-0.13_1794600000.json.gz",+ "geo": "geo/v1/511/340/6.wxg",+ "hist": [+ "hist/20762/141/179.wxt",+ "hist/20763/141/179.wxt",+ "hist/20764/141/179.wxt",+ "hist/20765/141/179.wxt",+ "hist/20766/141/179.wxt",+ "hist/20767/141/179.wxt",+ "hist/20768/141/179.wxt",+ "hist/20769/141/179.wxt"+ ],+ "lat": 51.51,+ "lon": -0.13,+ "now": 1794600000,+ "tile": "runs/2026111312-1794600000/t/141/179.wxt"+ },+ {+ "expected": "expected/52.52_13.4_1794600000.json.gz",+ "geo": "geo/v1/550/335/12.wxg",+ "hist": [+ "hist/20762/142/193.wxt",+ "hist/20763/142/193.wxt",+ "hist/20764/142/193.wxt",+ "hist/20765/142/193.wxt",+ "hist/20766/142/193.wxt",+ "hist/20767/142/193.wxt",+ "hist/20768/142/193.wxt",+ "hist/20769/142/193.wxt"+ ],+ "lat": 52.52,+ "lon": 13.4,+ "now": 1794600000,+ "tile": "runs/2026111312-1794600000/t/142/193.wxt"+ },+ {+ "expected": "expected/59.33_18.07_1794600000.json.gz",+ "geo": "geo/v1/563/301/1.wxg",+ "hist": [+ "hist/20762/149/198.wxt",+ "hist/20763/149/198.wxt",+ "hist/20764/149/198.wxt",+ "hist/20765/149/198.wxt",+ "hist/20766/149/198.wxt",+ "hist/20767/149/198.wxt",+ "hist/20768/149/198.wxt",+ "hist/20769/149/198.wxt"+ ],+ "lat": 59.33,+ "lon": 18.07,+ "now": 1794600000,+ "tile": "runs/2026111312-1794600000/t/149/198.wxt"+ },+ {+ "expected": "expected/35.68_139.69_1794600000.json.gz",+ "geo": "geo/v1/909/403/1.wxg",+ "hist": [+ "hist/20762/125/319.wxt",+ "hist/20763/125/319.wxt",+ "hist/20764/125/319.wxt",+ "hist/20765/125/319.wxt",+ "hist/20766/125/319.wxt",+ "hist/20767/125/319.wxt",+ "hist/20768/125/319.wxt",+ "hist/20769/125/319.wxt"+ ],+ "lat": 35.68,+ "lon": 139.69,+ "now": 1794600000,+ "tile": "runs/2026111312-1794600000/t/125/319.wxt"+ },+ {+ "expected": "expected/1.35_103.82_1794600000.json.gz",+ "geo": "geo/v1/807/508/1.wxg",+ "hist": [+ "hist/20762/91/283.wxt",+ "hist/20763/91/283.wxt",+ "hist/20764/91/283.wxt",+ "hist/20765/91/283.wxt",+ "hist/20766/91/283.wxt",+ "hist/20767/91/283.wxt",+ "hist/20768/91/283.wxt",+ "hist/20769/91/283.wxt"+ ],+ "lat": 1.35,+ "lon": 103.82,+ "now": 1794600000,+ "tile": "runs/2026111312-1794600000/t/91/283.wxt"+ },+ {+ "expected": "expected/-33.87_151.21_1794600000.json.gz",+ "geo": "geo/v1/942/614/4.wxg",+ "hist": [+ "hist/20762/56/331.wxt",+ "hist/20763/56/331.wxt",+ "hist/20764/56/331.wxt",+ "hist/20765/56/331.wxt",+ "hist/20766/56/331.wxt",+ "hist/20767/56/331.wxt",+ "hist/20768/56/331.wxt",+ "hist/20769/56/331.wxt"+ ],+ "lat": -33.87,+ "lon": 151.21,+ "now": 1794600000,+ "tile": "runs/2026111312-1794600000/t/56/331.wxt"+ },+ {+ "expected": "expected/-23.55_-46.63_1794600000.json.gz",+ "geo": "geo/v1/379/580/13.wxg",+ "hist": [+ "hist/20762/66/133.wxt",+ "hist/20763/66/133.wxt",+ "hist/20764/66/133.wxt",+ "hist/20765/66/133.wxt",+ "hist/20766/66/133.wxt",+ "hist/20767/66/133.wxt",+ "hist/20768/66/133.wxt",+ "hist/20769/66/133.wxt"+ ],+ "lat": -23.55,+ "lon": -46.63,+ "now": 1794600000,+ "tile": "runs/2026111312-1794600000/t/66/133.wxt"+ },+ {+ "expected": "expected/28.61_77.21_1794600000.json.gz",+ "geo": "geo/v1/731/427/2.wxg",+ "hist": [+ "hist/20762/118/257.wxt",+ "hist/20763/118/257.wxt",+ "hist/20764/118/257.wxt",+ "hist/20765/118/257.wxt",+ "hist/20766/118/257.wxt",+ "hist/20767/118/257.wxt",+ "hist/20768/118/257.wxt",+ "hist/20769/118/257.wxt"+ ],+ "lat": 28.61,+ "lon": 77.21,+ "now": 1794600000,+ "tile": "runs/2026111312-1794600000/t/118/257.wxt"+ },+ {+ "expected": "expected/40.71_-74.01_1794617999.json.gz",+ "geo": "geo/v1/301/385/1.wxg",+ "hist": [+ "hist/20763/130/106.wxt",+ "hist/20764/130/106.wxt",+ "hist/20765/130/106.wxt",+ "hist/20766/130/106.wxt",+ "hist/20767/130/106.wxt",+ "hist/20768/130/106.wxt",+ "hist/20769/130/106.wxt"+ ],+ "lat": 40.71,+ "lon": -74.01,+ "now": 1794617999,+ "tile": "runs/2026111312-1794600000/t/130/106.wxt"+ },+ {+ "expected": "expected/34.05_-118.24_1794617999.json.gz",+ "geo": "geo/v1/175/408/14.wxg",+ "hist": [+ "hist/20763/124/61.wxt",+ "hist/20764/124/61.wxt",+ "hist/20765/124/61.wxt",+ "hist/20766/124/61.wxt",+ "hist/20767/124/61.wxt",+ "hist/20768/124/61.wxt",+ "hist/20769/124/61.wxt"+ ],+ "lat": 34.05,+ "lon": -118.24,+ "now": 1794617999,+ "tile": "runs/2026111312-1794600000/t/124/61.wxt"+ },+ {+ "expected": "expected/33.45_-112.07_1794617999.json.gz",+ "geo": "geo/v1/193/410/12.wxg",+ "hist": [+ "hist/20763/123/67.wxt",+ "hist/20764/123/67.wxt",+ "hist/20765/123/67.wxt",+ "hist/20766/123/67.wxt",+ "hist/20767/123/67.wxt",+ "hist/20768/123/67.wxt",+ "hist/20769/123/67.wxt"+ ],+ "lat": 33.45,+ "lon": -112.07,+ "now": 1794617999,+ "tile": "runs/2026111312-1794600000/t/123/67.wxt"+ },+ {+ "expected": "expected/51.51_-0.13_1794617999.json.gz",+ "geo": "geo/v1/511/340/6.wxg",+ "hist": [+ "hist/20763/141/179.wxt",+ "hist/20764/141/179.wxt",+ "hist/20765/141/179.wxt",+ "hist/20766/141/179.wxt",+ "hist/20767/141/179.wxt",+ "hist/20768/141/179.wxt",+ "hist/20769/141/179.wxt"+ ],+ "lat": 51.51,+ "lon": -0.13,+ "now": 1794617999,+ "tile": "runs/2026111312-1794600000/t/141/179.wxt"+ },+ {+ "expected": "expected/52.52_13.4_1794617999.json.gz",+ "geo": "geo/v1/550/335/12.wxg",+ "hist": [+ "hist/20763/142/193.wxt",+ "hist/20764/142/193.wxt",+ "hist/20765/142/193.wxt",+ "hist/20766/142/193.wxt",+ "hist/20767/142/193.wxt",+ "hist/20768/142/193.wxt",+ "hist/20769/142/193.wxt"+ ],+ "lat": 52.52,+ "lon": 13.4,+ "now": 1794617999,+ "tile": "runs/2026111312-1794600000/t/142/193.wxt"+ },+ {+ "expected": "expected/59.33_18.07_1794617999.json.gz",+ "geo": "geo/v1/563/301/1.wxg",+ "hist": [+ "hist/20763/149/198.wxt",+ "hist/20764/149/198.wxt",+ "hist/20765/149/198.wxt",+ "hist/20766/149/198.wxt",+ "hist/20767/149/198.wxt",+ "hist/20768/149/198.wxt",+ "hist/20769/149/198.wxt"+ ],+ "lat": 59.33,+ "lon": 18.07,+ "now": 1794617999,+ "tile": "runs/2026111312-1794600000/t/149/198.wxt"+ },+ {+ "expected": "expected/35.68_139.69_1794617999.json.gz",+ "geo": "geo/v1/909/403/1.wxg",+ "hist": [+ "hist/20763/125/319.wxt",+ "hist/20764/125/319.wxt",+ "hist/20765/125/319.wxt",+ "hist/20766/125/319.wxt",+ "hist/20767/125/319.wxt",+ "hist/20768/125/319.wxt",+ "hist/20769/125/319.wxt"+ ],+ "lat": 35.68,+ "lon": 139.69,+ "now": 1794617999,+ "tile": "runs/2026111312-1794600000/t/125/319.wxt"+ },+ {+ "expected": "expected/1.35_103.82_1794617999.json.gz",+ "geo": "geo/v1/807/508/1.wxg",+ "hist": [+ "hist/20763/91/283.wxt",+ "hist/20764/91/283.wxt",+ "hist/20765/91/283.wxt",+ "hist/20766/91/283.wxt",+ "hist/20767/91/283.wxt",+ "hist/20768/91/283.wxt",+ "hist/20769/91/283.wxt"+ ],+ "lat": 1.35,+ "lon": 103.82,+ "now": 1794617999,+ "tile": "runs/2026111312-1794600000/t/91/283.wxt"+ },+ {+ "expected": "expected/-33.87_151.21_1794617999.json.gz",+ "geo": "geo/v1/942/614/4.wxg",+ "hist": [+ "hist/20763/56/331.wxt",+ "hist/20764/56/331.wxt",+ "hist/20765/56/331.wxt",+ "hist/20766/56/331.wxt",+ "hist/20767/56/331.wxt",+ "hist/20768/56/331.wxt",+ "hist/20769/56/331.wxt"+ ],+ "lat": -33.87,+ "lon": 151.21,+ "now": 1794617999,+ "tile": "runs/2026111312-1794600000/t/56/331.wxt"+ },+ {+ "expected": "expected/-23.55_-46.63_1794617999.json.gz",+ "geo": "geo/v1/379/580/13.wxg",+ "hist": [+ "hist/20763/66/133.wxt",+ "hist/20764/66/133.wxt",+ "hist/20765/66/133.wxt",+ "hist/20766/66/133.wxt",+ "hist/20767/66/133.wxt",+ "hist/20768/66/133.wxt",+ "hist/20769/66/133.wxt"+ ],+ "lat": -23.55,+ "lon": -46.63,+ "now": 1794617999,+ "tile": "runs/2026111312-1794600000/t/66/133.wxt"+ },+ {+ "expected": "expected/28.61_77.21_1794617999.json.gz",+ "geo": "geo/v1/731/427/2.wxg",+ "hist": [+ "hist/20763/118/257.wxt",+ "hist/20764/118/257.wxt",+ "hist/20765/118/257.wxt",+ "hist/20766/118/257.wxt",+ "hist/20767/118/257.wxt",+ "hist/20768/118/257.wxt",+ "hist/20769/118/257.wxt"+ ],+ "lat": 28.61,+ "lon": 77.21,+ "now": 1794617999,+ "tile": "runs/2026111312-1794600000/t/118/257.wxt"+ },+ {+ "expected": "expected/40.71_-74.01_1794708000.json.gz",+ "geo": "geo/v1/301/385/1.wxg",+ "hist": [+ "hist/20764/130/106.wxt",+ "hist/20765/130/106.wxt",+ "hist/20766/130/106.wxt",+ "hist/20767/130/106.wxt",+ "hist/20768/130/106.wxt",+ "hist/20769/130/106.wxt"+ ],+ "lat": 40.71,+ "lon": -74.01,+ "now": 1794708000,+ "tile": "runs/2026111312-1794600000/t/130/106.wxt"+ },+ {+ "expected": "expected/34.05_-118.24_1794708000.json.gz",+ "geo": "geo/v1/175/408/14.wxg",+ "hist": [+ "hist/20764/124/61.wxt",+ "hist/20765/124/61.wxt",+ "hist/20766/124/61.wxt",+ "hist/20767/124/61.wxt",+ "hist/20768/124/61.wxt",+ "hist/20769/124/61.wxt"+ ],+ "lat": 34.05,+ "lon": -118.24,+ "now": 1794708000,+ "tile": "runs/2026111312-1794600000/t/124/61.wxt"+ },+ {+ "expected": "expected/33.45_-112.07_1794708000.json.gz",+ "geo": "geo/v1/193/410/12.wxg",+ "hist": [+ "hist/20764/123/67.wxt",+ "hist/20765/123/67.wxt",+ "hist/20766/123/67.wxt",+ "hist/20767/123/67.wxt",+ "hist/20768/123/67.wxt",+ "hist/20769/123/67.wxt"+ ],+ "lat": 33.45,+ "lon": -112.07,+ "now": 1794708000,+ "tile": "runs/2026111312-1794600000/t/123/67.wxt"+ },+ {+ "expected": "expected/51.51_-0.13_1794708000.json.gz",+ "geo": "geo/v1/511/340/6.wxg",+ "hist": [+ "hist/20764/141/179.wxt",+ "hist/20765/141/179.wxt",+ "hist/20766/141/179.wxt",+ "hist/20767/141/179.wxt",+ "hist/20768/141/179.wxt",+ "hist/20769/141/179.wxt"+ ],+ "lat": 51.51,+ "lon": -0.13,+ "now": 1794708000,+ "tile": "runs/2026111312-1794600000/t/141/179.wxt"+ },+ {+ "expected": "expected/52.52_13.4_1794708000.json.gz",+ "geo": "geo/v1/550/335/12.wxg",+ "hist": [+ "hist/20764/142/193.wxt",+ "hist/20765/142/193.wxt",+ "hist/20766/142/193.wxt",+ "hist/20767/142/193.wxt",+ "hist/20768/142/193.wxt",+ "hist/20769/142/193.wxt"+ ],+ "lat": 52.52,+ "lon": 13.4,+ "now": 1794708000,+ "tile": "runs/2026111312-1794600000/t/142/193.wxt"+ },+ {+ "expected": "expected/59.33_18.07_1794708000.json.gz",+ "geo": "geo/v1/563/301/1.wxg",+ "hist": [+ "hist/20764/149/198.wxt",+ "hist/20765/149/198.wxt",+ "hist/20766/149/198.wxt",+ "hist/20767/149/198.wxt",+ "hist/20768/149/198.wxt",+ "hist/20769/149/198.wxt"+ ],+ "lat": 59.33,+ "lon": 18.07,+ "now": 1794708000,+ "tile": "runs/2026111312-1794600000/t/149/198.wxt"+ },+ {+ "expected": "expected/35.68_139.69_1794708000.json.gz",+ "geo": "geo/v1/909/403/1.wxg",+ "hist": [+ "hist/20764/125/319.wxt",+ "hist/20765/125/319.wxt",+ "hist/20766/125/319.wxt",+ "hist/20767/125/319.wxt",+ "hist/20768/125/319.wxt",+ "hist/20769/125/319.wxt"+ ],+ "lat": 35.68,+ "lon": 139.69,+ "now": 1794708000,+ "tile": "runs/2026111312-1794600000/t/125/319.wxt"+ },+ {+ "expected": "expected/1.35_103.82_1794708000.json.gz",+ "geo": "geo/v1/807/508/1.wxg",+ "hist": [+ "hist/20764/91/283.wxt",+ "hist/20765/91/283.wxt",+ "hist/20766/91/283.wxt",+ "hist/20767/91/283.wxt",+ "hist/20768/91/283.wxt",+ "hist/20769/91/283.wxt"+ ],+ "lat": 1.35,+ "lon": 103.82,+ "now": 1794708000,+ "tile": "runs/2026111312-1794600000/t/91/283.wxt"+ },+ {+ "expected": "expected/-33.87_151.21_1794708000.json.gz",+ "geo": "geo/v1/942/614/4.wxg",+ "hist": [+ "hist/20764/56/331.wxt",+ "hist/20765/56/331.wxt",+ "hist/20766/56/331.wxt",+ "hist/20767/56/331.wxt",+ "hist/20768/56/331.wxt",+ "hist/20769/56/331.wxt"+ ],+ "lat": -33.87,+ "lon": 151.21,+ "now": 1794708000,+ "tile": "runs/2026111312-1794600000/t/56/331.wxt"+ },+ {+ "expected": "expected/-23.55_-46.63_1794708000.json.gz",+ "geo": "geo/v1/379/580/13.wxg",+ "hist": [+ "hist/20764/66/133.wxt",+ "hist/20765/66/133.wxt",+ "hist/20766/66/133.wxt",+ "hist/20767/66/133.wxt",+ "hist/20768/66/133.wxt",+ "hist/20769/66/133.wxt"+ ],+ "lat": -23.55,+ "lon": -46.63,+ "now": 1794708000,+ "tile": "runs/2026111312-1794600000/t/66/133.wxt"+ },+ {+ "expected": "expected/28.61_77.21_1794708000.json.gz",+ "geo": "geo/v1/731/427/2.wxg",+ "hist": [+ "hist/20764/118/257.wxt",+ "hist/20765/118/257.wxt",+ "hist/20766/118/257.wxt",+ "hist/20767/118/257.wxt",+ "hist/20768/118/257.wxt",+ "hist/20769/118/257.wxt"+ ],+ "lat": 28.61,+ "lon": 77.21,+ "now": 1794708000,+ "tile": "runs/2026111312-1794600000/t/118/257.wxt"+ }+]\ No newline at end of file
weather/src/test/resources/wx/expected/-23.55_-46.63_1794600000.json.gz
diff --git a/weather/src/test/resources/wx/expected/-23.55_-46.63_1794600000.json.gz b/weather/src/test/resources/wx/expected/-23.55_-46.63_1794600000.json.gznew file mode 100644index 0000000000..68233707fbBinary files /dev/null and b/weather/src/test/resources/wx/expected/-23.55_-46.63_1794600000.json.gz differ
weather/src/test/resources/wx/expected/-23.55_-46.63_1794617999.json.gz
diff --git a/weather/src/test/resources/wx/expected/-23.55_-46.63_1794617999.json.gz b/weather/src/test/resources/wx/expected/-23.55_-46.63_1794617999.json.gznew file mode 100644index 0000000000..abd8e691a8Binary files /dev/null and b/weather/src/test/resources/wx/expected/-23.55_-46.63_1794617999.json.gz differ
weather/src/test/resources/wx/expected/-23.55_-46.63_1794708000.json.gz
diff --git a/weather/src/test/resources/wx/expected/-23.55_-46.63_1794708000.json.gz b/weather/src/test/resources/wx/expected/-23.55_-46.63_1794708000.json.gznew file mode 100644index 0000000000..f0d686fbf3Binary files /dev/null and b/weather/src/test/resources/wx/expected/-23.55_-46.63_1794708000.json.gz differ
weather/src/test/resources/wx/expected/-33.87_151.21_1794600000.json.gz
diff --git a/weather/src/test/resources/wx/expected/-33.87_151.21_1794600000.json.gz b/weather/src/test/resources/wx/expected/-33.87_151.21_1794600000.json.gznew file mode 100644index 0000000000..8c49efb096Binary files /dev/null and b/weather/src/test/resources/wx/expected/-33.87_151.21_1794600000.json.gz differ
weather/src/test/resources/wx/expected/-33.87_151.21_1794617999.json.gz
diff --git a/weather/src/test/resources/wx/expected/-33.87_151.21_1794617999.json.gz b/weather/src/test/resources/wx/expected/-33.87_151.21_1794617999.json.gznew file mode 100644index 0000000000..05460f533aBinary files /dev/null and b/weather/src/test/resources/wx/expected/-33.87_151.21_1794617999.json.gz differ
weather/src/test/resources/wx/expected/-33.87_151.21_1794708000.json.gz
diff --git a/weather/src/test/resources/wx/expected/-33.87_151.21_1794708000.json.gz b/weather/src/test/resources/wx/expected/-33.87_151.21_1794708000.json.gznew file mode 100644index 0000000000..e8b6eafc4bBinary files /dev/null and b/weather/src/test/resources/wx/expected/-33.87_151.21_1794708000.json.gz differ
weather/src/test/resources/wx/expected/1.35_103.82_1794600000.json.gz
diff --git a/weather/src/test/resources/wx/expected/1.35_103.82_1794600000.json.gz b/weather/src/test/resources/wx/expected/1.35_103.82_1794600000.json.gznew file mode 100644index 0000000000..06b577c8a0Binary files /dev/null and b/weather/src/test/resources/wx/expected/1.35_103.82_1794600000.json.gz differ
weather/src/test/resources/wx/expected/1.35_103.82_1794617999.json.gz
diff --git a/weather/src/test/resources/wx/expected/1.35_103.82_1794617999.json.gz b/weather/src/test/resources/wx/expected/1.35_103.82_1794617999.json.gznew file mode 100644index 0000000000..03db81ec8eBinary files /dev/null and b/weather/src/test/resources/wx/expected/1.35_103.82_1794617999.json.gz differ
weather/src/test/resources/wx/expected/1.35_103.82_1794708000.json.gz
diff --git a/weather/src/test/resources/wx/expected/1.35_103.82_1794708000.json.gz b/weather/src/test/resources/wx/expected/1.35_103.82_1794708000.json.gznew file mode 100644index 0000000000..8b46671868Binary files /dev/null and b/weather/src/test/resources/wx/expected/1.35_103.82_1794708000.json.gz differ
weather/src/test/resources/wx/expected/28.61_77.21_1794600000.json.gz
diff --git a/weather/src/test/resources/wx/expected/28.61_77.21_1794600000.json.gz b/weather/src/test/resources/wx/expected/28.61_77.21_1794600000.json.gznew file mode 100644index 0000000000..c66beded96Binary files /dev/null and b/weather/src/test/resources/wx/expected/28.61_77.21_1794600000.json.gz differ
weather/src/test/resources/wx/expected/28.61_77.21_1794617999.json.gz
diff --git a/weather/src/test/resources/wx/expected/28.61_77.21_1794617999.json.gz b/weather/src/test/resources/wx/expected/28.61_77.21_1794617999.json.gznew file mode 100644index 0000000000..12981f36e2Binary files /dev/null and b/weather/src/test/resources/wx/expected/28.61_77.21_1794617999.json.gz differ
weather/src/test/resources/wx/expected/28.61_77.21_1794708000.json.gz
diff --git a/weather/src/test/resources/wx/expected/28.61_77.21_1794708000.json.gz b/weather/src/test/resources/wx/expected/28.61_77.21_1794708000.json.gznew file mode 100644index 0000000000..a35ac37864Binary files /dev/null and b/weather/src/test/resources/wx/expected/28.61_77.21_1794708000.json.gz differ
weather/src/test/resources/wx/expected/33.45_-112.07_1794600000.json.gz
diff --git a/weather/src/test/resources/wx/expected/33.45_-112.07_1794600000.json.gz b/weather/src/test/resources/wx/expected/33.45_-112.07_1794600000.json.gznew file mode 100644index 0000000000..691b2913c4Binary files /dev/null and b/weather/src/test/resources/wx/expected/33.45_-112.07_1794600000.json.gz differ
weather/src/test/resources/wx/expected/33.45_-112.07_1794617999.json.gz
diff --git a/weather/src/test/resources/wx/expected/33.45_-112.07_1794617999.json.gz b/weather/src/test/resources/wx/expected/33.45_-112.07_1794617999.json.gznew file mode 100644index 0000000000..d44ae714eeBinary files /dev/null and b/weather/src/test/resources/wx/expected/33.45_-112.07_1794617999.json.gz differ
weather/src/test/resources/wx/expected/33.45_-112.07_1794708000.json.gz
diff --git a/weather/src/test/resources/wx/expected/33.45_-112.07_1794708000.json.gz b/weather/src/test/resources/wx/expected/33.45_-112.07_1794708000.json.gznew file mode 100644index 0000000000..5d4055c006Binary files /dev/null and b/weather/src/test/resources/wx/expected/33.45_-112.07_1794708000.json.gz differ
weather/src/test/resources/wx/expected/34.05_-118.24_1794600000.json.gz
diff --git a/weather/src/test/resources/wx/expected/34.05_-118.24_1794600000.json.gz b/weather/src/test/resources/wx/expected/34.05_-118.24_1794600000.json.gznew file mode 100644index 0000000000..a72c16a1dbBinary files /dev/null and b/weather/src/test/resources/wx/expected/34.05_-118.24_1794600000.json.gz differ
weather/src/test/resources/wx/expected/34.05_-118.24_1794617999.json.gz
diff --git a/weather/src/test/resources/wx/expected/34.05_-118.24_1794617999.json.gz b/weather/src/test/resources/wx/expected/34.05_-118.24_1794617999.json.gznew file mode 100644index 0000000000..722613f9a5Binary files /dev/null and b/weather/src/test/resources/wx/expected/34.05_-118.24_1794617999.json.gz differ
weather/src/test/resources/wx/expected/34.05_-118.24_1794708000.json.gz
diff --git a/weather/src/test/resources/wx/expected/34.05_-118.24_1794708000.json.gz b/weather/src/test/resources/wx/expected/34.05_-118.24_1794708000.json.gznew file mode 100644index 0000000000..8ac0a80f0aBinary files /dev/null and b/weather/src/test/resources/wx/expected/34.05_-118.24_1794708000.json.gz differ
weather/src/test/resources/wx/expected/35.68_139.69_1794600000.json.gz
diff --git a/weather/src/test/resources/wx/expected/35.68_139.69_1794600000.json.gz b/weather/src/test/resources/wx/expected/35.68_139.69_1794600000.json.gznew file mode 100644index 0000000000..9175b52357Binary files /dev/null and b/weather/src/test/resources/wx/expected/35.68_139.69_1794600000.json.gz differ
weather/src/test/resources/wx/expected/35.68_139.69_1794617999.json.gz
diff --git a/weather/src/test/resources/wx/expected/35.68_139.69_1794617999.json.gz b/weather/src/test/resources/wx/expected/35.68_139.69_1794617999.json.gznew file mode 100644index 0000000000..2baca36d1dBinary files /dev/null and b/weather/src/test/resources/wx/expected/35.68_139.69_1794617999.json.gz differ
weather/src/test/resources/wx/expected/35.68_139.69_1794708000.json.gz
diff --git a/weather/src/test/resources/wx/expected/35.68_139.69_1794708000.json.gz b/weather/src/test/resources/wx/expected/35.68_139.69_1794708000.json.gznew file mode 100644index 0000000000..beaf8423d7Binary files /dev/null and b/weather/src/test/resources/wx/expected/35.68_139.69_1794708000.json.gz differ
weather/src/test/resources/wx/expected/40.71_-74.01_1794600000.json.gz
diff --git a/weather/src/test/resources/wx/expected/40.71_-74.01_1794600000.json.gz b/weather/src/test/resources/wx/expected/40.71_-74.01_1794600000.json.gznew file mode 100644index 0000000000..49ab20cfdaBinary files /dev/null and b/weather/src/test/resources/wx/expected/40.71_-74.01_1794600000.json.gz differ
weather/src/test/resources/wx/expected/40.71_-74.01_1794617999.json.gz
diff --git a/weather/src/test/resources/wx/expected/40.71_-74.01_1794617999.json.gz b/weather/src/test/resources/wx/expected/40.71_-74.01_1794617999.json.gznew file mode 100644index 0000000000..35bb75ffb2Binary files /dev/null and b/weather/src/test/resources/wx/expected/40.71_-74.01_1794617999.json.gz differ
weather/src/test/resources/wx/expected/40.71_-74.01_1794708000.json.gz
diff --git a/weather/src/test/resources/wx/expected/40.71_-74.01_1794708000.json.gz b/weather/src/test/resources/wx/expected/40.71_-74.01_1794708000.json.gznew file mode 100644index 0000000000..67ba36d50eBinary files /dev/null and b/weather/src/test/resources/wx/expected/40.71_-74.01_1794708000.json.gz differ
weather/src/test/resources/wx/expected/51.51_-0.13_1794600000.json.gz
diff --git a/weather/src/test/resources/wx/expected/51.51_-0.13_1794600000.json.gz b/weather/src/test/resources/wx/expected/51.51_-0.13_1794600000.json.gznew file mode 100644index 0000000000..5eaa3092a5Binary files /dev/null and b/weather/src/test/resources/wx/expected/51.51_-0.13_1794600000.json.gz differ
weather/src/test/resources/wx/expected/51.51_-0.13_1794617999.json.gz
diff --git a/weather/src/test/resources/wx/expected/51.51_-0.13_1794617999.json.gz b/weather/src/test/resources/wx/expected/51.51_-0.13_1794617999.json.gznew file mode 100644index 0000000000..dab86b764fBinary files /dev/null and b/weather/src/test/resources/wx/expected/51.51_-0.13_1794617999.json.gz differ
weather/src/test/resources/wx/expected/51.51_-0.13_1794708000.json.gz
diff --git a/weather/src/test/resources/wx/expected/51.51_-0.13_1794708000.json.gz b/weather/src/test/resources/wx/expected/51.51_-0.13_1794708000.json.gznew file mode 100644index 0000000000..f436262ad7Binary files /dev/null and b/weather/src/test/resources/wx/expected/51.51_-0.13_1794708000.json.gz differ
weather/src/test/resources/wx/expected/52.52_13.4_1794600000.json.gz
diff --git a/weather/src/test/resources/wx/expected/52.52_13.4_1794600000.json.gz b/weather/src/test/resources/wx/expected/52.52_13.4_1794600000.json.gznew file mode 100644index 0000000000..4f94959744Binary files /dev/null and b/weather/src/test/resources/wx/expected/52.52_13.4_1794600000.json.gz differ
weather/src/test/resources/wx/expected/52.52_13.4_1794617999.json.gz
diff --git a/weather/src/test/resources/wx/expected/52.52_13.4_1794617999.json.gz b/weather/src/test/resources/wx/expected/52.52_13.4_1794617999.json.gznew file mode 100644index 0000000000..80852272d1Binary files /dev/null and b/weather/src/test/resources/wx/expected/52.52_13.4_1794617999.json.gz differ
weather/src/test/resources/wx/expected/52.52_13.4_1794708000.json.gz
diff --git a/weather/src/test/resources/wx/expected/52.52_13.4_1794708000.json.gz b/weather/src/test/resources/wx/expected/52.52_13.4_1794708000.json.gznew file mode 100644index 0000000000..c4382df662Binary files /dev/null and b/weather/src/test/resources/wx/expected/52.52_13.4_1794708000.json.gz differ
weather/src/test/resources/wx/expected/59.33_18.07_1794600000.json.gz
diff --git a/weather/src/test/resources/wx/expected/59.33_18.07_1794600000.json.gz b/weather/src/test/resources/wx/expected/59.33_18.07_1794600000.json.gznew file mode 100644index 0000000000..6ab5e42ab3Binary files /dev/null and b/weather/src/test/resources/wx/expected/59.33_18.07_1794600000.json.gz differ
weather/src/test/resources/wx/expected/59.33_18.07_1794617999.json.gz
diff --git a/weather/src/test/resources/wx/expected/59.33_18.07_1794617999.json.gz b/weather/src/test/resources/wx/expected/59.33_18.07_1794617999.json.gznew file mode 100644index 0000000000..2904f25f82Binary files /dev/null and b/weather/src/test/resources/wx/expected/59.33_18.07_1794617999.json.gz differ
weather/src/test/resources/wx/expected/59.33_18.07_1794708000.json.gz
diff --git a/weather/src/test/resources/wx/expected/59.33_18.07_1794708000.json.gz b/weather/src/test/resources/wx/expected/59.33_18.07_1794708000.json.gznew file mode 100644index 0000000000..444c70833cBinary files /dev/null and b/weather/src/test/resources/wx/expected/59.33_18.07_1794708000.json.gz differ
weather/src/test/resources/wx/geo/v1/175/408/14.wxg
diff --git a/weather/src/test/resources/wx/geo/v1/175/408/14.wxg b/weather/src/test/resources/wx/geo/v1/175/408/14.wxgnew file mode 100644index 0000000000..58ade71539Binary files /dev/null and b/weather/src/test/resources/wx/geo/v1/175/408/14.wxg differ
weather/src/test/resources/wx/geo/v1/193/410/12.wxg
diff --git a/weather/src/test/resources/wx/geo/v1/193/410/12.wxg b/weather/src/test/resources/wx/geo/v1/193/410/12.wxgnew file mode 100644index 0000000000..b610b5d6aaBinary files /dev/null and b/weather/src/test/resources/wx/geo/v1/193/410/12.wxg differ
weather/src/test/resources/wx/geo/v1/301/385/1.wxg
diff --git a/weather/src/test/resources/wx/geo/v1/301/385/1.wxg b/weather/src/test/resources/wx/geo/v1/301/385/1.wxgnew file mode 100644index 0000000000..e19a1bbbc4Binary files /dev/null and b/weather/src/test/resources/wx/geo/v1/301/385/1.wxg differ
weather/src/test/resources/wx/geo/v1/379/580/13.wxg
diff --git a/weather/src/test/resources/wx/geo/v1/379/580/13.wxg b/weather/src/test/resources/wx/geo/v1/379/580/13.wxgnew file mode 100644index 0000000000..979a15dd2bBinary files /dev/null and b/weather/src/test/resources/wx/geo/v1/379/580/13.wxg differ
weather/src/test/resources/wx/geo/v1/511/340/6.wxg
diff --git a/weather/src/test/resources/wx/geo/v1/511/340/6.wxg b/weather/src/test/resources/wx/geo/v1/511/340/6.wxgnew file mode 100644index 0000000000..f6861d9a2fBinary files /dev/null and b/weather/src/test/resources/wx/geo/v1/511/340/6.wxg differ
weather/src/test/resources/wx/geo/v1/550/335/12.wxg
diff --git a/weather/src/test/resources/wx/geo/v1/550/335/12.wxg b/weather/src/test/resources/wx/geo/v1/550/335/12.wxgnew file mode 100644index 0000000000..2603970a68Binary files /dev/null and b/weather/src/test/resources/wx/geo/v1/550/335/12.wxg differ
weather/src/test/resources/wx/geo/v1/563/301/1.wxg
diff --git a/weather/src/test/resources/wx/geo/v1/563/301/1.wxg b/weather/src/test/resources/wx/geo/v1/563/301/1.wxgnew file mode 100644index 0000000000..0ae720b67fBinary files /dev/null and b/weather/src/test/resources/wx/geo/v1/563/301/1.wxg differ
weather/src/test/resources/wx/geo/v1/731/427/2.wxg
diff --git a/weather/src/test/resources/wx/geo/v1/731/427/2.wxg b/weather/src/test/resources/wx/geo/v1/731/427/2.wxgnew file mode 100644index 0000000000..55c5c9e009Binary files /dev/null and b/weather/src/test/resources/wx/geo/v1/731/427/2.wxg differ
weather/src/test/resources/wx/geo/v1/807/508/1.wxg
diff --git a/weather/src/test/resources/wx/geo/v1/807/508/1.wxg b/weather/src/test/resources/wx/geo/v1/807/508/1.wxgnew file mode 100644index 0000000000..082e85f0d8Binary files /dev/null and b/weather/src/test/resources/wx/geo/v1/807/508/1.wxg differ
weather/src/test/resources/wx/geo/v1/909/403/1.wxg
diff --git a/weather/src/test/resources/wx/geo/v1/909/403/1.wxg b/weather/src/test/resources/wx/geo/v1/909/403/1.wxgnew file mode 100644index 0000000000..d7bfd718fdBinary files /dev/null and b/weather/src/test/resources/wx/geo/v1/909/403/1.wxg differ
weather/src/test/resources/wx/geo/v1/942/614/4.wxg
diff --git a/weather/src/test/resources/wx/geo/v1/942/614/4.wxg b/weather/src/test/resources/wx/geo/v1/942/614/4.wxgnew file mode 100644index 0000000000..0472a1a0e1Binary files /dev/null and b/weather/src/test/resources/wx/geo/v1/942/614/4.wxg differ
weather/src/test/resources/wx/hist/20762/118/257.wxt
diff --git a/weather/src/test/resources/wx/hist/20762/118/257.wxt b/weather/src/test/resources/wx/hist/20762/118/257.wxtnew file mode 100644index 0000000000..9cbc76dbf2Binary files /dev/null and b/weather/src/test/resources/wx/hist/20762/118/257.wxt differ
weather/src/test/resources/wx/hist/20762/123/67.wxt
diff --git a/weather/src/test/resources/wx/hist/20762/123/67.wxt b/weather/src/test/resources/wx/hist/20762/123/67.wxtnew file mode 100644index 0000000000..b5a2ffe71dBinary files /dev/null and b/weather/src/test/resources/wx/hist/20762/123/67.wxt differ
weather/src/test/resources/wx/hist/20762/124/61.wxt
diff --git a/weather/src/test/resources/wx/hist/20762/124/61.wxt b/weather/src/test/resources/wx/hist/20762/124/61.wxtnew file mode 100644index 0000000000..cf688ea10aBinary files /dev/null and b/weather/src/test/resources/wx/hist/20762/124/61.wxt differ
weather/src/test/resources/wx/hist/20762/125/319.wxt
diff --git a/weather/src/test/resources/wx/hist/20762/125/319.wxt b/weather/src/test/resources/wx/hist/20762/125/319.wxtnew file mode 100644index 0000000000..7e31f83deeBinary files /dev/null and b/weather/src/test/resources/wx/hist/20762/125/319.wxt differ
weather/src/test/resources/wx/hist/20762/130/106.wxt
diff --git a/weather/src/test/resources/wx/hist/20762/130/106.wxt b/weather/src/test/resources/wx/hist/20762/130/106.wxtnew file mode 100644index 0000000000..ece1b3f5a1Binary files /dev/null and b/weather/src/test/resources/wx/hist/20762/130/106.wxt differ
weather/src/test/resources/wx/hist/20762/141/179.wxt
diff --git a/weather/src/test/resources/wx/hist/20762/141/179.wxt b/weather/src/test/resources/wx/hist/20762/141/179.wxtnew file mode 100644index 0000000000..28a4968fc1Binary files /dev/null and b/weather/src/test/resources/wx/hist/20762/141/179.wxt differ
weather/src/test/resources/wx/hist/20762/142/193.wxt
diff --git a/weather/src/test/resources/wx/hist/20762/142/193.wxt b/weather/src/test/resources/wx/hist/20762/142/193.wxtnew file mode 100644index 0000000000..0d7403f9e3Binary files /dev/null and b/weather/src/test/resources/wx/hist/20762/142/193.wxt differ
weather/src/test/resources/wx/hist/20762/149/198.wxt
diff --git a/weather/src/test/resources/wx/hist/20762/149/198.wxt b/weather/src/test/resources/wx/hist/20762/149/198.wxtnew file mode 100644index 0000000000..5f7bb722f5Binary files /dev/null and b/weather/src/test/resources/wx/hist/20762/149/198.wxt differ
weather/src/test/resources/wx/hist/20762/56/331.wxt
diff --git a/weather/src/test/resources/wx/hist/20762/56/331.wxt b/weather/src/test/resources/wx/hist/20762/56/331.wxtnew file mode 100644index 0000000000..69e2747c72Binary files /dev/null and b/weather/src/test/resources/wx/hist/20762/56/331.wxt differ
weather/src/test/resources/wx/hist/20762/66/133.wxt
diff --git a/weather/src/test/resources/wx/hist/20762/66/133.wxt b/weather/src/test/resources/wx/hist/20762/66/133.wxtnew file mode 100644index 0000000000..80fb33c695Binary files /dev/null and b/weather/src/test/resources/wx/hist/20762/66/133.wxt differ
weather/src/test/resources/wx/hist/20762/91/283.wxt
diff --git a/weather/src/test/resources/wx/hist/20762/91/283.wxt b/weather/src/test/resources/wx/hist/20762/91/283.wxtnew file mode 100644index 0000000000..1cd89f3498Binary files /dev/null and b/weather/src/test/resources/wx/hist/20762/91/283.wxt differ
weather/src/test/resources/wx/hist/20763/118/257.wxt
diff --git a/weather/src/test/resources/wx/hist/20763/118/257.wxt b/weather/src/test/resources/wx/hist/20763/118/257.wxtnew file mode 100644index 0000000000..f5cf90f82eBinary files /dev/null and b/weather/src/test/resources/wx/hist/20763/118/257.wxt differ
weather/src/test/resources/wx/hist/20763/123/67.wxt
diff --git a/weather/src/test/resources/wx/hist/20763/123/67.wxt b/weather/src/test/resources/wx/hist/20763/123/67.wxtnew file mode 100644index 0000000000..d837b7d7eeBinary files /dev/null and b/weather/src/test/resources/wx/hist/20763/123/67.wxt differ
weather/src/test/resources/wx/hist/20763/124/61.wxt
diff --git a/weather/src/test/resources/wx/hist/20763/124/61.wxt b/weather/src/test/resources/wx/hist/20763/124/61.wxtnew file mode 100644index 0000000000..da22613c82Binary files /dev/null and b/weather/src/test/resources/wx/hist/20763/124/61.wxt differ
weather/src/test/resources/wx/hist/20763/125/319.wxt
diff --git a/weather/src/test/resources/wx/hist/20763/125/319.wxt b/weather/src/test/resources/wx/hist/20763/125/319.wxtnew file mode 100644index 0000000000..144f6b6d7cBinary files /dev/null and b/weather/src/test/resources/wx/hist/20763/125/319.wxt differ
weather/src/test/resources/wx/hist/20763/130/106.wxt
diff --git a/weather/src/test/resources/wx/hist/20763/130/106.wxt b/weather/src/test/resources/wx/hist/20763/130/106.wxtnew file mode 100644index 0000000000..c70f699bb8Binary files /dev/null and b/weather/src/test/resources/wx/hist/20763/130/106.wxt differ
weather/src/test/resources/wx/hist/20763/141/179.wxt
diff --git a/weather/src/test/resources/wx/hist/20763/141/179.wxt b/weather/src/test/resources/wx/hist/20763/141/179.wxtnew file mode 100644index 0000000000..4cd9c8cfb5Binary files /dev/null and b/weather/src/test/resources/wx/hist/20763/141/179.wxt differ
weather/src/test/resources/wx/hist/20763/142/193.wxt
diff --git a/weather/src/test/resources/wx/hist/20763/142/193.wxt b/weather/src/test/resources/wx/hist/20763/142/193.wxtnew file mode 100644index 0000000000..d7ac246a9dBinary files /dev/null and b/weather/src/test/resources/wx/hist/20763/142/193.wxt differ
weather/src/test/resources/wx/hist/20763/149/198.wxt
diff --git a/weather/src/test/resources/wx/hist/20763/149/198.wxt b/weather/src/test/resources/wx/hist/20763/149/198.wxtnew file mode 100644index 0000000000..8861e24866Binary files /dev/null and b/weather/src/test/resources/wx/hist/20763/149/198.wxt differ
weather/src/test/resources/wx/hist/20763/56/331.wxt
diff --git a/weather/src/test/resources/wx/hist/20763/56/331.wxt b/weather/src/test/resources/wx/hist/20763/56/331.wxtnew file mode 100644index 0000000000..8aa534757dBinary files /dev/null and b/weather/src/test/resources/wx/hist/20763/56/331.wxt differ
weather/src/test/resources/wx/hist/20763/66/133.wxt
diff --git a/weather/src/test/resources/wx/hist/20763/66/133.wxt b/weather/src/test/resources/wx/hist/20763/66/133.wxtnew file mode 100644index 0000000000..72bdbd9d6fBinary files /dev/null and b/weather/src/test/resources/wx/hist/20763/66/133.wxt differ
weather/src/test/resources/wx/hist/20763/91/283.wxt
diff --git a/weather/src/test/resources/wx/hist/20763/91/283.wxt b/weather/src/test/resources/wx/hist/20763/91/283.wxtnew file mode 100644index 0000000000..d399d9a214Binary files /dev/null and b/weather/src/test/resources/wx/hist/20763/91/283.wxt differ
weather/src/test/resources/wx/hist/20764/118/257.wxt
diff --git a/weather/src/test/resources/wx/hist/20764/118/257.wxt b/weather/src/test/resources/wx/hist/20764/118/257.wxtnew file mode 100644index 0000000000..9a737b7e82Binary files /dev/null and b/weather/src/test/resources/wx/hist/20764/118/257.wxt differ
weather/src/test/resources/wx/hist/20764/123/67.wxt
diff --git a/weather/src/test/resources/wx/hist/20764/123/67.wxt b/weather/src/test/resources/wx/hist/20764/123/67.wxtnew file mode 100644index 0000000000..7f6ed96238Binary files /dev/null and b/weather/src/test/resources/wx/hist/20764/123/67.wxt differ
weather/src/test/resources/wx/hist/20764/124/61.wxt
diff --git a/weather/src/test/resources/wx/hist/20764/124/61.wxt b/weather/src/test/resources/wx/hist/20764/124/61.wxtnew file mode 100644index 0000000000..c6f289a9faBinary files /dev/null and b/weather/src/test/resources/wx/hist/20764/124/61.wxt differ
weather/src/test/resources/wx/hist/20764/125/319.wxt
diff --git a/weather/src/test/resources/wx/hist/20764/125/319.wxt b/weather/src/test/resources/wx/hist/20764/125/319.wxtnew file mode 100644index 0000000000..b318fe39edBinary files /dev/null and b/weather/src/test/resources/wx/hist/20764/125/319.wxt differ
weather/src/test/resources/wx/hist/20764/130/106.wxt
diff --git a/weather/src/test/resources/wx/hist/20764/130/106.wxt b/weather/src/test/resources/wx/hist/20764/130/106.wxtnew file mode 100644index 0000000000..818d278fc6Binary files /dev/null and b/weather/src/test/resources/wx/hist/20764/130/106.wxt differ
weather/src/test/resources/wx/hist/20764/141/179.wxt
diff --git a/weather/src/test/resources/wx/hist/20764/141/179.wxt b/weather/src/test/resources/wx/hist/20764/141/179.wxtnew file mode 100644index 0000000000..366b91a917Binary files /dev/null and b/weather/src/test/resources/wx/hist/20764/141/179.wxt differ
weather/src/test/resources/wx/hist/20764/142/193.wxt
diff --git a/weather/src/test/resources/wx/hist/20764/142/193.wxt b/weather/src/test/resources/wx/hist/20764/142/193.wxtnew file mode 100644index 0000000000..52fbf52fe7Binary files /dev/null and b/weather/src/test/resources/wx/hist/20764/142/193.wxt differ
weather/src/test/resources/wx/hist/20764/149/198.wxt
diff --git a/weather/src/test/resources/wx/hist/20764/149/198.wxt b/weather/src/test/resources/wx/hist/20764/149/198.wxtnew file mode 100644index 0000000000..6d0b185216Binary files /dev/null and b/weather/src/test/resources/wx/hist/20764/149/198.wxt differ
weather/src/test/resources/wx/hist/20764/56/331.wxt
diff --git a/weather/src/test/resources/wx/hist/20764/56/331.wxt b/weather/src/test/resources/wx/hist/20764/56/331.wxtnew file mode 100644index 0000000000..bd6844a675Binary files /dev/null and b/weather/src/test/resources/wx/hist/20764/56/331.wxt differ
weather/src/test/resources/wx/hist/20764/66/133.wxt
diff --git a/weather/src/test/resources/wx/hist/20764/66/133.wxt b/weather/src/test/resources/wx/hist/20764/66/133.wxtnew file mode 100644index 0000000000..9b787dd2deBinary files /dev/null and b/weather/src/test/resources/wx/hist/20764/66/133.wxt differ
weather/src/test/resources/wx/hist/20764/91/283.wxt
diff --git a/weather/src/test/resources/wx/hist/20764/91/283.wxt b/weather/src/test/resources/wx/hist/20764/91/283.wxtnew file mode 100644index 0000000000..6521263108Binary files /dev/null and b/weather/src/test/resources/wx/hist/20764/91/283.wxt differ
weather/src/test/resources/wx/hist/20765/118/257.wxt
diff --git a/weather/src/test/resources/wx/hist/20765/118/257.wxt b/weather/src/test/resources/wx/hist/20765/118/257.wxtnew file mode 100644index 0000000000..4e0cdab023Binary files /dev/null and b/weather/src/test/resources/wx/hist/20765/118/257.wxt differ
weather/src/test/resources/wx/hist/20765/123/67.wxt
diff --git a/weather/src/test/resources/wx/hist/20765/123/67.wxt b/weather/src/test/resources/wx/hist/20765/123/67.wxtnew file mode 100644index 0000000000..8398215efbBinary files /dev/null and b/weather/src/test/resources/wx/hist/20765/123/67.wxt differ
weather/src/test/resources/wx/hist/20765/124/61.wxt
diff --git a/weather/src/test/resources/wx/hist/20765/124/61.wxt b/weather/src/test/resources/wx/hist/20765/124/61.wxtnew file mode 100644index 0000000000..a910eec79aBinary files /dev/null and b/weather/src/test/resources/wx/hist/20765/124/61.wxt differ
weather/src/test/resources/wx/hist/20765/125/319.wxt
diff --git a/weather/src/test/resources/wx/hist/20765/125/319.wxt b/weather/src/test/resources/wx/hist/20765/125/319.wxtnew file mode 100644index 0000000000..5ad0abab67Binary files /dev/null and b/weather/src/test/resources/wx/hist/20765/125/319.wxt differ
weather/src/test/resources/wx/hist/20765/130/106.wxt
diff --git a/weather/src/test/resources/wx/hist/20765/130/106.wxt b/weather/src/test/resources/wx/hist/20765/130/106.wxtnew file mode 100644index 0000000000..4445e8ecbfBinary files /dev/null and b/weather/src/test/resources/wx/hist/20765/130/106.wxt differ
weather/src/test/resources/wx/hist/20765/141/179.wxt
diff --git a/weather/src/test/resources/wx/hist/20765/141/179.wxt b/weather/src/test/resources/wx/hist/20765/141/179.wxtnew file mode 100644index 0000000000..1ebb1f5509Binary files /dev/null and b/weather/src/test/resources/wx/hist/20765/141/179.wxt differ
weather/src/test/resources/wx/hist/20765/142/193.wxt
diff --git a/weather/src/test/resources/wx/hist/20765/142/193.wxt b/weather/src/test/resources/wx/hist/20765/142/193.wxtnew file mode 100644index 0000000000..94da2e19dcBinary files /dev/null and b/weather/src/test/resources/wx/hist/20765/142/193.wxt differ
weather/src/test/resources/wx/hist/20765/149/198.wxt
diff --git a/weather/src/test/resources/wx/hist/20765/149/198.wxt b/weather/src/test/resources/wx/hist/20765/149/198.wxtnew file mode 100644index 0000000000..3a3a3dfc1fBinary files /dev/null and b/weather/src/test/resources/wx/hist/20765/149/198.wxt differ
weather/src/test/resources/wx/hist/20765/56/331.wxt
diff --git a/weather/src/test/resources/wx/hist/20765/56/331.wxt b/weather/src/test/resources/wx/hist/20765/56/331.wxtnew file mode 100644index 0000000000..329313a686Binary files /dev/null and b/weather/src/test/resources/wx/hist/20765/56/331.wxt differ
weather/src/test/resources/wx/hist/20765/66/133.wxt
diff --git a/weather/src/test/resources/wx/hist/20765/66/133.wxt b/weather/src/test/resources/wx/hist/20765/66/133.wxtnew file mode 100644index 0000000000..2aacd94e1bBinary files /dev/null and b/weather/src/test/resources/wx/hist/20765/66/133.wxt differ
weather/src/test/resources/wx/hist/20765/91/283.wxt
diff --git a/weather/src/test/resources/wx/hist/20765/91/283.wxt b/weather/src/test/resources/wx/hist/20765/91/283.wxtnew file mode 100644index 0000000000..a6c6808e91Binary files /dev/null and b/weather/src/test/resources/wx/hist/20765/91/283.wxt differ
weather/src/test/resources/wx/hist/20766/118/257.wxt
diff --git a/weather/src/test/resources/wx/hist/20766/118/257.wxt b/weather/src/test/resources/wx/hist/20766/118/257.wxtnew file mode 100644index 0000000000..82c7e9c515Binary files /dev/null and b/weather/src/test/resources/wx/hist/20766/118/257.wxt differ
weather/src/test/resources/wx/hist/20766/123/67.wxt
diff --git a/weather/src/test/resources/wx/hist/20766/123/67.wxt b/weather/src/test/resources/wx/hist/20766/123/67.wxtnew file mode 100644index 0000000000..4173a07a20Binary files /dev/null and b/weather/src/test/resources/wx/hist/20766/123/67.wxt differ
weather/src/test/resources/wx/hist/20766/124/61.wxt
diff --git a/weather/src/test/resources/wx/hist/20766/124/61.wxt b/weather/src/test/resources/wx/hist/20766/124/61.wxtnew file mode 100644index 0000000000..f04af12ea1Binary files /dev/null and b/weather/src/test/resources/wx/hist/20766/124/61.wxt differ
weather/src/test/resources/wx/hist/20766/125/319.wxt
diff --git a/weather/src/test/resources/wx/hist/20766/125/319.wxt b/weather/src/test/resources/wx/hist/20766/125/319.wxtnew file mode 100644index 0000000000..97b4ce1562Binary files /dev/null and b/weather/src/test/resources/wx/hist/20766/125/319.wxt differ
weather/src/test/resources/wx/hist/20766/130/106.wxt
diff --git a/weather/src/test/resources/wx/hist/20766/130/106.wxt b/weather/src/test/resources/wx/hist/20766/130/106.wxtnew file mode 100644index 0000000000..43b968e71aBinary files /dev/null and b/weather/src/test/resources/wx/hist/20766/130/106.wxt differ
weather/src/test/resources/wx/hist/20766/141/179.wxt
diff --git a/weather/src/test/resources/wx/hist/20766/141/179.wxt b/weather/src/test/resources/wx/hist/20766/141/179.wxtnew file mode 100644index 0000000000..852a9b7055Binary files /dev/null and b/weather/src/test/resources/wx/hist/20766/141/179.wxt differ
weather/src/test/resources/wx/hist/20766/142/193.wxt
diff --git a/weather/src/test/resources/wx/hist/20766/142/193.wxt b/weather/src/test/resources/wx/hist/20766/142/193.wxtnew file mode 100644index 0000000000..873ade0837Binary files /dev/null and b/weather/src/test/resources/wx/hist/20766/142/193.wxt differ
weather/src/test/resources/wx/hist/20766/149/198.wxt
diff --git a/weather/src/test/resources/wx/hist/20766/149/198.wxt b/weather/src/test/resources/wx/hist/20766/149/198.wxtnew file mode 100644index 0000000000..86c03c8ec2Binary files /dev/null and b/weather/src/test/resources/wx/hist/20766/149/198.wxt differ
weather/src/test/resources/wx/hist/20766/56/331.wxt
diff --git a/weather/src/test/resources/wx/hist/20766/56/331.wxt b/weather/src/test/resources/wx/hist/20766/56/331.wxtnew file mode 100644index 0000000000..93d62573f2Binary files /dev/null and b/weather/src/test/resources/wx/hist/20766/56/331.wxt differ
weather/src/test/resources/wx/hist/20766/66/133.wxt
diff --git a/weather/src/test/resources/wx/hist/20766/66/133.wxt b/weather/src/test/resources/wx/hist/20766/66/133.wxtnew file mode 100644index 0000000000..4ac76ad6c9Binary files /dev/null and b/weather/src/test/resources/wx/hist/20766/66/133.wxt differ
weather/src/test/resources/wx/hist/20766/91/283.wxt
diff --git a/weather/src/test/resources/wx/hist/20766/91/283.wxt b/weather/src/test/resources/wx/hist/20766/91/283.wxtnew file mode 100644index 0000000000..7615bc4a59Binary files /dev/null and b/weather/src/test/resources/wx/hist/20766/91/283.wxt differ
weather/src/test/resources/wx/hist/20767/118/257.wxt
diff --git a/weather/src/test/resources/wx/hist/20767/118/257.wxt b/weather/src/test/resources/wx/hist/20767/118/257.wxtnew file mode 100644index 0000000000..4b08b44ffcBinary files /dev/null and b/weather/src/test/resources/wx/hist/20767/118/257.wxt differ
weather/src/test/resources/wx/hist/20767/123/67.wxt
diff --git a/weather/src/test/resources/wx/hist/20767/123/67.wxt b/weather/src/test/resources/wx/hist/20767/123/67.wxtnew file mode 100644index 0000000000..4fa74dc53dBinary files /dev/null and b/weather/src/test/resources/wx/hist/20767/123/67.wxt differ
weather/src/test/resources/wx/hist/20767/124/61.wxt
diff --git a/weather/src/test/resources/wx/hist/20767/124/61.wxt b/weather/src/test/resources/wx/hist/20767/124/61.wxtnew file mode 100644index 0000000000..feea777f94Binary files /dev/null and b/weather/src/test/resources/wx/hist/20767/124/61.wxt differ
weather/src/test/resources/wx/hist/20767/125/319.wxt
diff --git a/weather/src/test/resources/wx/hist/20767/125/319.wxt b/weather/src/test/resources/wx/hist/20767/125/319.wxtnew file mode 100644index 0000000000..fcfbe6362aBinary files /dev/null and b/weather/src/test/resources/wx/hist/20767/125/319.wxt differ
weather/src/test/resources/wx/hist/20767/130/106.wxt
diff --git a/weather/src/test/resources/wx/hist/20767/130/106.wxt b/weather/src/test/resources/wx/hist/20767/130/106.wxtnew file mode 100644index 0000000000..e05bde92f9Binary files /dev/null and b/weather/src/test/resources/wx/hist/20767/130/106.wxt differ
weather/src/test/resources/wx/hist/20767/141/179.wxt
diff --git a/weather/src/test/resources/wx/hist/20767/141/179.wxt b/weather/src/test/resources/wx/hist/20767/141/179.wxtnew file mode 100644index 0000000000..7a78f9d98fBinary files /dev/null and b/weather/src/test/resources/wx/hist/20767/141/179.wxt differ
weather/src/test/resources/wx/hist/20767/142/193.wxt
diff --git a/weather/src/test/resources/wx/hist/20767/142/193.wxt b/weather/src/test/resources/wx/hist/20767/142/193.wxtnew file mode 100644index 0000000000..15e8d1e9f5Binary files /dev/null and b/weather/src/test/resources/wx/hist/20767/142/193.wxt differ
weather/src/test/resources/wx/hist/20767/149/198.wxt
diff --git a/weather/src/test/resources/wx/hist/20767/149/198.wxt b/weather/src/test/resources/wx/hist/20767/149/198.wxtnew file mode 100644index 0000000000..32fed554e7Binary files /dev/null and b/weather/src/test/resources/wx/hist/20767/149/198.wxt differ
weather/src/test/resources/wx/hist/20767/56/331.wxt
diff --git a/weather/src/test/resources/wx/hist/20767/56/331.wxt b/weather/src/test/resources/wx/hist/20767/56/331.wxtnew file mode 100644index 0000000000..a23793a4d5Binary files /dev/null and b/weather/src/test/resources/wx/hist/20767/56/331.wxt differ
weather/src/test/resources/wx/hist/20767/66/133.wxt
diff --git a/weather/src/test/resources/wx/hist/20767/66/133.wxt b/weather/src/test/resources/wx/hist/20767/66/133.wxtnew file mode 100644index 0000000000..b4c648888eBinary files /dev/null and b/weather/src/test/resources/wx/hist/20767/66/133.wxt differ
weather/src/test/resources/wx/hist/20767/91/283.wxt
diff --git a/weather/src/test/resources/wx/hist/20767/91/283.wxt b/weather/src/test/resources/wx/hist/20767/91/283.wxtnew file mode 100644index 0000000000..10a2cb4ab0Binary files /dev/null and b/weather/src/test/resources/wx/hist/20767/91/283.wxt differ
weather/src/test/resources/wx/hist/20768/118/257.wxt
diff --git a/weather/src/test/resources/wx/hist/20768/118/257.wxt b/weather/src/test/resources/wx/hist/20768/118/257.wxtnew file mode 100644index 0000000000..970cc5b1a0Binary files /dev/null and b/weather/src/test/resources/wx/hist/20768/118/257.wxt differ
weather/src/test/resources/wx/hist/20768/123/67.wxt
diff --git a/weather/src/test/resources/wx/hist/20768/123/67.wxt b/weather/src/test/resources/wx/hist/20768/123/67.wxtnew file mode 100644index 0000000000..11d26ec8e9Binary files /dev/null and b/weather/src/test/resources/wx/hist/20768/123/67.wxt differ
weather/src/test/resources/wx/hist/20768/124/61.wxt
diff --git a/weather/src/test/resources/wx/hist/20768/124/61.wxt b/weather/src/test/resources/wx/hist/20768/124/61.wxtnew file mode 100644index 0000000000..7762bdc068Binary files /dev/null and b/weather/src/test/resources/wx/hist/20768/124/61.wxt differ
weather/src/test/resources/wx/hist/20768/125/319.wxt
diff --git a/weather/src/test/resources/wx/hist/20768/125/319.wxt b/weather/src/test/resources/wx/hist/20768/125/319.wxtnew file mode 100644index 0000000000..c52e24dfe9Binary files /dev/null and b/weather/src/test/resources/wx/hist/20768/125/319.wxt differ
weather/src/test/resources/wx/hist/20768/130/106.wxt
diff --git a/weather/src/test/resources/wx/hist/20768/130/106.wxt b/weather/src/test/resources/wx/hist/20768/130/106.wxtnew file mode 100644index 0000000000..d5743f461fBinary files /dev/null and b/weather/src/test/resources/wx/hist/20768/130/106.wxt differ
weather/src/test/resources/wx/hist/20768/141/179.wxt
diff --git a/weather/src/test/resources/wx/hist/20768/141/179.wxt b/weather/src/test/resources/wx/hist/20768/141/179.wxtnew file mode 100644index 0000000000..fb5d5a3905Binary files /dev/null and b/weather/src/test/resources/wx/hist/20768/141/179.wxt differ
weather/src/test/resources/wx/hist/20768/142/193.wxt
diff --git a/weather/src/test/resources/wx/hist/20768/142/193.wxt b/weather/src/test/resources/wx/hist/20768/142/193.wxtnew file mode 100644index 0000000000..74a3559762Binary files /dev/null and b/weather/src/test/resources/wx/hist/20768/142/193.wxt differ
weather/src/test/resources/wx/hist/20768/149/198.wxt
diff --git a/weather/src/test/resources/wx/hist/20768/149/198.wxt b/weather/src/test/resources/wx/hist/20768/149/198.wxtnew file mode 100644index 0000000000..eea8462a6dBinary files /dev/null and b/weather/src/test/resources/wx/hist/20768/149/198.wxt differ
weather/src/test/resources/wx/hist/20768/56/331.wxt
diff --git a/weather/src/test/resources/wx/hist/20768/56/331.wxt b/weather/src/test/resources/wx/hist/20768/56/331.wxtnew file mode 100644index 0000000000..73d126d44fBinary files /dev/null and b/weather/src/test/resources/wx/hist/20768/56/331.wxt differ
weather/src/test/resources/wx/hist/20768/66/133.wxt
diff --git a/weather/src/test/resources/wx/hist/20768/66/133.wxt b/weather/src/test/resources/wx/hist/20768/66/133.wxtnew file mode 100644index 0000000000..f6cbe92172Binary files /dev/null and b/weather/src/test/resources/wx/hist/20768/66/133.wxt differ
weather/src/test/resources/wx/hist/20768/91/283.wxt
diff --git a/weather/src/test/resources/wx/hist/20768/91/283.wxt b/weather/src/test/resources/wx/hist/20768/91/283.wxtnew file mode 100644index 0000000000..8c555d0d41Binary files /dev/null and b/weather/src/test/resources/wx/hist/20768/91/283.wxt differ
weather/src/test/resources/wx/hist/20769/118/257.wxt
diff --git a/weather/src/test/resources/wx/hist/20769/118/257.wxt b/weather/src/test/resources/wx/hist/20769/118/257.wxtnew file mode 100644index 0000000000..1a9b5841beBinary files /dev/null and b/weather/src/test/resources/wx/hist/20769/118/257.wxt differ
weather/src/test/resources/wx/hist/20769/123/67.wxt
diff --git a/weather/src/test/resources/wx/hist/20769/123/67.wxt b/weather/src/test/resources/wx/hist/20769/123/67.wxtnew file mode 100644index 0000000000..96d4ca143cBinary files /dev/null and b/weather/src/test/resources/wx/hist/20769/123/67.wxt differ
weather/src/test/resources/wx/hist/20769/124/61.wxt
diff --git a/weather/src/test/resources/wx/hist/20769/124/61.wxt b/weather/src/test/resources/wx/hist/20769/124/61.wxtnew file mode 100644index 0000000000..5fda8072c0Binary files /dev/null and b/weather/src/test/resources/wx/hist/20769/124/61.wxt differ
weather/src/test/resources/wx/hist/20769/125/319.wxt
diff --git a/weather/src/test/resources/wx/hist/20769/125/319.wxt b/weather/src/test/resources/wx/hist/20769/125/319.wxtnew file mode 100644index 0000000000..1a58b62d66Binary files /dev/null and b/weather/src/test/resources/wx/hist/20769/125/319.wxt differ
weather/src/test/resources/wx/hist/20769/130/106.wxt
diff --git a/weather/src/test/resources/wx/hist/20769/130/106.wxt b/weather/src/test/resources/wx/hist/20769/130/106.wxtnew file mode 100644index 0000000000..64ac83c82cBinary files /dev/null and b/weather/src/test/resources/wx/hist/20769/130/106.wxt differ
weather/src/test/resources/wx/hist/20769/141/179.wxt
diff --git a/weather/src/test/resources/wx/hist/20769/141/179.wxt b/weather/src/test/resources/wx/hist/20769/141/179.wxtnew file mode 100644index 0000000000..c62b858e86Binary files /dev/null and b/weather/src/test/resources/wx/hist/20769/141/179.wxt differ
weather/src/test/resources/wx/hist/20769/142/193.wxt
diff --git a/weather/src/test/resources/wx/hist/20769/142/193.wxt b/weather/src/test/resources/wx/hist/20769/142/193.wxtnew file mode 100644index 0000000000..e747575c1fBinary files /dev/null and b/weather/src/test/resources/wx/hist/20769/142/193.wxt differ
weather/src/test/resources/wx/hist/20769/149/198.wxt
diff --git a/weather/src/test/resources/wx/hist/20769/149/198.wxt b/weather/src/test/resources/wx/hist/20769/149/198.wxtnew file mode 100644index 0000000000..21c1e2592eBinary files /dev/null and b/weather/src/test/resources/wx/hist/20769/149/198.wxt differ
weather/src/test/resources/wx/hist/20769/56/331.wxt
diff --git a/weather/src/test/resources/wx/hist/20769/56/331.wxt b/weather/src/test/resources/wx/hist/20769/56/331.wxtnew file mode 100644index 0000000000..ee43014bd3Binary files /dev/null and b/weather/src/test/resources/wx/hist/20769/56/331.wxt differ
weather/src/test/resources/wx/hist/20769/66/133.wxt
diff --git a/weather/src/test/resources/wx/hist/20769/66/133.wxt b/weather/src/test/resources/wx/hist/20769/66/133.wxtnew file mode 100644index 0000000000..10ea8a2d1fBinary files /dev/null and b/weather/src/test/resources/wx/hist/20769/66/133.wxt differ
weather/src/test/resources/wx/hist/20769/91/283.wxt
diff --git a/weather/src/test/resources/wx/hist/20769/91/283.wxt b/weather/src/test/resources/wx/hist/20769/91/283.wxtnew file mode 100644index 0000000000..19b7019117Binary files /dev/null and b/weather/src/test/resources/wx/hist/20769/91/283.wxt differ
weather/src/test/resources/wx/latest.json
diff --git a/weather/src/test/resources/wx/latest.json b/weather/src/test/resources/wx/latest.jsonnew file mode 100644index 0000000000..d585d20bb6--- /dev/null+++ b/weather/src/test/resources/wx/latest.json@@ -0,0 +1,29 @@+{+ "base": "runs/2026111312-1794600000/t/",+ "cams_europe_run_mod": 1794569769,+ "cams_global_run_mod": 1794563303,+ "gen": 1794600000,+ "geo": "geo/v1/",+ "grid": {+ "cells": 8,+ "dx": 0.125,+ "dy": 0.125,+ "lat0": -90.0,+ "lon0": -180.0,+ "model": "dwd_icon",+ "nx": 2879,+ "ny": 1441+ },+ "hist": {+ "base": "hist/",+ "from_day": 20762,+ "to_day": 20770+ },+ "icon_run": "2026-11-13T12:00:00Z",+ "icon_run_mod": 1794584021,+ "index": "runs/2026111312-1794600000/index.json",+ "next_check": 1794607421,+ "run": "2026111312-1794600000",+ "tiles": 52,+ "v": 1+}\ No newline at end of file
weather/src/test/resources/wx/runs/2026111312-1794600000/t/118/257.wxt
diff --git a/weather/src/test/resources/wx/runs/2026111312-1794600000/t/118/257.wxt b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/118/257.wxtnew file mode 100644index 0000000000..bcf28acb53Binary files /dev/null and b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/118/257.wxt differ
weather/src/test/resources/wx/runs/2026111312-1794600000/t/123/67.wxt
diff --git a/weather/src/test/resources/wx/runs/2026111312-1794600000/t/123/67.wxt b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/123/67.wxtnew file mode 100644index 0000000000..ef994c5ce6Binary files /dev/null and b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/123/67.wxt differ
weather/src/test/resources/wx/runs/2026111312-1794600000/t/124/61.wxt
diff --git a/weather/src/test/resources/wx/runs/2026111312-1794600000/t/124/61.wxt b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/124/61.wxtnew file mode 100644index 0000000000..e95438d92bBinary files /dev/null and b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/124/61.wxt differ
weather/src/test/resources/wx/runs/2026111312-1794600000/t/125/319.wxt
diff --git a/weather/src/test/resources/wx/runs/2026111312-1794600000/t/125/319.wxt b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/125/319.wxtnew file mode 100644index 0000000000..cd3b50bc6cBinary files /dev/null and b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/125/319.wxt differ
weather/src/test/resources/wx/runs/2026111312-1794600000/t/130/106.wxt
diff --git a/weather/src/test/resources/wx/runs/2026111312-1794600000/t/130/106.wxt b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/130/106.wxtnew file mode 100644index 0000000000..f73ad66932Binary files /dev/null and b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/130/106.wxt differ
weather/src/test/resources/wx/runs/2026111312-1794600000/t/141/179.wxt
diff --git a/weather/src/test/resources/wx/runs/2026111312-1794600000/t/141/179.wxt b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/141/179.wxtnew file mode 100644index 0000000000..0397aa36ffBinary files /dev/null and b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/141/179.wxt differ
weather/src/test/resources/wx/runs/2026111312-1794600000/t/142/193.wxt
diff --git a/weather/src/test/resources/wx/runs/2026111312-1794600000/t/142/193.wxt b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/142/193.wxtnew file mode 100644index 0000000000..ded3406111Binary files /dev/null and b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/142/193.wxt differ
weather/src/test/resources/wx/runs/2026111312-1794600000/t/149/198.wxt
diff --git a/weather/src/test/resources/wx/runs/2026111312-1794600000/t/149/198.wxt b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/149/198.wxtnew file mode 100644index 0000000000..b1746e1d4bBinary files /dev/null and b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/149/198.wxt differ
weather/src/test/resources/wx/runs/2026111312-1794600000/t/56/331.wxt
diff --git a/weather/src/test/resources/wx/runs/2026111312-1794600000/t/56/331.wxt b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/56/331.wxtnew file mode 100644index 0000000000..eea5228505Binary files /dev/null and b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/56/331.wxt differ
weather/src/test/resources/wx/runs/2026111312-1794600000/t/66/133.wxt
diff --git a/weather/src/test/resources/wx/runs/2026111312-1794600000/t/66/133.wxt b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/66/133.wxtnew file mode 100644index 0000000000..514d047cefBinary files /dev/null and b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/66/133.wxt differ
weather/src/test/resources/wx/runs/2026111312-1794600000/t/91/283.wxt
diff --git a/weather/src/test/resources/wx/runs/2026111312-1794600000/t/91/283.wxt b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/91/283.wxtnew file mode 100644index 0000000000..66429dd795Binary files /dev/null and b/weather/src/test/resources/wx/runs/2026111312-1794600000/t/91/283.wxt differ