Fix naming in coordinate_calculation
This commit is contained in:
@@ -8,44 +8,42 @@ struct FixedPointCoordinate;
|
||||
|
||||
namespace coordinate_calculation
|
||||
{
|
||||
double haversine_distance(const int lat1, const int lon1, const int lat2, const int lon2);
|
||||
double haversineDistance(const int lat1, const int lon1, const int lat2, const int lon2);
|
||||
|
||||
double haversine_distance(const FixedPointCoordinate &first_coordinate,
|
||||
const FixedPointCoordinate &second_coordinate);
|
||||
double haversineDistance(const FixedPointCoordinate &first_coordinate,
|
||||
const FixedPointCoordinate &second_coordinate);
|
||||
|
||||
double great_circle_distance(const FixedPointCoordinate &first_coordinate,
|
||||
const FixedPointCoordinate &second_coordinate);
|
||||
double greatCircleDistance(const FixedPointCoordinate &first_coordinate,
|
||||
const FixedPointCoordinate &second_coordinate);
|
||||
|
||||
double great_circle_distance(const int lat1, const int lon1, const int lat2, const int lon2);
|
||||
double greatCircleDistance(const int lat1, const int lon1, const int lat2, const int lon2);
|
||||
|
||||
void lat_or_lon_to_string(const int value, std::string &output);
|
||||
double perpendicularDistance(const FixedPointCoordinate &segment_source,
|
||||
const FixedPointCoordinate &segment_target,
|
||||
const FixedPointCoordinate &query_location);
|
||||
|
||||
double perpendicular_distance(const FixedPointCoordinate &segment_source,
|
||||
const FixedPointCoordinate &segment_target,
|
||||
const FixedPointCoordinate &query_location);
|
||||
double perpendicularDistance(const FixedPointCoordinate &segment_source,
|
||||
const FixedPointCoordinate &segment_target,
|
||||
const FixedPointCoordinate &query_location,
|
||||
FixedPointCoordinate &nearest_location,
|
||||
double &ratio);
|
||||
|
||||
double perpendicular_distance(const FixedPointCoordinate &segment_source,
|
||||
const FixedPointCoordinate &segment_target,
|
||||
const FixedPointCoordinate &query_location,
|
||||
FixedPointCoordinate &nearest_location,
|
||||
double &ratio);
|
||||
double
|
||||
perpendicularDistanceFromProjectedCoordinate(const FixedPointCoordinate &segment_source,
|
||||
const FixedPointCoordinate &segment_target,
|
||||
const FixedPointCoordinate &query_location,
|
||||
const std::pair<double, double> &projected_coordinate);
|
||||
|
||||
double perpendicular_distance_from_projected_coordinate(
|
||||
const FixedPointCoordinate &segment_source,
|
||||
const FixedPointCoordinate &segment_target,
|
||||
const FixedPointCoordinate &query_location,
|
||||
const std::pair<double, double> &projected_coordinate);
|
||||
double
|
||||
perpendicularDistanceFromProjectedCoordinate(const FixedPointCoordinate &segment_source,
|
||||
const FixedPointCoordinate &segment_target,
|
||||
const FixedPointCoordinate &query_location,
|
||||
const std::pair<double, double> &projected_coordinate,
|
||||
FixedPointCoordinate &nearest_location,
|
||||
double &ratio);
|
||||
|
||||
double perpendicular_distance_from_projected_coordinate(
|
||||
const FixedPointCoordinate &segment_source,
|
||||
const FixedPointCoordinate &segment_target,
|
||||
const FixedPointCoordinate &query_location,
|
||||
const std::pair<double, double> &projected_coordinate,
|
||||
FixedPointCoordinate &nearest_location,
|
||||
double &ratio);
|
||||
|
||||
double deg_to_rad(const double degree);
|
||||
double rad_to_deg(const double radian);
|
||||
double degToRad(const double degree);
|
||||
double radToDeg(const double radian);
|
||||
|
||||
double bearing(const FixedPointCoordinate &first_coordinate,
|
||||
const FixedPointCoordinate &second_coordinate);
|
||||
|
||||
+16
-16
@@ -94,35 +94,35 @@ struct RectangleInt2D
|
||||
switch (d)
|
||||
{
|
||||
case NORTH:
|
||||
min_dist = coordinate_calculation::great_circle_distance(
|
||||
min_dist = coordinate_calculation::greatCircleDistance(
|
||||
location, FixedPointCoordinate(max_lat, location.lon));
|
||||
break;
|
||||
case SOUTH:
|
||||
min_dist = coordinate_calculation::great_circle_distance(
|
||||
min_dist = coordinate_calculation::greatCircleDistance(
|
||||
location, FixedPointCoordinate(min_lat, location.lon));
|
||||
break;
|
||||
case WEST:
|
||||
min_dist = coordinate_calculation::great_circle_distance(
|
||||
min_dist = coordinate_calculation::greatCircleDistance(
|
||||
location, FixedPointCoordinate(location.lat, min_lon));
|
||||
break;
|
||||
case EAST:
|
||||
min_dist = coordinate_calculation::great_circle_distance(
|
||||
min_dist = coordinate_calculation::greatCircleDistance(
|
||||
location, FixedPointCoordinate(location.lat, max_lon));
|
||||
break;
|
||||
case NORTH_EAST:
|
||||
min_dist = coordinate_calculation::great_circle_distance(
|
||||
min_dist = coordinate_calculation::greatCircleDistance(
|
||||
location, FixedPointCoordinate(max_lat, max_lon));
|
||||
break;
|
||||
case NORTH_WEST:
|
||||
min_dist = coordinate_calculation::great_circle_distance(
|
||||
min_dist = coordinate_calculation::greatCircleDistance(
|
||||
location, FixedPointCoordinate(max_lat, min_lon));
|
||||
break;
|
||||
case SOUTH_EAST:
|
||||
min_dist = coordinate_calculation::great_circle_distance(
|
||||
min_dist = coordinate_calculation::greatCircleDistance(
|
||||
location, FixedPointCoordinate(min_lat, max_lon));
|
||||
break;
|
||||
case SOUTH_WEST:
|
||||
min_dist = coordinate_calculation::great_circle_distance(
|
||||
min_dist = coordinate_calculation::greatCircleDistance(
|
||||
location, FixedPointCoordinate(min_lat, min_lon));
|
||||
break;
|
||||
default:
|
||||
@@ -145,23 +145,23 @@ struct RectangleInt2D
|
||||
|
||||
min_max_dist = std::min(
|
||||
min_max_dist,
|
||||
std::max(coordinate_calculation::great_circle_distance(location, upper_left),
|
||||
coordinate_calculation::great_circle_distance(location, upper_right)));
|
||||
std::max(coordinate_calculation::greatCircleDistance(location, upper_left),
|
||||
coordinate_calculation::greatCircleDistance(location, upper_right)));
|
||||
|
||||
min_max_dist = std::min(
|
||||
min_max_dist,
|
||||
std::max(coordinate_calculation::great_circle_distance(location, upper_right),
|
||||
coordinate_calculation::great_circle_distance(location, lower_right)));
|
||||
std::max(coordinate_calculation::greatCircleDistance(location, upper_right),
|
||||
coordinate_calculation::greatCircleDistance(location, lower_right)));
|
||||
|
||||
min_max_dist =
|
||||
std::min(min_max_dist,
|
||||
std::max(coordinate_calculation::great_circle_distance(location, lower_right),
|
||||
coordinate_calculation::great_circle_distance(location, lower_left)));
|
||||
std::max(coordinate_calculation::greatCircleDistance(location, lower_right),
|
||||
coordinate_calculation::greatCircleDistance(location, lower_left)));
|
||||
|
||||
min_max_dist =
|
||||
std::min(min_max_dist,
|
||||
std::max(coordinate_calculation::great_circle_distance(location, lower_left),
|
||||
coordinate_calculation::great_circle_distance(location, upper_left)));
|
||||
std::max(coordinate_calculation::greatCircleDistance(location, lower_left),
|
||||
coordinate_calculation::greatCircleDistance(location, upper_left)));
|
||||
return min_max_dist;
|
||||
}
|
||||
|
||||
|
||||
@@ -415,7 +415,7 @@ class StaticRTree
|
||||
{
|
||||
auto ¤t_edge = current_leaf_node.objects[i];
|
||||
const float current_perpendicular_distance =
|
||||
coordinate_calculation::perpendicular_distance_from_projected_coordinate(
|
||||
coordinate_calculation::perpendicularDistanceFromProjectedCoordinate(
|
||||
m_coordinate_list->at(current_edge.u), m_coordinate_list->at(current_edge.v),
|
||||
input_coordinate, projected_coordinate);
|
||||
// distance must be non-negative
|
||||
|
||||
Reference in New Issue
Block a user