aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hittekaart/src/gpx.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/hittekaart/src/gpx.rs b/hittekaart/src/gpx.rs
index fe7ab27..98019c3 100644
--- a/hittekaart/src/gpx.rs
+++ b/hittekaart/src/gpx.rs
@@ -27,6 +27,13 @@ pub struct Coordinates {
}
impl Coordinates {
+ pub fn new(longitude: f64, latitude: f64) -> Self {
+ Self {
+ longitude,
+ latitude,
+ }
+ }
+
/// Calculates the [Web Mercator
/// projection](https://en.wikipedia.org/wiki/Web_Mercator_projection) of the coordinates.
///
@@ -140,7 +147,8 @@ pub fn extract_from_file<P: AsRef<Path>>(
brotli::BrotliDecompress(
&mut BufReader::new(File::open(path).map_err(|e| Error::Io("opening file", e))?),
&mut result,
- ).map_err(|e| Error::Io("decompressing", e))?;
+ )
+ .map_err(|e| Error::Io("decompressing", e))?;
String::from_utf8(result)?
}
};