Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 29a0c6f

Browse files
committed
reverted to same commit as eclever branch
1 parent b9de602 commit 29a0c6f

File tree

125 files changed

+33008
-17139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+33008
-17139
lines changed

include/common/valhalla/baldr/admin.h

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#ifndef VALHALLA_BALDR_ADMIN_H_
22
#define VALHALLA_BALDR_ADMIN_H_
33

4-
#include <array>
54
#include <cstdint>
6-
#include <cstring>
75
#include <stdint.h>
86

97
#include <valhalla/midgard/util.h>
@@ -64,11 +62,11 @@ class Admin {
6462
uint32_t country_offset() const;
6563

6664
protected:
67-
uint32_t country_offset_; // country name offset
68-
uint32_t state_offset_; // state name offset
69-
std::array<char, kCountryIso> country_iso_{}; // country ISO3166-1
70-
std::array<char, kStateIso> state_iso_{}; // state ISO3166-2
71-
char spare_[3]{}; // spare for byte alignment
65+
uint32_t country_offset_; // country name offset
66+
uint32_t state_offset_; // state name offset
67+
char country_iso_[kCountryIso]{}; // country ISO3166-1
68+
char state_iso_[kStateIso]{}; // state ISO3166-2
69+
char spare_[3]{}; // spare for byte alignment
7270
};
7371

7472
} // namespace baldr

include/common/valhalla/baldr/connectivity_map.h

+2-11
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ class connectivity_map_t {
2323
connectivity_map_t(const boost::property_tree::ptree& pt,
2424
const std::shared_ptr<GraphReader>& graph_reader = {});
2525

26-
/**
27-
* Alternative to GetTiles() to query whether a level even exists, e.g. transit.#
28-
*
29-
* @param level the level to query
30-
* @return boolean indicating whether a level even exists
31-
*/
32-
bool level_color_exists(const uint32_t level) const;
33-
3426
/**
3527
* Returns the color for the given graphid
3628
*
@@ -47,9 +39,8 @@ class connectivity_map_t {
4739
* @param radius the radius of the circle
4840
* @return colors the colors of the tiles that intersect this circle at this level
4941
*/
50-
std::unordered_set<size_t> get_colors(const baldr::TileLevel& hierarchy_level,
51-
const baldr::PathLocation& location,
52-
float radius) const;
42+
std::unordered_set<size_t>
43+
get_colors(uint32_t hierarchy_level, const baldr::PathLocation& location, float radius) const;
5344

5445
/**
5546
* Returns the geojson representing the connectivity map

include/common/valhalla/baldr/curl_tilegetter.h

+3-19
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#pragma once
22

3-
#include <string>
4-
#include <utility>
5-
63
#include <valhalla/baldr/curler.h>
74
#include <valhalla/baldr/tilegetter.h>
85

6+
#include <string>
7+
#include <utility>
8+
99
namespace valhalla {
1010
namespace baldr {
1111

@@ -55,21 +55,5 @@ class curl_tile_getter_t : public tile_getter_t {
5555
const interrupt_t* interrupt_ = nullptr;
5656
};
5757

58-
/**
59-
* @brief Build uri address to make remote call
60-
* @name[in] tile_url Base url address
61-
* @name[in] fname File to call for
62-
* @name[in] remote_path This parameter is used only in testing
63-
* @return full uri address
64-
*/
65-
inline std::string make_single_point_url(const std::string& tile_url,
66-
const std::string& fname,
67-
const std::string& remote_path = {}) {
68-
static const std::string path_pattern{"{tilePath}"};
69-
auto id_pos = tile_url.find(path_pattern);
70-
return tile_url.substr(0, id_pos) + remote_path + fname +
71-
tile_url.substr(id_pos + path_pattern.size());
72-
}
73-
7458
} // namespace baldr
7559
} // namespace valhalla

include/common/valhalla/baldr/datetime.h

+1-15
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,14 @@
1212
#include <unordered_map>
1313
#include <vector>
1414

