Merge branch 'master' into avoid_samelookup_in_heap_map

This commit is contained in:
xlaussel
2020-11-26 21:29:27 +01:00
368 changed files with 1188 additions and 1151 deletions
+2 -2
View File
@@ -130,7 +130,7 @@ inline std::ostream &operator<<(std::ostream &stream, const Alias<From, Tag> &in
{
return stream << inst.__value;
}
}
} // namespace osrm
namespace std
{
@@ -143,6 +143,6 @@ template <typename From, typename Tag> struct hash<osrm::Alias<From, Tag>>
return std::hash<From>()(static_cast<const From>(s));
}
};
}
} // namespace std
#endif // OSRM_ALIAS_HPP
+3 -3
View File
@@ -39,7 +39,7 @@ inline std::size_t countOnes(unsigned int value) { return __builtin_popcount(val
inline std::size_t countOnes(unsigned long value) { return __builtin_popcountl(value); }
inline std::size_t countOnes(unsigned long long value) { return __builtin_popcountll(value); }
#endif
}
} // namespace detail
// Investigate if we can replace this with
// http://www.boost.org/doc/libs/1_64_0/libs/dynamic_bitset/dynamic_bitset.html
@@ -93,7 +93,7 @@ template <typename T> auto makeBitRange(const T value)
{
return boost::make_iterator_range(BitIterator<T>{value}, BitIterator<T>{});
}
}
}
} // namespace util
} // namespace osrm
#endif
+3 -3
View File
@@ -42,8 +42,8 @@ template <typename T, int Precision = 6> inline std::string to_string_with_preci
return rv;
}
}
}
}
} // namespace cast
} // namespace util
} // namespace osrm
#endif // CAST_HPP
+2 -2
View File
@@ -74,7 +74,7 @@ struct ConcurrentIDMap
}
};
} // util
} // osrm
} // namespace util
} // namespace osrm
#endif // CONCURRENT_ID_MAP_HPP
+2 -2
View File
@@ -21,7 +21,7 @@ struct ConditionalRestriction
std::vector<ConditionalRestriction> ParseConditionalRestrictions(const std::string &str);
} // util
} // osrm
} // namespace util
} // namespace osrm
#endif // OSRM_CONDITIONAL_RESTRICTIONS_HPP
+2 -2
View File
@@ -84,7 +84,7 @@ struct ConnectivityChecksum
std::size_t byte_number;
unsigned char bit_number;
};
}
}
} // namespace util
} // namespace osrm
#endif
+2 -2
View File
@@ -16,7 +16,7 @@ void append_to_container(Container &&container, T value, Args &&... args)
container.emplace_back(value);
append_to_container(std::forward<Container>(container), std::forward<Args>(args)...);
}
}
}
} // namespace util
} // namespace osrm
#endif
+3 -3
View File
@@ -60,7 +60,7 @@ struct unsafelatitude
struct unsafelongitude
{
};
}
} // namespace tag
// Internal lon/lat types - assumed to be range safe
using FixedLatitude = Alias<std::int32_t, tag::latitude>;
@@ -265,7 +265,7 @@ inline Coordinate::Coordinate(const FloatCoordinate &other)
: Coordinate(toFixed(other.lon), toFixed(other.lat))
{
}
}
}
} // namespace util
} // namespace osrm
#endif /* COORDINATE_HPP_ */
+8 -9
View File
@@ -38,7 +38,7 @@ inline double radToDeg(const double radian)
using namespace boost::math::constants;
return radian * (180.0 * (1. / pi<double>()));
}
}
} // namespace detail
//! Takes the squared euclidean distance of the input coordinates. Does not return meters!
std::uint64_t squaredEuclideanDistance(const Coordinate lhs, const Coordinate rhs);
@@ -224,7 +224,7 @@ double findClosestDistance(const iterator_type lhs_begin,
double current_min = std::numeric_limits<double>::max();
const auto compute_minimum_distance_in_rhs = [&current_min, rhs_begin, rhs_end](
const Coordinate coordinate) {
const Coordinate coordinate) {
current_min = std::min(current_min, findClosestDistance(coordinate, rhs_begin, rhs_end));
return false;
};
@@ -320,10 +320,9 @@ std::pair<Coordinate, Coordinate> leastSquareRegression(const iterator_type begi
end,
0.,
[&](const auto sum_so_far, const auto current_coordinate) {
return sum_so_far +
(extract_lon(current_coordinate) - mean_lon) *
(extract_lat(current_coordinate) - mean_lat) /
(sample_variance_lon * sample_variance_lat);
return sum_so_far + (extract_lon(current_coordinate) - mean_lon) *
(extract_lat(current_coordinate) - mean_lat) /
(sample_variance_lon * sample_variance_lat);
}) /
(number_of_coordinates - 1);
@@ -383,8 +382,8 @@ bool areParallel(const iterator_type lhs_begin,
double computeArea(const std::vector<Coordinate> &polygon);
} // ns coordinate_calculation
} // ns util
} // ns osrm
} // namespace coordinate_calculation
} // namespace util
} // namespace osrm
#endif // COORDINATE_CALCULATION
+5 -3
View File
@@ -273,7 +273,9 @@ template <typename ElementT> class DeallocatingVector
++current_size;
}
void reserve(const std::size_t) const { /* don't do anything */}
void reserve(const std::size_t) const
{ /* don't do anything */
}
void resize(const std::size_t new_size)
{
@@ -350,7 +352,7 @@ template <typename T> void swap(DeallocatingVector<T> &lhs, DeallocatingVector<T
{
lhs.swap(rhs);
}
}
}
} // namespace util
} // namespace osrm
#endif /* DEALLOCATING_VECTOR_HPP */
+13 -13
View File
@@ -27,7 +27,7 @@ inline std::ostream &operator<<(std::ostream &out, const Coordinate &coordinate)
<< toFloating(coordinate.lat) << "}";
return out;
}
}
} // namespace util
namespace engine
{
@@ -62,8 +62,8 @@ inline std::ostream &operator<<(std::ostream &out, const RouteStep &step)
return out;
}
}
}
} // namespace guidance
} // namespace engine
namespace guidance
{
@@ -76,7 +76,7 @@ inline std::ostream &operator<<(std::ostream &out, const ConnectedRoad &road)
<< static_cast<std::int32_t>(road.lane_data_id) << "}";
return out;
}
}
} // namespace guidance
namespace extractor
{
@@ -95,7 +95,7 @@ inline std::ostream &operator<<(std::ostream &out, const IntersectionViewData &v
<< " angle: " << view.angle << " bearing: " << view.perceived_bearing << "}";
return out;
}
}
} // namespace intersection
namespace TurnLaneType
{
@@ -125,9 +125,9 @@ inline std::ostream &operator<<(std::ostream &out, const Mask lane_type)
return out;
}
}
}
}
} // namespace TurnLaneType
} // namespace extractor
} // namespace osrm
namespace std
{
@@ -147,7 +147,7 @@ inline std::ostream &operator<<(std::ostream &out,
return out;
}
}
} // namespace std
namespace osrm
{
@@ -186,8 +186,8 @@ inline std::ostream &operator<<(std::ostream &out, const LaneDataVector &turn_la
return out;
}
}
}
} // namespace lanes
} // namespace guidance
namespace extractor
{
@@ -204,7 +204,7 @@ inline std::ostream &operator<<(std::ostream &out, const EdgeBasedEdge &edge)
out << "}";
return out;
}
}
}
} // namespace extractor
} // namespace osrm
#endif /*OSRM_ENGINE_GUIDANCE_DEBUG_HPP_*/
+2 -2
View File
@@ -77,7 +77,7 @@ template <typename T> class DistTableWrapper
std::vector<T> table_;
const std::size_t number_of_nodes_;
};
}
}
} // namespace util
} // namespace osrm
#endif // DIST_TABLE_WRAPPER_H
+3 -3
View File
@@ -41,7 +41,7 @@ template <typename NodeIterator, typename EdgeDataT> struct DynamicEdge
NodeIterator target;
EdgeDataT data;
};
}
} // namespace detail
template <typename EdgeDataT> class DynamicGraph
{
@@ -468,7 +468,7 @@ template <typename EdgeDataT> class DynamicGraph
std::vector<Node> node_array;
DeallocatingVector<Edge> edge_list;
};
}
}
} // namespace util
} // namespace osrm
#endif // DYNAMICGRAPH_HPP
+2 -2
View File
@@ -123,7 +123,7 @@ class RuntimeError : public exception
return result;
}
};
}
}
} // namespace util
} // namespace osrm
#endif /* OSRM_EXCEPTION_HPP */
+2 -2
View File
@@ -29,7 +29,7 @@ excludeFlagsToNodeFilter(const NodeID number_of_nodes,
}
return filters;
}
}
}
} // namespace util
} // namespace osrm
#endif
+3 -3
View File
@@ -153,13 +153,13 @@ class FilteredGraphImpl<util::StaticGraph<EdgeDataT, Ownership>, Ownership>
Graph graph;
Vector<bool> edge_filter;
};
}
} // namespace detail
template <typename GraphT>
using FilteredGraphContainer = detail::FilteredGraphImpl<GraphT, storage::Ownership::Container>;
template <typename GraphT>
using FilteredGraphView = detail::FilteredGraphImpl<GraphT, storage::Ownership::View>;
}
}
} // namespace util
} // namespace osrm
#endif
+2 -2
View File
@@ -95,7 +95,7 @@ filtered_irange(const Integer first,
{
return filtered_range<Integer, Filter>(first, last, filter);
}
}
}
} // namespace util
} // namespace osrm
#endif // INTEGER_RANGE_HPP
+2 -2
View File
@@ -36,7 +36,7 @@ struct FingerPrint
static_assert(sizeof(FingerPrint) == 8, "FingerPrint has unexpected size");
static_assert(std::is_trivial<FingerPrint>::value, "FingerPrint needs to be trivial.");
static_assert(std::is_pod<FingerPrint>::value, "FingerPrint needs to be a POD.");
}
}
} // namespace util
} // namespace osrm
#endif /* FingerPrint_H */
+2 -2
View File
@@ -20,7 +20,7 @@ template <typename Iter, typename Func> void for_each_range(Iter begin, Iter end
f(begin_range, iter);
}
}
}
}
} // namespace util
} // namespace osrm
#endif
+2 -2
View File
@@ -77,6 +77,6 @@ inline void validateFeature(const rapidjson::Value &feature)
if (coord_array.Empty())
throw osrm::util::exception("Feature geometry coordinates member is empty.");
}
}
}
} // namespace util
} // namespace osrm
#endif // OSRM_GEOJSON_VALIDATION_HPP
+3 -3
View File
@@ -49,8 +49,8 @@ struct HasFirstEdgeMember<T, decltype((void)(sizeof(std::declval<T>().first_edge
{
};
} // ns traits
} // ns util
} // ns osrm
} // namespace traits
} // namespace util
} // namespace osrm
#endif // STATIC_GRAPH_TRAITS_HPP
+2 -2
View File
@@ -96,7 +96,7 @@ std::vector<OutputEdgeT> directedEdgesFromCompressed(const std::vector<InputEdge
return output_edge_list;
}
}
}
} // namespace util
} // namespace osrm
#endif
+2 -2
View File
@@ -34,7 +34,7 @@ Fn group_by(Iter first, Iter last, Pred pred, Fn fn)
return fn;
}
} // ns util
} // ns osrm
} // namespace util
} // namespace osrm
#endif
+2 -2
View File
@@ -71,8 +71,8 @@ class BearingClass
// make Bearing Class hasbable
namespace std
{
inline size_t hash<::osrm::util::guidance::BearingClass>::
operator()(const ::osrm::util::guidance::BearingClass &bearing_class) const
inline size_t hash<::osrm::util::guidance::BearingClass>::operator()(
const ::osrm::util::guidance::BearingClass &bearing_class) const
{
return boost::hash_value(bearing_class.available_bearings);
}
+3 -3
View File
@@ -72,7 +72,7 @@ static_assert(std::is_trivially_copyable<EntryClass>::value,
#endif
} // namespace guidance
} // namespace utilr
} // namespace util
constexpr const util::guidance::EntryClass EMPTY_ENTRY_CLASS{};
} // namespace osrm
@@ -80,8 +80,8 @@ constexpr const util::guidance::EntryClass EMPTY_ENTRY_CLASS{};
// make Entry Class hasbable
namespace std
{
inline size_t hash<::osrm::util::guidance::EntryClass>::
operator()(const ::osrm::util::guidance::EntryClass &entry_class) const
inline size_t hash<::osrm::util::guidance::EntryClass>::operator()(
const ::osrm::util::guidance::EntryClass &entry_class) const
{
return hash<::osrm::util::guidance::EntryClass::FlagBaseType>()(
entry_class.enabled_entries_flags);
+2 -2
View File
@@ -69,7 +69,7 @@ inline std::uint64_t GetHilbertCode(const Coordinate &coordinate)
static_cast<std::int32_t>(90 * COORDINATE_PRECISION);
return HilbertToLinear(x, y);
}
}
}
} // namespace util
} // namespace osrm
#endif /* HILBERT_VALUE_HPP */
+5 -3
View File
@@ -52,7 +52,8 @@ struct DiyFp
DiyFp(double d)
{
union {
union
{
double d;
uint64_t u64;
} u = {d};
@@ -247,8 +248,9 @@ inline DiyFp GetCachedPower(int e, int *K)
inline void
GrisuRound(char *buffer, int len, uint64_t delta, uint64_t rest, uint64_t ten_kappa, uint64_t wp_w)
{
while (rest < wp_w && delta - rest >= ten_kappa && (rest + ten_kappa < wp_w || /// closer
wp_w - rest > rest + ten_kappa - wp_w))
while (rest < wp_w && delta - rest >= ten_kappa &&
(rest + ten_kappa < wp_w || /// closer
wp_w - rest > rest + ten_kappa - wp_w))
{
buffer[len - 1]--;
rest += ten_kappa;
+1 -3
View File
@@ -69,9 +69,7 @@ template <int N, typename T = std::string> struct VariableGroupBlock
inline void
var_advance(DataIterator &data, DataIterator &length, std::uint32_t byte_length) const
{
if (byte_length == 0)
{
}
if (byte_length == 0) {}
else if (byte_length == 1)
{
data += static_cast<unsigned char>(*length++);
+2 -2
View File
@@ -90,7 +90,7 @@ irange(const Integer first,
{
return range<Integer>(first, last);
}
}
}
} // namespace util
} // namespace osrm
#endif // INTEGER_RANGE_HPP
+5 -5
View File
@@ -40,8 +40,8 @@ struct Comparator
bool is_same = lhs.value == rhs.value;
if (!is_same)
{
reason = lhs_path + " (= " + std::to_string(lhs.value) + ") != " + rhs_path + " (= " +
std::to_string(rhs.value) + ")";
reason = lhs_path + " (= " + std::to_string(lhs.value) + ") != " + rhs_path +
" (= " + std::to_string(rhs.value) + ")";
}
return is_same;
}
@@ -158,8 +158,8 @@ inline bool compare(const Value &reference, const Value &result, std::string &re
return mapbox::util::apply_visitor(
Comparator(reason, "reference", "result"), reference, result);
}
}
}
}
} // namespace json
} // namespace util
} // namespace osrm
#endif
+2 -2
View File
@@ -101,7 +101,7 @@ class UnbufferedLog : public Log
public:
UnbufferedLog(LogLevel level_ = logINFO);
};
}
}
} // namespace util
} // namespace osrm
#endif /* LOG_HPP */
+4 -3
View File
@@ -1,7 +1,8 @@
#ifndef LUA_UTIL_HPP
#define LUA_UTIL_HPP
extern "C" {
extern "C"
{
#include <lauxlib.h>
#include <lua.h>
#include <lualib.h>
@@ -27,7 +28,7 @@ inline void luaAddScriptFolderToLoadPath(lua_State *lua_state, const char *file_
const std::string lua_code = "package.path = \"" + folder + "/?.lua;\" .. package.path";
luaL_dostring(lua_state, lua_code.c_str());
}
}
}
} // namespace util
} // namespace osrm
#endif // LUA_UTIL_HPP
+2 -2
View File
@@ -46,7 +46,7 @@ template <typename T> class MatrixGraphWrapper
const std::vector<T> table_;
const std::size_t number_of_nodes_;
};
}
}
} // namespace util
} // namespace osrm
#endif // MATRIX_GRAPH_WRAPPER_H
+2 -2
View File
@@ -28,7 +28,7 @@ inline void DumpMemoryStats()
util::Log() << "RAM: peak bytes used: <not implemented on Windows>";
#endif // _WIN32
}
}
}
} // namespace util
} // namespace osrm
#endif
+3 -3
View File
@@ -60,7 +60,7 @@ util::vector_view<T> mmapFile(const boost::filesystem::path &file,
SOURCE_REF);
}
}
}
} // namespace detail
template <typename T>
util::vector_view<const T> mmapFile(const boost::filesystem::path &file,
@@ -83,7 +83,7 @@ util::vector_view<T> mmapFile(const boost::filesystem::path &file,
{
return detail::mmapFile<T>(file, mmap_container, size);
}
}
}
} // namespace util
} // namespace osrm
#endif
+2 -2
View File
@@ -38,7 +38,7 @@ inline DataMap mmapTarFile(const boost::filesystem::path &path,
return map;
}
}
}
} // namespace util
} // namespace osrm
#endif
+2 -2
View File
@@ -47,7 +47,7 @@ inline std::size_t msb(unsigned int v)
return MSB_INDEX - __builtin_clz(v);
}
#endif
}
}
} // namespace util
} // namespace osrm
#endif
+2 -2
View File
@@ -97,7 +97,7 @@ NodeBasedDynamicGraphFromEdges(NodeID number_of_nodes,
return NodeBasedDynamicGraph(number_of_nodes, edges_list);
}
}
}
} // namespace util
} // namespace osrm
#endif // NODE_BASED_GRAPH_HPP
+2 -2
View File
@@ -223,7 +223,7 @@ std::vector<OpeningHours> ParseOpeningHours(const std::string &str);
bool CheckOpeningHours(const std::vector<OpeningHours> &input, const struct tm &time);
} // util
} // osrm
} // namespace util
} // namespace osrm
#endif // OSRM_OPENING_HOURS_HPP
+4 -4
View File
@@ -37,7 +37,7 @@ template <typename T, std::size_t Bits, storage::Ownership Ownership>
inline void write(storage::tar::FileWriter &writer,
const std::string &name,
const detail::PackedVector<T, Bits, Ownership> &vec);
}
} // namespace serialization
namespace detail
{
@@ -546,13 +546,13 @@ template <typename T, std::size_t Bits, storage::Ownership Ownership> class Pack
util::ViewOrVector<WordT, Ownership> vec;
std::uint64_t num_elements = 0;
};
}
} // namespace detail
template <typename T, std::size_t Bits>
using PackedVector = detail::PackedVector<T, Bits, storage::Ownership::Container>;
template <typename T, std::size_t Bits>
using PackedVectorView = detail::PackedVector<T, Bits, storage::Ownership::View>;
}
}
} // namespace util
} // namespace osrm
#endif /* PACKED_VECTOR_HPP */
+2 -2
View File
@@ -87,7 +87,7 @@ class Percent
}
}
};
}
}
} // namespace util
} // namespace osrm
#endif // PERCENT_HPP
+3 -3
View File
@@ -33,7 +33,7 @@ template <unsigned BlockSize, storage::Ownership Ownership>
void read(storage::tar::FileReader &reader,
const std::string &name,
util::RangeTable<BlockSize, Ownership> &table);
}
} // namespace serialization
/**
* Stores adjacent ranges in a compressed format.
@@ -209,7 +209,7 @@ unsigned RangeTable<BLOCK_SIZE, Ownership>::PrefixSumAtIndex(int index, const Bl
return sum;
}
}
}
} // namespace util
} // namespace osrm
#endif // RANGE_TABLE_HPP
+2 -2
View File
@@ -171,7 +171,7 @@ struct RectangleInt2D
max_lat != FixedLatitude{std::numeric_limits<std::int32_t>::min()};
}
};
}
}
} // namespace util
} // namespace osrm
#endif
+3 -3
View File
@@ -143,8 +143,8 @@ void write(storage::tar::FileWriter &writer,
storage::serialization::write(
writer, name + "/search_tree_level_starts", rtree.m_tree_level_starts);
}
}
}
}
} // namespace serialization
} // namespace util
} // namespace osrm
#endif
+2 -2
View File
@@ -20,7 +20,7 @@ template <typename It, typename Category> inline void static_assert_iter_categor
static_assert(std::is_base_of<Category, IterCategoryType>::value, "");
}
} // ns util
} // ns osrm
} // namespace util
} // namespace osrm
#endif // OSRM_STATIC_ASSERT_HPP
+1 -1
View File
@@ -36,7 +36,7 @@ template <typename EdgeDataT, storage::Ownership Ownership>
void write(storage::tar::FileWriter &writer,
const std::string &name,
const StaticGraph<EdgeDataT, Ownership> &graph);
}
} // namespace serialization
namespace static_graph_details
{
+9 -8
View File
@@ -64,7 +64,7 @@ inline void
write(storage::tar::FileWriter &writer,
const std::string &name,
const util::StaticRTree<EdgeDataT, Ownership, BRANCHING_FACTOR, LEAF_PAGE_SIZE> &rtree);
}
} // namespace serialization
/***
* Static RTree for serving nearest neighbour queries
@@ -559,11 +559,12 @@ class StaticRTree
std::vector<EdgeDataT> Nearest(const Coordinate input_coordinate,
const std::size_t max_results) const
{
return Nearest(input_coordinate,
[](const CandidateSegment &) { return std::make_pair(true, true); },
[max_results](const std::size_t num_results, const CandidateSegment &) {
return num_results >= max_results;
});
return Nearest(
input_coordinate,
[](const CandidateSegment &) { return std::make_pair(true, true); },
[max_results](const std::size_t num_results, const CandidateSegment &) {
return num_results >= max_results;
});
}
// Override filter and terminator for the desired behaviour.
@@ -773,7 +774,7 @@ class StaticRTree
//[2] "Nearest Neighbor Queries", N. Roussopulos et al; 1995; DOI: 10.1145/223784.223794
//[3] "Distance Browsing in Spatial Databases"; G. Hjaltason, H. Samet; 1999; ACM Trans. DB Sys
// Vol.24 No.2, pp.265-318
}
}
} // namespace util
} // namespace osrm
#endif // STATIC_RTREE_HPP
+1 -1
View File
@@ -36,6 +36,6 @@ template <typename T1, typename T2> struct hash<std::pair<T1, T2>>
return hash_val(pair.first, pair.second);
}
};
}
} // namespace std
#endif // STD_HASH_HPP
+2 -2
View File
@@ -125,7 +125,7 @@ inline std::size_t URIDecode(const std::string &input, std::string &output)
}
inline std::size_t URIDecodeInPlace(std::string &URI) { return URIDecode(URI, URI); }
}
}
} // namespace util
} // namespace osrm
#endif // STRING_UTIL_HPP
+2 -2
View File
@@ -88,7 +88,7 @@ template <std::size_t TimeBinSize = 1000, std::size_t IndexBinSize = 1000> class
std::vector<std::uint32_t> frame_offsets;
std::vector<std::uint32_t> frame_counters;
};
}
}
} // namespace util
} // namespace osrm
#endif
+2 -2
View File
@@ -44,7 +44,7 @@ class Timezoner
rtree_t rtree;
std::vector<local_time_t> local_times;
};
}
}
} // namespace updater
} // namespace osrm
#endif
+2 -2
View File
@@ -23,7 +23,7 @@ namespace util
std::chrono::duration_cast<std::chrono::microseconds>(_X##_stop - _X##_start).count())
#define TIMER_MIN(_X) \
std::chrono::duration_cast<std::chrono::minutes>(_X##_stop - _X##_start).count()
}
}
} // namespace util
} // namespace osrm
#endif // TIMING_UTIL_HPP
+2 -2
View File
@@ -25,7 +25,7 @@ inline std::string toOSMLink(const util::Coordinate &c)
<< toFloating(c.lat) << "&mlon=" << toFloating(c.lon);
return link.str();
}
}
}
} // namespace util
} // namespace osrm
#endif
+2 -2
View File
@@ -431,7 +431,7 @@ inline double atan2_lookup(double y, double x)
}
return angle;
}
}
}
} // namespace util
} // namespace osrm
#endif // TRIGONOMETRY_TABLE_HPP
+1 -1
View File
@@ -48,7 +48,7 @@ struct osm_way_id
struct duplicated_node
{
};
}
} // namespace tag
using OSMNodeID = osrm::Alias<std::uint64_t, tag::osm_node_id>;
static_assert(std::is_pod<OSMNodeID>(), "OSMNodeID is not a valid alias");
using OSMWayID = osrm::Alias<std::uint64_t, tag::osm_way_id>;
+3 -3
View File
@@ -12,7 +12,7 @@ namespace vector_tile
// Vector tiles are 4096 virtual pixels on each side
const constexpr double EXTENT = 4096.0;
const constexpr double BUFFER = 128.0;
}
}
}
} // namespace vector_tile
} // namespace util
} // namespace osrm
#endif
+2 -2
View File
@@ -268,7 +268,7 @@ struct is_view_or_vector
std::is_same<util::vector_view<ValueT>, VectorT>::value>
{
};
}
}
} // namespace util
} // namespace osrm
#endif // SHARED_MEMORY_VECTOR_WRAPPER_HPP
+4 -4
View File
@@ -26,7 +26,7 @@ static constexpr unsigned MIN_ZOOM = 1;
static constexpr double VIEWPORT_WIDTH = 8 * web_mercator::TILE_SIZE;
static constexpr double VIEWPORT_HEIGHT = 5 * web_mercator::TILE_SIZE;
static double INV_LOG_2 = 1. / std::log(2);
}
} // namespace detail
inline unsigned getFittedZoom(util::Coordinate south_west, util::Coordinate north_east)
{
@@ -44,8 +44,8 @@ inline unsigned getFittedZoom(util::Coordinate south_west, util::Coordinate nort
else
return detail::MIN_ZOOM;
}
}
}
}
} // namespace viewport
} // namespace util
} // namespace osrm
#endif
+4 -4
View File
@@ -22,7 +22,7 @@ const constexpr double MAXEXTENT = EARTH_RADIUS_WGS84 * boost::math::constants::
// ^ math functions are not constexpr since they have side-effects (setting errno) :(
const constexpr double EPSG3857_MAX_LATITUDE = 85.051128779806592378; // 90(4*atan(exp(pi))/pi-1)
const constexpr double MAX_LONGITUDE = 180.0;
}
} // namespace detail
// Converts projected mercator degrees to PX
const constexpr double DEGREE_TO_PX = detail::MAXEXTENT / 180.0;
@@ -169,8 +169,8 @@ inline void xyzToMercator(
maxx = static_cast<double>(clamp(util::FloatLongitude{maxx})) * DEGREE_TO_PX;
maxy = latToY(util::FloatLatitude{maxy}) * DEGREE_TO_PX;
}
}
}
}
} // namespace web_mercator
} // namespace util
} // namespace osrm
#endif
+2 -2
View File
@@ -65,7 +65,7 @@ template <std::size_t MaxNumElements = (1u << 16u)> class XORFastHash
return table1[lsb] ^ table2[msb];
}
};
}
}
} // namespace util
} // namespace osrm
#endif // XOR_FAST_HASH_HPP
+2 -2
View File
@@ -78,7 +78,7 @@ class XORFastHashStorage
XORFastHash<MaxNumElements> fast_hasher;
unsigned current_timestamp;
};
}
}
} // namespace util
} // namespace osrm
#endif // XOR_FAST_HASH_STORAGE_HPP