mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 14:50:05 +00:00
Extract utility geographic and maplibre functions
This commit is contained in:
parent
1a411af3bc
commit
1c39464228
6 changed files with 83 additions and 21 deletions
|
|
@ -18,6 +18,17 @@ const ::GeographicLib::Geodesic& DefaultGeodesic()
|
|||
return geodesic_;
|
||||
}
|
||||
|
||||
boost::units::quantity<boost::units::si::length>
|
||||
GetDistance(double lat1, double lon1, double lat2, double lon2)
|
||||
{
|
||||
double distance;
|
||||
util::GeographicLib::DefaultGeodesic().Inverse(
|
||||
lat1, lon1, lat2, lon2, distance);
|
||||
|
||||
return static_cast<boost::units::quantity<boost::units::si::length>>(
|
||||
distance * boost::units::si::meter_base_unit::unit_type());
|
||||
}
|
||||
|
||||
} // namespace GeographicLib
|
||||
} // namespace util
|
||||
} // namespace qt
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue