Merge branch 'develop' into fix/shared_mem_warnings
This commit is contained in:
commit
abd8d3459a
@ -54,7 +54,7 @@ template <class DataFacadeT, class SegmentT> struct ExtractRouteNames
|
|||||||
|
|
||||||
for (const SegmentT &segment : segment_list)
|
for (const SegmentT &segment : segment_list)
|
||||||
{
|
{
|
||||||
if (segment.name_id != blocked_name_id && segment.length > result_segment.length)
|
if (segment.name_id != blocked_name_id && segment.length > result_segment.length && segment.name_id != 0)
|
||||||
{
|
{
|
||||||
result_segment = segment;
|
result_segment = segment;
|
||||||
}
|
}
|
||||||
@ -111,7 +111,7 @@ template <class DataFacadeT, class SegmentT> struct ExtractRouteNames
|
|||||||
shortest_path_set_difference.end(),
|
shortest_path_set_difference.end(),
|
||||||
length_comperator);
|
length_comperator);
|
||||||
shortest_segment_2 =
|
shortest_segment_2 =
|
||||||
PickNextLongestSegment(shortest_path_set_difference, shortest_path_segments[0].name_id);
|
PickNextLongestSegment(shortest_path_set_difference, shortest_segment_1.name_id);
|
||||||
|
|
||||||
// compute the set difference (for alternative path) depending on names between shortest and
|
// compute the set difference (for alternative path) depending on names between shortest and
|
||||||
// alternative
|
// alternative
|
||||||
@ -138,7 +138,7 @@ template <class DataFacadeT, class SegmentT> struct ExtractRouteNames
|
|||||||
if (!alternative_path_segments.empty())
|
if (!alternative_path_segments.empty())
|
||||||
{
|
{
|
||||||
alternative_segment_2 = PickNextLongestSegment(alternative_path_set_difference,
|
alternative_segment_2 = PickNextLongestSegment(alternative_path_set_difference,
|
||||||
alternative_path_segments[0].name_id);
|
alternative_segment_1.name_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// move the segments into the order in which they occur.
|
// move the segments into the order in which they occur.
|
||||||
|
@ -76,17 +76,13 @@ JSON::String PolylineCompressor::printEncodedString(const std::vector<SegmentInf
|
|||||||
std::vector<int> delta_numbers;
|
std::vector<int> delta_numbers;
|
||||||
if (!polyline.empty())
|
if (!polyline.empty())
|
||||||
{
|
{
|
||||||
FixedPointCoordinate last_coordinate = polyline[0].location;
|
FixedPointCoordinate last_coordinate = {0, 0};
|
||||||
delta_numbers.emplace_back(last_coordinate.lat);
|
for (const auto &segment : polyline)
|
||||||
delta_numbers.emplace_back(last_coordinate.lon);
|
|
||||||
// iterate after skipping the first, already handled, segment
|
|
||||||
for (auto it = ++polyline.cbegin(); it != polyline.cend(); ++it)
|
|
||||||
{
|
{
|
||||||
const auto &segment = *it;
|
|
||||||
if (segment.necessary)
|
if (segment.necessary)
|
||||||
{
|
{
|
||||||
int lat_diff = segment.location.lat - last_coordinate.lat;
|
const int lat_diff = segment.location.lat - last_coordinate.lat;
|
||||||
int lon_diff = segment.location.lon - last_coordinate.lon;
|
const int lon_diff = segment.location.lon - last_coordinate.lon;
|
||||||
delta_numbers.emplace_back(lat_diff);
|
delta_numbers.emplace_back(lat_diff);
|
||||||
delta_numbers.emplace_back(lon_diff);
|
delta_numbers.emplace_back(lon_diff);
|
||||||
last_coordinate = segment.location;
|
last_coordinate = segment.location;
|
||||||
|
@ -40,7 +40,7 @@ struct FixedPointCoordinate
|
|||||||
int lon;
|
int lon;
|
||||||
|
|
||||||
FixedPointCoordinate();
|
FixedPointCoordinate();
|
||||||
explicit FixedPointCoordinate(int lat, int lon);
|
FixedPointCoordinate(int lat, int lon);
|
||||||
void Reset();
|
void Reset();
|
||||||
bool isSet() const;
|
bool isSet() const;
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
@ -55,10 +55,8 @@ struct FixedPointCoordinate
|
|||||||
static float ApproximateEuclideanDistance(const FixedPointCoordinate &first_coordinate,
|
static float ApproximateEuclideanDistance(const FixedPointCoordinate &first_coordinate,
|
||||||
const FixedPointCoordinate &second_coordinate);
|
const FixedPointCoordinate &second_coordinate);
|
||||||
|
|
||||||
static float ApproximateEuclideanDistance(const int lat1,
|
static float
|
||||||
const int lon1,
|
ApproximateEuclideanDistance(const int lat1, const int lon1, const int lat2, const int lon2);
|
||||||
const int lat2,
|
|
||||||
const int lon2);
|
|
||||||
|
|
||||||
static float ApproximateSquaredEuclideanDistance(const FixedPointCoordinate &first_coordinate,
|
static float ApproximateSquaredEuclideanDistance(const FixedPointCoordinate &first_coordinate,
|
||||||
const FixedPointCoordinate &second_coordinate);
|
const FixedPointCoordinate &second_coordinate);
|
||||||
@ -81,10 +79,10 @@ struct FixedPointCoordinate
|
|||||||
FixedPointCoordinate &nearest_location,
|
FixedPointCoordinate &nearest_location,
|
||||||
float &ratio);
|
float &ratio);
|
||||||
|
|
||||||
static int OrderedPerpendicularDistanceApproximation(const FixedPointCoordinate& segment_source,
|
static int
|
||||||
const FixedPointCoordinate& segment_target,
|
OrderedPerpendicularDistanceApproximation(const FixedPointCoordinate &segment_source,
|
||||||
const FixedPointCoordinate& query_location);
|
const FixedPointCoordinate &segment_target,
|
||||||
|
const FixedPointCoordinate &query_location);
|
||||||
|
|
||||||
static float GetBearing(const FixedPointCoordinate &A, const FixedPointCoordinate &B);
|
static float GetBearing(const FixedPointCoordinate &A, const FixedPointCoordinate &B);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user