15-
// date emits a warning otherwise for C++17, see
16-
// https://github.com/valhalla/valhalla/pull/3878#issuecomment-1365487437
17-
#define HAS_UNCAUGHT_EXCEPTIONS 1
18-
19-
#if defined(__GNUC__) && !defined(__clang__)
20-
#pragma GCC diagnostic push
21-
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
22-
#pragma GCC diagnostic push
23-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
24-
#endif
2515
#include <date/date.h>
2616
#include <date/tz.h>
27-
#if defined(__GNUC__) && !defined(__clang__)
28-
#pragma GCC diagnostic pop
29-
#pragma GCC diagnostic pop
30-
#endif
3117

3218
#include <valhalla/baldr/graphconstants.h>
3319
#include <valhalla/baldr/nodeinfo.h>
3420
#include <valhalla/midgard/constants.h>
3521

36-
#include <valhalla/proto/common.pb.h>
22+
#include <valhalla/proto/tripcommon.pb.h>
3723

3824
namespace valhalla {
3925
namespace baldr {

include/common/valhalla/baldr/directededge.h

+1-65
Original file line numberDiff line numberDiff line change
@@ -327,20 +327,6 @@ class DirectedEdge {
327327
*/
328328
void set_bridge(const bool bridge);
329329

330-
/**
331-
* Is this edge indoor?
332-
* @return Returns true if this edge is indoor, false if not (outdoor).
333-
*/
334-
bool indoor() const {
335-
return indoor_;
336-
}
337-
338-
/**
339-
* Sets the flag indicating this edge is indoor.
340-
* @param indoor True if the edge is indoor, false if not (outdoor).
341-
*/
342-
void set_indoor(const bool indoor);
343-
344330
/**
345331
* Get the HOV type (see graphconstants.h).
346332
*/
@@ -564,17 +550,6 @@ class DirectedEdge {
564550
return static_cast<Use>(use_);
565551
}
566552

567-
/**
568-
* Evaluates a basic set of conditions to determine if this directed edge is a valid potential
569-
* member of a shortcut. This is used while forming and resolving shortcuts.
570-
* @return true if the edge is not a shortcut, not related to transit and not under construction
571-
*/
572-
bool can_form_shortcut() const {
573-
return !is_shortcut() && !bss_connection() && use() != Use::kTransitConnection &&
574-
use() != Use::kEgressConnection && use() != Use::kPlatformConnection &&
575-
use() != Use::kConstruction;
576-
}
577-
578553
/**
579554
* Sets the specialized use type of this edge.
580555
* @param use Use of this edge.
@@ -1087,29 +1062,6 @@ class DirectedEdge {
10871062
return superseded_;
10881063
}
10891064

1090-
#ifdef _WIN32
1091-
// TODO: Workaround for missing strings.h on Windows. Replace with platform independent
1092-
// std::countr_zero in C++20 (see https://en.cppreference.com/w/cpp/numeric/countr_zero).
1093-
int ffs(int mask) const {
1094-
if (0 == mask)
1095-
return 0;
1096-
1097-
int idx;
1098-
for (idx = 1; !(mask & 1); ++idx)
1099-
mask >>= 1;
1100-
return idx;
1101-
}
1102-
#endif
1103-
1104-
/**
1105-
* Unlike superseded(), this does not return the raw mask but the shortcut index
1106-
* that was originally passed to set_superseded().
1107-
* @return Returns the index of the set bit in the superseded mask.
1108-
*/
1109-
uint32_t superseded_idx() const {
1110-
return ffs(superseded_);
1111-
}
1112-
11131065
/**
11141066
* Set the mask for whether this edge is superseded by a shortcut edge.
11151067
* Superseded edges can be skipped unless downward transitions are allowed.
@@ -1159,20 +1111,6 @@ class DirectedEdge {
11591111
return bss_connection_;
11601112
}
11611113

1162-
/**
1163-
* Set the flag indicating whether the edge is lit
1164-
* @param lit the edge's lit state
1165-
*/
1166-
void set_lit(const bool lit);
1167-
1168-
/**
1169-
* Is the edge lit?
1170-
* @return Returns the edge's lit state
1171-
*/
1172-
bool lit() const {
1173-
return lit_;
1174-
}
1175-
11761114
/**
11771115
* Create a json object representing this edge
11781116
* @return Returns the json object
@@ -1239,9 +1177,7 @@ class DirectedEdge {
12391177
uint64_t stop_sign_ : 1; // Stop sign at end of the directed edge
12401178
uint64_t yield_sign_ : 1; // Yield/give way sign at end of the directed edge
12411179
uint64_t hov_type_ : 1; // if (is_hov_only()==true), this means (HOV2=0, HOV3=1)
1242-
uint64_t indoor_ : 1; // Is this edge indoor
1243-
uint64_t lit_ : 1; // Is the edge lit?
1244-
uint64_t spare4_ : 4;
1180+
uint64_t spare4_ : 6;
12451181

12461182
// 5th 8-byte word
12471183
uint64_t turntype_ : 24; // Turn type (see graphconstants.h)

include/common/valhalla/baldr/double_bucket_queue.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,10 @@ template <typename label_t> class DoubleBucketQueue final {
200200
* @return Returns the bucket that the cost lies within.
201201
*/
202202
bucket_t& get_bucket(const float cost) {
203-
return (cost < currentcost_) ? *currentbucket_
204-
: (cost < maxcost_) ? buckets_[static_cast<uint32_t>((cost - mincost_) * inv_)]
205-
: overflowbucket_;
203+
return (cost < currentcost_)
204+
? *currentbucket_
205+
: (cost < maxcost_) ? buckets_[static_cast<uint32_t>((cost - mincost_) * inv_)]
206+
: overflowbucket_;
206207
}
207208

208209
/**

include/common/valhalla/baldr/edgeinfo.h

+4-29
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include <cstdint>
55
#include <map>
66
#include <string>
7-
#include <tuple>
87
#include <vector>
98

109
#include <valhalla/baldr/graphid.h>
@@ -152,16 +151,6 @@ class EdgeInfo {
152151
*/
153152
std::vector<std::string> GetNames() const;
154153

155-
/** Convenience method to get the names and route number flags for an edge.
156-
*
157-
* This one does not calculate the types
158-
* Like GetNamesAndTypes but without using memory for the types
159-
*
160-
* @param include_tagged_values Bool indicating whether or not to return the tagged values too
161-
* @return Returns a list (vector) (name, route number flag) pairs
162-
*/
163-
std::vector<std::pair<std::string, bool>> GetNames(bool include_tagged_values) const;
164-
165154
/**
166155
* Convenience method to get the names for an edge
167156
* @param only_pronunciations Bool indicating whether or not to return only the pronunciations
@@ -171,13 +160,13 @@ class EdgeInfo {
171160
std::vector<std::string> GetTaggedValues(bool only_pronunciations = false) const;
172161

173162
/**
174-
* Convenience method to get the names, route number flags and tag value type for an edge.
163+
* Convenience method to get the names and route number flags for an edge.
175164
* @param include_tagged_values Bool indicating whether or not to return the tagged values too
176165
*
177-
* @return Returns a list (vector) of name/route number flags/types tuples.
166+
* @return Returns a list (vector) of name/route number pairs.
178167
*/
179-
std::vector<std::tuple<std::string, bool, uint8_t>>
180-
GetNamesAndTypes(bool include_tagged_names = false) const;
168+
std::vector<std::pair<std::string, bool>> GetNamesAndTypes(std::vector<uint8_t>& types,
169+
bool include_tagged_names = false) const;
181170

182171
/**
183172
* Convenience method to get tags of the edge.
@@ -223,20 +212,6 @@ class EdgeInfo {
223212
*/
224213
int8_t layer() const;
225214

226-
/**
227-
* Get level of the edge.
228-
* @see https://wiki.openstreetmap.org/wiki/Key:level
229-
* @return layer index of the edge
230-
*/
231-
232-
std::string level() const;
233-
/**
234-
* Get layer:ref of the edge.
235-
* @see https://wiki.openstreetmap.org/wiki/Key:level:ref
236-
* @return layer index of the edge
237-
*/
238-
std::string level_ref() const;
239-
240215
/**
241216
* Returns json representing this object
242217
* @return json object

0 commit comments

Comments
 (0)