Skip to content

Commit

Permalink
Merge pull request georust#1297 from urschrei/haversine-citation-fix
Browse files Browse the repository at this point in the history
Fix citation location of mean earth radius
  • Loading branch information
michaelkirk authored Jan 10, 2025
2 parents e5dddd6 + 2cc675f commit 1335472
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
1 change: 1 addition & 0 deletions geo-types/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Fix page location of citation for mean earth radius used in Haversine calculations
- Implement `RTreeObject` for `Triangle`.
- Implement `AsRef<Coord>` for `Point` and `Coord`.

Expand Down
9 changes: 7 additions & 2 deletions geo/src/algorithm/haversine_distance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ use num_traits::FromPrimitive;
///
/// [haversine formula]: https://en.wikipedia.org/wiki/Haversine_formula
///
/// *Note*: this implementation uses a mean earth radius of 6371.088 km, based on the [recommendation of
/// the IUGG](ftp://athena.fsv.cvut.cz/ZFG/grs80-Moritz.pdf)
/// *Note*: this implementation uses a mean earth radius of 6371.0088 km (6_371_008.7714 m), based on the recommendation of
/// the IUGG:
///
/// Moritz, H. (2000). Geodetic Reference System 1980. Journal of Geodesy, 74(1), 128–133. doi:10.1007/s001900050278
/// "Derived Geometric Constants: **R1: mean radius**" (p131)
/// - <https://link.springer.com/article/10.1007%2Fs001900050278>
/// - <https://sci-hub.se/https://doi.org/10.1007/s001900050278>
pub trait HaversineDistance<T, Rhs = Self> {
/// Determine the distance between two geometries using the [haversine
/// formula].
Expand Down
9 changes: 7 additions & 2 deletions geo/src/algorithm/line_measures/metric_spaces/haversine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ use crate::{CoordFloat, Point, MEAN_EARTH_RADIUS};
///
/// # References
///
/// *Note*: this implementation uses a mean earth radius of 6371.088 km, based on the [recommendation of
/// the IUGG](ftp://athena.fsv.cvut.cz/ZFG/grs80-Moritz.pdf)
/// *Note*: this implementation uses a mean earth radius of 6371.0088 km (6_371_008.7714 m), based on the recommendation of
/// the IUGG:
///
/// Moritz, H. (2000). Geodetic Reference System 1980. Journal of Geodesy, 74(1), 128–133. doi:10.1007/s001900050278
/// "Derived Geometric Constants: **R1: mean radius**" (p131)
/// - <https://link.springer.com/article/10.1007%2Fs001900050278>
/// - <https://sci-hub.se/https://doi.org/10.1007/s001900050278>
///
/// [haversine formula]: https://en.wikipedia.org/wiki/Haversine_formula//
/// [great circle]: https://en.wikipedia.org/wiki/Great_circle
Expand Down
8 changes: 4 additions & 4 deletions geo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ extern crate log;
/// Mean radius of Earth in meters
/// This is the value recommended by the IUGG:
/// Moritz, H. (2000). Geodetic Reference System 1980. Journal of Geodesy, 74(1), 128–133. doi:10.1007/s001900050278
/// "Derived Geometric Constants: mean radius" (p133)
/// https://link.springer.com/article/10.1007%2Fs001900050278
/// https://sci-hub.se/https://doi.org/10.1007/s001900050278
/// https://en.wikipedia.org/wiki/Earth_radius#Mean_radius
/// "Derived Geometric Constants: **R1: mean radius**" (p131)
/// - <https://link.springer.com/article/10.1007%2Fs001900050278>
/// - <https://sci-hub.se/https://doi.org/10.1007/s001900050278>
/// - <https://en.wikipedia.org/wiki/Earth_radius#Mean_radius>
const MEAN_EARTH_RADIUS: f64 = 6371008.8;

// Radius of Earth at the equator in meters (derived from the WGS-84 ellipsoid)
Expand Down

0 comments on commit 1335472

Please sign in to comment.