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

Commit

Permalink
reverted to same commit as eclever branch
Browse files Browse the repository at this point in the history
  • Loading branch information
chrstnbwnkl committed Jun 21, 2024
1 parent b9de602 commit 29a0c6f
Show file tree
Hide file tree
Showing 125 changed files with 33,008 additions and 17,139 deletions.
12 changes: 5 additions & 7 deletions include/common/valhalla/baldr/admin.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#ifndef VALHALLA_BALDR_ADMIN_H_
#define VALHALLA_BALDR_ADMIN_H_

#include <array>
#include <cstdint>
#include <cstring>
#include <stdint.h>

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

protected:
uint32_t country_offset_; // country name offset
uint32_t state_offset_; // state name offset
std::array<char, kCountryIso> country_iso_{}; // country ISO3166-1
std::array<char, kStateIso> state_iso_{}; // state ISO3166-2
char spare_[3]{}; // spare for byte alignment
uint32_t country_offset_; // country name offset
uint32_t state_offset_; // state name offset
char country_iso_[kCountryIso]{}; // country ISO3166-1
char state_iso_[kStateIso]{}; // state ISO3166-2
char spare_[3]{}; // spare for byte alignment
};

} // namespace baldr
Expand Down
13 changes: 2 additions & 11 deletions include/common/valhalla/baldr/connectivity_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ class connectivity_map_t {
connectivity_map_t(const boost::property_tree::ptree& pt,
const std::shared_ptr<GraphReader>& graph_reader = {});

/**
* Alternative to GetTiles() to query whether a level even exists, e.g. transit.#
*
* @param level the level to query
* @return boolean indicating whether a level even exists
*/
bool level_color_exists(const uint32_t level) const;

/**
* Returns the color for the given graphid
*
Expand All @@ -47,9 +39,8 @@ class connectivity_map_t {
* @param radius the radius of the circle
* @return colors the colors of the tiles that intersect this circle at this level
*/
std::unordered_set<size_t> get_colors(const baldr::TileLevel& hierarchy_level,
const baldr::PathLocation& location,
float radius) const;
std::unordered_set<size_t>
get_colors(uint32_t hierarchy_level, const baldr::PathLocation& location, float radius) const;

/**
* Returns the geojson representing the connectivity map
Expand Down
22 changes: 3 additions & 19 deletions include/common/valhalla/baldr/curl_tilegetter.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once

#include <string>
#include <utility>

#include <valhalla/baldr/curler.h>
#include <valhalla/baldr/tilegetter.h>

#include <string>
#include <utility>

namespace valhalla {
namespace baldr {

Expand Down Expand Up @@ -55,21 +55,5 @@ class curl_tile_getter_t : public tile_getter_t {
const interrupt_t* interrupt_ = nullptr;
};

/**
* @brief Build uri address to make remote call
* @name[in] tile_url Base url address
* @name[in] fname File to call for
* @name[in] remote_path This parameter is used only in testing
* @return full uri address
*/
inline std::string make_single_point_url(const std::string& tile_url,
const std::string& fname,
const std::string& remote_path = {}) {
static const std::string path_pattern{"{tilePath}"};
auto id_pos = tile_url.find(path_pattern);
return tile_url.substr(0, id_pos) + remote_path + fname +
tile_url.substr(id_pos + path_pattern.size());
}

} // namespace baldr
} // namespace valhalla
16 changes: 1 addition & 15 deletions include/common/valhalla/baldr/datetime.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,14 @@
#include <unordered_map>
#include <vector>

// date emits a warning otherwise for C++17, see
// https://github.com/valhalla/valhalla/pull/3878#issuecomment-1365487437
#define HAS_UNCAUGHT_EXCEPTIONS 1

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
#include <date/date.h>
#include <date/tz.h>
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif

#include <valhalla/baldr/graphconstants.h>
#include <valhalla/baldr/nodeinfo.h>
#include <valhalla/midgard/constants.h>

#include <valhalla/proto/common.pb.h>
#include <valhalla/proto/tripcommon.pb.h>

