diff --git a/wxbox-tiler/src/sources/noaa/mod.rs b/wxbox-tiler/src/sources/noaa/mod.rs index 2f6d854..0a178cd 100644 --- a/wxbox-tiler/src/sources/noaa/mod.rs +++ b/wxbox-tiler/src/sources/noaa/mod.rs @@ -151,53 +151,6 @@ async fn mrms_cref(path: web::Path<(i32, i32, i32)>, data: Data) -> Ht } } -/* - for (lat, row) in map.range(closest_south..=closest_north) { - let closest_west = match closest_key(&row, bbox.west) { - Some(c) => c, - None => { eprintln!("row LUT is empty?"); return HttpResponse::new(StatusCode::NOT_FOUND); } - }; - let closest_east = match closest_key(&row, bbox.east) { - Some(c) => c, - None => { eprintln!("row LUT is empty?"); return HttpResponse::new(StatusCode::NOT_FOUND); } - }; - for (long, gridpoint) in row.range(closest_west..=closest_east) { - let epsg_lon = **long; - let epsg_lat = **lat; - - let wm_x = epsg_lon; - let wm_y = epsg_lat.tan().asinh(); - - let x = 0.5 + wm_x / 360.0; - let y = 0.5 - wm_y / (2.0 * std::f64::consts::PI); - - let zoom = z; - let n = 2.0_f64.powi(zoom); - - let x_tile = n * x; - let y_tile = n * y; - - let x_pixel = x_tile.fract() * 256.0; - let y_pixel = y_tile.fract() * 256.0; - - let xf = x_pixel.trunc() as usize; - let yf = y_pixel.trunc() as usize; - - println!("@{} -> {}: {} -> {} -> {} -> {} -> {} => {}\n{} -> {} -> {} -> {} -> {} => {}", z, n, epsg_lon, wm_x, x, x_tile, x_pixel, xf, epsg_lat, wm_y, y, y_tile, y_pixel, yf); - - let mut color = pal.color_for(*gridpoint); - - let existing = image.get(xf, yf); - if existing != (Color { red: 0, green: 0, blue: 0, alpha: 0 }) { - color = color.average(existing); - } - - image.set(xf, yf, color); - } - } - - */ - let mut buf: Vec = vec![]; // borrow checker insanity {