fn download_waterfalls(path: &Path) {
    println!("Downloading the waterfall dataset!");
    let mut pages = Vec::new();
    let exclusions = vec!["/dir/index.php/geography-of-kentucky".to_owned(), "/dir/index.php/busted-destroyed".to_owned()];
    net::get_database_pages(WATERFALL_BASE, &mut pages, "Geographic Regions".to_owned(), Some(&exclusions));

    let mut waterfall_pages = Vec::new();
    for page in pages {
        let url = net::build_url(WATERFALL_BASE, page);
        net::get_landforms(&url, &mut waterfall_pages);
    }

    let mut waterfalls = Vec::new();
    for waterfall_page in waterfall_pages {
        let waterfall_url = net::build_url(WATERFALL_BASE, waterfall_page);
        let waterfall = net::download_landform(waterfall_url);
        waterfalls.push(waterfall);
    }

    // Write out the GPX
    let out_path = path.join(WATERFALL_FILE);
    match gpx::write_gpx(out_path.as_path(), &waterfalls) {
        Err(err) => eprintln!("[ERROR]: Failed to write GPX! \n {}", err),
        _ => (),
    }
}
/// Downloads the waterfall dataset from the Kentucky Waterfall Database
Downloads the waterfall dataset from the Kentucky Waterfall Database
Downloads the waterfall dataset from the Kentucky Waterfall Database
fn download_waterfalls(path: &Path) {
    println!("Downloading the waterfall dataset!");
    let mut pages = Vec::new();
    let exclusions = vec!["/dir/index.php/geography-of-kentucky".to_owned(), "/dir/index.php/busted-destroyed".to_owned()];
    net::get_database_pages(WATERFALL_BASE, &mut pages, "Geographic Regions".to_owned(), Some(&exclusions));
    let mut waterfall_pages = Vec::new();
    for page in pages {
        let url = net::build_url(WATERFALL_BASE, page);
        net::get_landforms(&url, &mut waterfall_pages);
    }
    let mut waterfalls = Vec::new();
    for waterfall_page in waterfall_pages {
        let waterfall_url = net::build_url(WATERFALL_BASE, waterfall_page);
        let waterfall = net::download_landform(waterfall_url);
        waterfalls.push(waterfall);
    }
    // Write out the GPX
    let out_path = path.join(WATERFALL_FILE);
    match gpx::write_gpx(out_path.as_path(), &waterfalls) {
        Err(err) => eprintln!("[ERROR]: Failed to write GPX! \n {}", err),
        _ => (),
    }
}
fn download_waterfalls ( path : & Path ) { println ! ( " " ) ; let mut pages = Vec :: new ( ) ; let exclusions = vec ! [ " " to_owned ( ) " " to_owned ( ) ] ; net :: get_database_pages ( WATERFALL_BASE , & mut pages , " " . to_owned ( ) , Some ( & exclusions ) ) ; let mut waterfall_pages = Vec :: new ( ) ; for page in pages { let url = net :: build_url ( WATERFALL_BASE , page ) ; net :: get_landforms ( & url , & mut waterfall_pages ) ; } let mut waterfalls = Vec :: new ( ) ; for waterfall_page in waterfall_pages { let waterfall_url = net :: build_url ( WATERFALL_BASE , waterfall_page ) ; let waterfall = net :: download_landform ( waterfall_url ) ; waterfalls . push ( waterfall ) ; } // Write out the GPX let out_path = path . join ( WATERFALL_FILE ) ; match gpx :: write_gpx ( out_path . as_path ( ) , & waterfalls ) { Err ( err ) => eprintln ! ( " \n " err ) , _ => ( ) , } }
Downloads the waterfall dataset from the Kentucky Waterfall Database
Downloads the waterfall dataset from the Kentucky Waterfall Database
path
&Path