use std::{env, fs, path::PathBuf}; use color_eyre::eyre::Result; mod gpx; mod layer; mod renderer; fn main() -> Result<()> { color_eyre::install()?; let gpx_folder = env::args().nth(1).unwrap(); println!("Reading from {gpx_folder}"); let mut tracks = Vec::new(); for file in fs::read_dir(gpx_folder).unwrap() { let file = file.unwrap(); let data = gpx::extract_from_file(file.path(), gpx::Compression::None).unwrap(); tracks.push(data); } for zoom in 0..=19 { println!("Doing level {zoom}"); let counter = renderer::render_heatcounter(zoom, &tracks); let target = ["tiles", &zoom.to_string()].iter().collect::(); fs::create_dir(&target)?; renderer::lazy_colorization(&counter, &target)?; } Ok(()) }