mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 19:30:04 +00:00
Centroid calculation for alert distance
This commit is contained in:
parent
a3d007d8c4
commit
5784abc117
3 changed files with 91 additions and 19 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
|
|
@ -43,6 +44,16 @@ enum class DistanceType
|
|||
Miles
|
||||
};
|
||||
|
||||
/**
|
||||
* Calculate the geographic midpoint of a set of coordinates. Uses Method A
|
||||
* described at http://www.geomidpoint.com/calculation.html.
|
||||
*
|
||||
* @param coordinates Set of unique coordinates
|
||||
*
|
||||
* @return Centroid
|
||||
*/
|
||||
Coordinate GetCentroid(const std::vector<Coordinate>& coordinates);
|
||||
|
||||
std::string
|
||||
GetLatitudeString(double latitude,
|
||||
DegreeStringType type = DegreeStringType::Decimal);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue