skyway 0.0.1

A command-line OpenStreetMap file converter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::sync::mpsc::Receiver;
use std::io::Write;

use crate::elements::{Element, Metadata};

mod json;
use json::write_json;

mod xml;
use xml::write_xml;

pub fn write_file<D: Write>(reciever: Receiver<Element>, metadata: Metadata, to: &str, destination: D) {
    match to {
        "json" => write_json(reciever, metadata, destination),
        "xml" => write_xml(reciever, metadata, destination),
        _ => panic!("Output filetype not supported!")
    }
}