Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Quba1 committed Jan 24, 2024
1 parent ee5f37f commit dc09e35
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mappers"
version = "0.6.0"
version = "0.6.1"
edition = "2021"
description = "Pure Rust geographical projections library"
repository = "https://github.com/ScaleWeather/mappers"
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,21 @@ println!("lon: {}, lat: {}", lon, lat); // lon: 6.8651, lat: 45.83260000001716
```

Some projections are mathematically exactly invertible, and technically geographical coordinates projected and inverse projected should be identical. However, in practice limitations of floating-point arithmetics will introduce some errors along the way, as shown in the example above.

## Multithreading

For projecting multiple coordinates at once, the crate provides `_parallel`
functions that are available in a (default) `multithreading` feature. These functions
use `rayon` crate to parallelize the projection process. They are provided
mainly for convenience, as they are not much different than calling
`.par_iter()` on a slice of coordinates and mapping the projection function over it.

```rust
let lcc = LambertConformalConic::new(2.0, 0.0, 30.0, 60.0, Ellipsoid::WGS84)?;

// Parallel functions use slices of tuples as input and output
let geographic_coordinates = vec![(6.8651, 45.8326); 10];

let map_coordinates = lcc.project_parallel(&geographic_coordinates)?;
let inversed_coordinates = lcc.inverse_project_parallel(&map_coordinates)?;
```

0 comments on commit dc09e35

Please sign in to comment.