Files
ruvnet--RuView/v2/crates/wifi-densepose-geo/examples/validate.rs
T
rUv 004a63e82d fix(security): audit — fix RUSTSEC vulns, clippy warnings, dead code (#769)
- Upgrade openssl to 0.10.78 (CVE-2026-41676), jsonwebtoken to 9.4
- Suppress unmaintained-only/no-CVE advisories in .cargo/audit.toml
  with per-entry rationale
- Fix all `cargo clippy --all-targets -- -D warnings` errors across
  35 crates: derivable_impls, needless_range_loop, map_or→is_some_and/
  is_none_or, await_holding_lock (drop MutexGuard before .await),
  ptr_arg (&mut Vec→&mut [T]), useless_conversion, approximate_constant
  (2.718→E, 3.14→PI), field_reassign_with_default, manual_inspect,
  useless_vec, lines_filter_map_ok, print_literal, dead_code
- Apply `cargo fmt --all`
- Pre-existing test failure in wifi-densepose-signal
  (test_estimate_occupancy_noise_only) is not introduced by this PR
2026-05-23 05:36:13 -04:00

70 lines
2.4 KiB
Rust

use wifi_densepose_geo::*;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
println!("╔══════════════════════════════════════════════╗");
println!("║ ruview-geo — Real Data Validation ║");
println!("╚══════════════════════════════════════════════╝\n");
let t0 = std::time::Instant::now();
let cache = cache::TileCache::new("/tmp/ruview-geo-validate");
let loc = locate::get_location(&format!("{}/location.json", cache.base_dir.display())).await?;
println!(" Location: {:.4}N, {:.4}W", loc.lat, loc.lon);
let bbox = GeoBBox::from_center(&loc, 300.0);
let tiles_list =
tiles::fetch_area(&tiles::TileProvider::Sentinel2Cloudless, &bbox, 16, &cache).await?;
println!(
" Tiles: {} ({:.0}KB)",
tiles_list.len(),
tiles_list.iter().map(|t| t.data.len()).sum::<usize>() as f64 / 1024.0
);
let dem = terrain::fetch_elevation(&loc, &cache).await?;
println!(
" Elevation: {:.0}m (grid {}x{})",
terrain::elevation_at(&dem, &loc),
dem.cols,
dem.rows
);
let buildings = osm::fetch_buildings(&loc, 300.0).await.unwrap_or_default();
let roads = osm::fetch_roads(&loc, 300.0).await.unwrap_or_default();
println!(
" OSM: {} buildings, {} roads",
buildings.len(),
roads.len()
);
let weather = temporal::fetch_weather(&loc).await?;
println!(
" Weather: {:.0}°C humidity={:.0}% wind={:.1}m/s",
weather.temperature_c, weather.humidity_pct, weather.wind_speed_ms
);
let scene = GeoScene {
location: loc.clone(),
bbox,
elevation_m: terrain::elevation_at(&dem, &loc),
buildings,
roads,
tile_count: tiles_list.len(),
registration: register::auto_register(&loc),
last_updated: chrono::Utc::now().to_rfc3339(),
};
println!("\n {}", fuse::summarize(&scene));
match brain::store_geo_context(&scene).await {
Ok(n) => println!(" Brain: {} memories stored", n),
Err(e) => println!(" Brain: {e}"),
}
println!(
"\n Total: {}ms | Cache: {:.0}KB",
t0.elapsed().as_millis(),
cache.size_bytes() as f64 / 1024.0
);
Ok(())
}