pub mod csv_format;
pub mod csv_input;
pub mod geojson;
pub mod kml;
pub mod gpx;
pub mod wkt;
pub mod geojson_input;
pub mod kml_input;
pub mod gpx_input;
pub mod topojson;
pub mod kmz;
#[cfg(feature = "shapefile-format")]
pub mod shapefile_format;
#[cfg(feature = "geopackage")]
pub mod geopackage;
#[cfg(feature = "flatgeobuf-format")]
pub mod flatgeobuf_format;
use std::path::Path;
use anyhow::Result;
pub struct ConvertedRow {
pub fields: Vec<String>,
pub headers: Vec<String>,
pub latitude: Option<f64>,
pub longitude: Option<f64>,
pub mgrs_source: Option<String>,
}
pub trait OutputFormat {
fn write_header(&mut self, headers: &[String]) -> Result<()>;
fn write_row(&mut self, row: &ConvertedRow) -> Result<()>;
fn finish(&mut self) -> Result<()>;
}
pub struct InputRecord {
pub fields: Vec<(String, String)>,
pub latitude: Option<f64>,
pub longitude: Option<f64>,
}
pub trait InputFormat {
fn headers(&self) -> Vec<String>;
fn next_record(&mut self) -> Result<Option<InputRecord>>;
}
pub trait PathOutputFormat {
fn new(path: &Path, headers: &[String]) -> Result<Self> where Self: Sized;
fn write_row(&mut self, row: &ConvertedRow) -> Result<()>;
fn finish(&mut self) -> Result<()>;
}