use gpx::{Gpx, Waypoint};
use std::{fs::File, io::BufWriter, path::Path};
pub fn write_gpx_to_file(gpx: Gpx, fname: impl AsRef<Path>) -> crate::Res<()> {
let gpx_file = File::create(fname.as_ref())?;
let bufw = BufWriter::new(gpx_file);
gpx::write(&gpx, bufw)?;
log::debug!("written {:?}", fname.as_ref());
Ok(())
}
pub fn is_00(wp: &Waypoint) -> bool {
let res = wp.point().x_y() == (0., 0.);
if res {
log::trace!("{wp:?} is null");
}
res
}