namespace valhalla {
namespace baldr {
Expand Down
66 changes: 1 addition & 65 deletions include/common/valhalla/baldr/directededge.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,20 +327,6 @@ class DirectedEdge {
*/
void set_bridge(const bool bridge);

/**
* Is this edge indoor?
* @return Returns true if this edge is indoor, false if not (outdoor).
*/
bool indoor() const {
return indoor_;
}

/**
* Sets the flag indicating this edge is indoor.
* @param indoor True if the edge is indoor, false if not (outdoor).
*/
void set_indoor(const bool indoor);

/**
* Get the HOV type (see graphconstants.h).
*/
Expand Down Expand Up @@ -564,17 +550,6 @@ class DirectedEdge {
return static_cast<Use>(use_);
}

/**
* Evaluates a basic set of conditions to determine if this directed edge is a valid potential
* member of a shortcut. This is used while forming and resolving shortcuts.
* @return true if the edge is not a shortcut, not related to transit and not under construction
*/
bool can_form_shortcut() const {
return !is_shortcut() && !bss_connection() && use() != Use::kTransitConnection &&
use() != Use::kEgressConnection && use() != Use::kPlatformConnection &&
use() != Use::kConstruction;
}

/**
* Sets the specialized use type of this edge.
* @param use Use of this edge.
Expand Down Expand Up @@ -1087,29 +1062,6 @@ class DirectedEdge {
return superseded_;
}

#ifdef _WIN32
// TODO: Workaround for missing strings.h on Windows. Replace with platform independent
// std::countr_zero in C++20 (see https://en.cppreference.com/w/cpp/numeric/countr_zero).
int ffs(int mask) const {
if (0 == mask)
return 0;

int idx;
for (idx = 1; !(mask & 1); ++idx)
mask >>= 1;
return idx;
}
#endif

/**
* Unlike superseded(), this does not return the raw mask but the shortcut index
* that was originally passed to set_superseded().
* @return Returns the index of the set bit in the superseded mask.
*/
uint32_t superseded_idx() const {
return ffs(superseded_);
}

/**
* Set the mask for whether this edge is superseded by a shortcut edge.
* Superseded edges can be skipped unless downward transitions are allowed.
Expand Down Expand Up @@ -1159,20 +1111,6 @@ class DirectedEdge {
return bss_connection_;
}

/**
* Set the flag indicating whether the edge is lit
* @param lit the edge's lit state
*/
void set_lit(const bool lit);

/**
* Is the edge lit?
* @return Returns the edge's lit state
*/
bool lit() const {
return lit_;
}

/**
* Create a json object representing this edge
* @return Returns the json object
Expand Down Expand Up @@ -1239,9 +1177,7 @@ class DirectedEdge {
uint64_t stop_sign_ : 1; // Stop sign at end of the directed edge
uint64_t yield_sign_ : 1; // Yield/give way sign at end of the directed edge
uint64_t hov_type_ : 1; // if (is_hov_only()==true), this means (HOV2=0, HOV3=1)
uint64_t indoor_ : 1; // Is this edge indoor
uint64_t lit_ : 1; // Is the edge lit?
uint64_t spare4_ : 4;
uint64_t spare4_ : 6;

// 5th 8-byte word
uint64_t turntype_ : 24; // Turn type (see graphconstants.h)
Expand Down
7 changes: 4 additions & 3 deletions include/common/valhalla/baldr/double_bucket_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,10 @@ template <typename label_t> class DoubleBucketQueue final {
* @return Returns the bucket that the cost lies within.
*/
bucket_t& get_bucket(const float cost) {
return (cost < currentcost_) ? *currentbucket_
: (cost < maxcost_) ? buckets_[static_cast<uint32_t>((cost - mincost_) * inv_)]
: overflowbucket_;
return (cost < currentcost_)
? *currentbucket_
: (cost < maxcost_) ? buckets_[static_cast<uint32_t>((cost - mincost_) * inv_)]
: overflowbucket_;
}

/**
Expand Down
33 changes: 4 additions & 29 deletions include/common/valhalla/baldr/edgeinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <cstdint>
#include <map>
#include <string>
#include <tuple>
#include <vector>

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

/** Convenience method to get the names and route number flags for an edge.
*
* This one does not calculate the types
* Like GetNamesAndTypes but without using memory for the types
*
* @param include_tagged_values Bool indicating whether or not to return the tagged values too
* @return Returns a list (vector) (name, route number flag) pairs
*/
std::vector<std::pair<std::string, bool>> GetNames(bool include_tagged_values) const;

/**
* Convenience method to get the names for an edge
* @param only_pronunciations Bool indicating whether or not to return only the pronunciations
Expand All @@ -171,13 +160,13 @@ class EdgeInfo {
std::vector<std::string> GetTaggedValues(bool only_pronunciations = false) const;

/**
* Convenience method to get the names, route number flags and tag value type for an edge.
* Convenience method to get the names and route number flags for an edge.
* @param include_tagged_values Bool indicating whether or not to return the tagged values too
*
* @return Returns a list (vector) of name/route number flags/types tuples.
* @return Returns a list (vector) of name/route number pairs.
*/
std::vector<std::tuple<std::string, bool, uint8_t>>
GetNamesAndTypes(bool include_tagged_names = false) const;
std::vector<std::pair<std::string, bool>> GetNamesAndTypes(std::vector<uint8_t>& types,
bool include_tagged_names = false) const;

/**
* Convenience method to get tags of the edge.
Expand Down Expand Up @@ -223,20 +212,6 @@ class EdgeInfo {
*/
int8_t layer() const;

/**
* Get level of the edge.
* @see https://wiki.openstreetmap.org/wiki/Key:level
* @return layer index of the edge
*/

std::string level() const;
/**
* Get layer:ref of the edge.
* @see https://wiki.openstreetmap.org/wiki/Key:level:ref
* @return layer index of the edge
*/
std::string level_ref() const;

/**
* Returns json representing this object
* @return json object
Expand Down
Loading

0 comments on commit 29a0c6f

Please sign in to comment.