extern crate geohashing; use geohashing::*; extern crate chrono; use chrono::NaiveDate; fn main() { //let lat = 49.0; //let lon = 8.0; println!(r#""#); let mut consecutive_fails = 0; 'year: for year in 2008..=2018 { for month in 1..=12 { for day in 1..=31 { if (year == 2008 && month < 5) || (year == 2008 && month == 5 && day < 21) { continue; } let date = NaiveDate::from_ymd_opt(year as i32, month as u32, day as u32); if date.is_none() { continue; } let date = date.unwrap(); if let Ok(djia) = search_djia(date) { //let (lat_offset, lon_offset) = djia_to_hash((year, month, day), &djia); //let lat = lat + lat_offset; //let lon = lon + lon_offset; let (lat, lon) = djia_to_globalhash(date, &djia); println!("{}-{}-{}{},{},0", year, month, day, lon, lat); } else { consecutive_fails += 1; } if consecutive_fails > 5 { break 'year; } } } } println!(""); }