Compare commits
49 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d47012a3e6 | |||
| bff349f1b1 | |||
| 9ce059f216 | |||
| 6090387c5e | |||
| 3096440505 | |||
| 8bd26dc8b6 | |||
| 70d67d0eea | |||
| fdd1ca05df | |||
| 81d128b100 | |||
| f18791a71b | |||
| 1436e96ff4 | |||
| 21f53ed6dd | |||
| e045dea04c | |||
| ac05d36102 | |||
| e9cdb317f6 | |||
| 270f187e2a | |||
| fb8182a10e | |||
| 69bc6c035d | |||
| a18ad919af | |||
| 434cab4952 | |||
| a90e9dde33 | |||
| 9ef1911eae | |||
| 18b3c5f8ed | |||
| 3691f90e23 | |||
| 4d940ab096 | |||
| c5aae5148e | |||
| 058c26e39a | |||
| 7337771aaf | |||
| abbe5e25a5 | |||
| 6d2fc45476 | |||
| 6f04aa9587 | |||
| 1037256a30 | |||
| f9358ed031 | |||
| 13448e4f9a | |||
| 7eb2d93a82 | |||
| 49f875c0f8 | |||
| 53032e556a | |||
| 233a7563b6 | |||
| d1f04abf42 | |||
| c578698da0 | |||
| 8df282b2e6 | |||
| 5f166a5e4e | |||
| f62e917226 | |||
| 611a3c250b | |||
| bbdac63362 | |||
| 0723dc073c | |||
| 3bd897ffe1 | |||
| 8c7b80e7ee | |||
| 4e5bf05518 |
@@ -116,8 +116,8 @@ class CellCustomizer
|
||||
const std::vector<bool> &allowed_nodes,
|
||||
CellMetric &metric) const
|
||||
{
|
||||
Heap heap_exemplar(graph.GetNumberOfNodes());
|
||||
HeapPtr heaps(heap_exemplar);
|
||||
const auto number_of_nodes = graph.GetNumberOfNodes();
|
||||
HeapPtr heaps([number_of_nodes] { return Heap{number_of_nodes}; });
|
||||
|
||||
for (std::size_t level = 1; level < partition.GetNumberOfLevels(); ++level)
|
||||
{
|
||||
|
||||
@@ -603,8 +603,6 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
||||
auto found_range = std::equal_range(
|
||||
m_maneuver_overrides.begin(), m_maneuver_overrides.end(), edge_based_node_id, Comp{});
|
||||
|
||||
results.reserve(std::distance(found_range.first, found_range.second));
|
||||
|
||||
std::for_each(found_range.first,
|
||||
found_range.second,
|
||||
[&](const auto &override)
|
||||
|
||||
@@ -2,13 +2,43 @@
|
||||
#define OSRM_UTIL_BIT_RANGE_HPP
|
||||
|
||||
#include "util/msb.hpp"
|
||||
#include <bit>
|
||||
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#include <boost/range/iterator_range.hpp>
|
||||
|
||||
namespace osrm::util
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template <typename T> std::size_t countOnes(T value)
|
||||
{
|
||||
static_assert(std::is_unsigned<T>::value, "Only unsigned types allowed");
|
||||
std::size_t number_of_ones = 0;
|
||||
while (value > 0)
|
||||
{
|
||||
auto index = msb(value);
|
||||
value = value & ~(T{1} << index);
|
||||
number_of_ones++;
|
||||
}
|
||||
return number_of_ones;
|
||||
}
|
||||
|
||||
#if (defined(__clang__) || defined(__GNUC__) || defined(__GNUG__))
|
||||
inline std::size_t countOnes(std::uint8_t value)
|
||||
{
|
||||
return __builtin_popcount(std::uint32_t{value});
|
||||
}
|
||||
inline std::size_t countOnes(std::uint16_t value)
|
||||
{
|
||||
return __builtin_popcount(std::uint32_t{value});
|
||||
}
|
||||
inline std::size_t countOnes(unsigned int value) { return __builtin_popcount(value); }
|
||||
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
|
||||
template <typename DataT>
|
||||
@@ -40,7 +70,7 @@ class BitIterator : public boost::iterator_facade<BitIterator<DataT>,
|
||||
|
||||
difference_type distance_to(const BitIterator &other) const
|
||||
{
|
||||
return std::popcount(m_value) - std::popcount(other.m_value);
|
||||
return detail::countOnes(m_value) - detail::countOnes(other.m_value);
|
||||
}
|
||||
|
||||
bool equal(const BitIterator &other) const { return m_value == other.m_value; }
|
||||
|
||||
+11
-142
@@ -90,164 +90,33 @@ struct Null
|
||||
{
|
||||
};
|
||||
|
||||
/**
|
||||
* Typed Value sum-type implemented as a variant able to represent tree-like JSON structures.
|
||||
*
|
||||
* Dispatch on its type by either by using apply_visitor or its get function.
|
||||
*/
|
||||
using Value = std::variant<String, Number, Object, Array, True, False, Null>;
|
||||
|
||||
/**
|
||||
* Typed Object.
|
||||
*
|
||||
* Unwrap the key-value pairs holding type via its values member attribute.
|
||||
*/
|
||||
struct Object;
|
||||
struct Object
|
||||
{
|
||||
std::unordered_map<std::string, Value> values;
|
||||
};
|
||||
|
||||
/**
|
||||
* Typed Array.
|
||||
*
|
||||
* Unwrap the Value holding type via its values member attribute.
|
||||
*/
|
||||
struct Array;
|
||||
|
||||
struct Value;
|
||||
|
||||
// Definitions of Object and Array (must come after Value is defined)
|
||||
struct Object
|
||||
{
|
||||
std::unordered_map<std::string, Value> values;
|
||||
};
|
||||
|
||||
struct Array
|
||||
{
|
||||
std::vector<Value> values;
|
||||
};
|
||||
|
||||
struct Value
|
||||
{
|
||||
enum class Type
|
||||
{
|
||||
Invalid,
|
||||
String,
|
||||
Number,
|
||||
Object,
|
||||
Array,
|
||||
True,
|
||||
False,
|
||||
Null
|
||||
};
|
||||
String string;
|
||||
Number number;
|
||||
Object object;
|
||||
Array array;
|
||||
Type type;
|
||||
|
||||
Value() noexcept : type(Type::Invalid) {}
|
||||
Value(const Null &) noexcept : type(Type::Null) {}
|
||||
Value(const True &) noexcept : type(Type::True) {}
|
||||
Value(const False &) noexcept : type(Type::False) {}
|
||||
Value(String &&string_) noexcept : string(std::move(string_)), type(Type::String) {}
|
||||
Value(Number &&number_) noexcept : number(number_), type(Type::Number) {}
|
||||
Value(Object &&object_) noexcept : object(std::move(object_)), type(Type::Object) {}
|
||||
Value(Array &&array_) noexcept : array(std::move(array_)), type(Type::Array) {}
|
||||
Value(const String &string_) noexcept : string(string_), type(Type::String) {}
|
||||
Value(const Number &number_) noexcept : number(number_), type(Type::Number) {}
|
||||
Value(const Object &object_) noexcept : object(object_), type(Type::Object) {}
|
||||
Value(const Array &array_) noexcept : array(array_), type(Type::Array) {}
|
||||
|
||||
Value(double number) noexcept : number(number), type(Type::Number) {}
|
||||
Value(std::string string) noexcept : string(std::move(string)), type(Type::String) {}
|
||||
Value(const char *string) noexcept : string(string), type(Type::String) {}
|
||||
};
|
||||
|
||||
} // namespace osrm::util::json
|
||||
|
||||
namespace std
|
||||
{
|
||||
template <typename T> inline T &get(osrm::util::json::Value &value) noexcept;
|
||||
|
||||
template <>
|
||||
inline osrm::util::json::String &
|
||||
get<osrm::util::json::String>(osrm::util::json::Value &value) noexcept
|
||||
{
|
||||
return value.string;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline osrm::util::json::Number &
|
||||
get<osrm::util::json::Number>(osrm::util::json::Value &value) noexcept
|
||||
{
|
||||
return value.number;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline osrm::util::json::Object &
|
||||
get<osrm::util::json::Object>(osrm::util::json::Value &value) noexcept
|
||||
{
|
||||
return value.object;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline osrm::util::json::Array &
|
||||
get<osrm::util::json::Array>(osrm::util::json::Value &value) noexcept
|
||||
{
|
||||
return value.array;
|
||||
}
|
||||
|
||||
template <typename T> inline const T &get(const osrm::util::json::Value &value) noexcept;
|
||||
|
||||
template <>
|
||||
inline const osrm::util::json::String &
|
||||
get<osrm::util::json::String>(const osrm::util::json::Value &value) noexcept
|
||||
{
|
||||
return value.string;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const osrm::util::json::Number &
|
||||
get<osrm::util::json::Number>(const osrm::util::json::Value &value) noexcept
|
||||
{
|
||||
return value.number;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const osrm::util::json::Object &
|
||||
get<osrm::util::json::Object>(const osrm::util::json::Value &value) noexcept
|
||||
{
|
||||
return value.object;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline const osrm::util::json::Array &
|
||||
get<osrm::util::json::Array>(const osrm::util::json::Value &value) noexcept
|
||||
{
|
||||
return value.array;
|
||||
}
|
||||
|
||||
template <typename Visitor>
|
||||
inline void visit(Visitor &&visitor, const osrm::util::json::Value &value)
|
||||
{
|
||||
switch (value.type)
|
||||
{
|
||||
case osrm::util::json::Value::Type::String:
|
||||
visitor(value.string);
|
||||
break;
|
||||
case osrm::util::json::Value::Type::Number:
|
||||
visitor(value.number);
|
||||
break;
|
||||
case osrm::util::json::Value::Type::Object:
|
||||
visitor(value.object);
|
||||
break;
|
||||
case osrm::util::json::Value::Type::Array:
|
||||
visitor(value.array);
|
||||
break;
|
||||
case osrm::util::json::Value::Type::True:
|
||||
visitor(osrm::util::json::True{});
|
||||
break;
|
||||
case osrm::util::json::Value::Type::False:
|
||||
visitor(osrm::util::json::False{});
|
||||
break;
|
||||
case osrm::util::json::Value::Type::Null:
|
||||
visitor(osrm::util::json::Null{});
|
||||
break;
|
||||
case osrm::util::json::Value::Type::Invalid:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace std
|
||||
#endif // JSON_CONTAINER_HPP
|
||||
|
||||
+135
-137
@@ -1,159 +1,157 @@
|
||||
// #ifndef UTIL_JSON_DEEP_COMPARE_HPP
|
||||
// #define UTIL_JSON_DEEP_COMPARE_HPP
|
||||
#ifndef UTIL_JSON_DEEP_COMPARE_HPP
|
||||
#define UTIL_JSON_DEEP_COMPARE_HPP
|
||||
|
||||
// #include "util/integer_range.hpp"
|
||||
// #include "util/json_container.hpp"
|
||||
#include "util/integer_range.hpp"
|
||||
#include "util/json_container.hpp"
|
||||
|
||||
// #include <boost/assert.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
// #include <algorithm>
|
||||
// #include <functional>
|
||||
// #include <set>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <set>
|
||||
|
||||
// namespace osrm::util::json
|
||||
// {
|
||||
namespace osrm::util::json
|
||||
{
|
||||
|
||||
// struct Comparator
|
||||
// {
|
||||
// Comparator(std::string &reason_, const std::string &lhs_path_, const std::string &rhs_path_)
|
||||
// : reason(reason_), lhs_path(lhs_path_), rhs_path(rhs_path_)
|
||||
// {
|
||||
// }
|
||||
struct Comparator
|
||||
{
|
||||
Comparator(std::string &reason_, const std::string &lhs_path_, const std::string &rhs_path_)
|
||||
: reason(reason_), lhs_path(lhs_path_), rhs_path(rhs_path_)
|
||||
{
|
||||
}
|
||||
|
||||
// bool operator()(const String &lhs, const String &rhs) const
|
||||
// {
|
||||
// bool is_same = lhs.value == rhs.value;
|
||||
// if (!is_same)
|
||||
// {
|
||||
// reason = lhs_path + " (= \"" + lhs.value + "\") != " + rhs_path + " (= \"" +
|
||||
// rhs.value +
|
||||
// "\")";
|
||||
// }
|
||||
// return is_same;
|
||||
// }
|
||||
bool operator()(const String &lhs, const String &rhs) const
|
||||
{
|
||||
bool is_same = lhs.value == rhs.value;
|
||||
if (!is_same)
|
||||
{
|
||||
reason = lhs_path + " (= \"" + lhs.value + "\") != " + rhs_path + " (= \"" + rhs.value +
|
||||
"\")";
|
||||
}
|
||||
return is_same;
|
||||
}
|
||||
|
||||
// bool operator()(const Number &lhs, const Number &rhs) const
|
||||
// {
|
||||
// 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) + ")";
|
||||
// }
|
||||
// return is_same;
|
||||
// }
|
||||
bool operator()(const Number &lhs, const Number &rhs) const
|
||||
{
|
||||
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) + ")";
|
||||
}
|
||||
return is_same;
|
||||
}
|
||||
|
||||
// bool operator()(const Object &lhs, const Object &rhs) const
|
||||
// {
|
||||
// std::set<std::string> lhs_keys;
|
||||
// for (const auto &key_value : lhs.values)
|
||||
// {
|
||||
// lhs_keys.insert(key_value.first);
|
||||
// }
|
||||
bool operator()(const Object &lhs, const Object &rhs) const
|
||||
{
|
||||
std::set<std::string> lhs_keys;
|
||||
for (const auto &key_value : lhs.values)
|
||||
{
|
||||
lhs_keys.insert(key_value.first);
|
||||
}
|
||||
|
||||
// std::set<std::string> rhs_keys;
|
||||
// for (const auto &key_value : rhs.values)
|
||||
// {
|
||||
// rhs_keys.insert(key_value.first);
|
||||
// }
|
||||
std::set<std::string> rhs_keys;
|
||||
for (const auto &key_value : rhs.values)
|
||||
{
|
||||
rhs_keys.insert(key_value.first);
|
||||
}
|
||||
|
||||
// for (const auto &key : lhs_keys)
|
||||
// {
|
||||
// if (rhs_keys.find(key) == rhs_keys.end())
|
||||
// {
|
||||
// reason = rhs_path + " doesn't have key \"" + key + "\"";
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
for (const auto &key : lhs_keys)
|
||||
{
|
||||
if (rhs_keys.find(key) == rhs_keys.end())
|
||||
{
|
||||
reason = rhs_path + " doesn't have key \"" + key + "\"";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// for (const auto &key : rhs_keys)
|
||||
// {
|
||||
// if (lhs_keys.find(key) == lhs_keys.end())
|
||||
// {
|
||||
// reason = lhs_path + " doesn't have key \"" + key + "\"";
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
for (const auto &key : rhs_keys)
|
||||
{
|
||||
if (lhs_keys.find(key) == lhs_keys.end())
|
||||
{
|
||||
reason = lhs_path + " doesn't have key \"" + key + "\"";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// for (const auto &key : lhs_keys)
|
||||
// {
|
||||
// BOOST_ASSERT(rhs.values.find(key) != rhs.values.end());
|
||||
// BOOST_ASSERT(lhs.values.find(key) != lhs.values.end());
|
||||
for (const auto &key : lhs_keys)
|
||||
{
|
||||
BOOST_ASSERT(rhs.values.find(key) != rhs.values.end());
|
||||
BOOST_ASSERT(lhs.values.find(key) != lhs.values.end());
|
||||
|
||||
// const auto &rhs_child = rhs.values.find(key)->second;
|
||||
// const auto &lhs_child = lhs.values.find(key)->second;
|
||||
// auto is_same =
|
||||
// std::visit(Comparator(reason, lhs_path + "." + key, rhs_path + "." + key),
|
||||
// lhs_child,
|
||||
// rhs_child);
|
||||
// if (!is_same)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
const auto &rhs_child = rhs.values.find(key)->second;
|
||||
const auto &lhs_child = lhs.values.find(key)->second;
|
||||
auto is_same =
|
||||
std::visit(Comparator(reason, lhs_path + "." + key, rhs_path + "." + key),
|
||||
lhs_child,
|
||||
rhs_child);
|
||||
if (!is_same)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// bool operator()(const Array &lhs, const Array &rhs) const
|
||||
// {
|
||||
// if (lhs.values.size() != rhs.values.size())
|
||||
// {
|
||||
// reason = lhs_path + ".length " + std::to_string(lhs.values.size()) + " != " +
|
||||
// rhs_path +
|
||||
// ".length " + std::to_string(rhs.values.size());
|
||||
// return false;
|
||||
// }
|
||||
bool operator()(const Array &lhs, const Array &rhs) const
|
||||
{
|
||||
if (lhs.values.size() != rhs.values.size())
|
||||
{
|
||||
reason = lhs_path + ".length " + std::to_string(lhs.values.size()) + " != " + rhs_path +
|
||||
".length " + std::to_string(rhs.values.size());
|
||||
return false;
|
||||
}
|
||||
|
||||
// for (auto i = 0UL; i < lhs.values.size(); ++i)
|
||||
// {
|
||||
// auto is_same = std::visit(Comparator(reason,
|
||||
// lhs_path + "[" + std::to_string(i) + "]",
|
||||
// rhs_path + "[" + std::to_string(i) + "]"),
|
||||
// lhs.values[i],
|
||||
// rhs.values[i]);
|
||||
// if (!is_same)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
for (auto i = 0UL; i < lhs.values.size(); ++i)
|
||||
{
|
||||
auto is_same = std::visit(Comparator(reason,
|
||||
lhs_path + "[" + std::to_string(i) + "]",
|
||||
rhs_path + "[" + std::to_string(i) + "]"),
|
||||
lhs.values[i],
|
||||
rhs.values[i]);
|
||||
if (!is_same)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// return true;
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
// bool operator()(const True &, const True &) const { return true; }
|
||||
// bool operator()(const False &, const False &) const { return true; }
|
||||
// bool operator()(const Null &, const Null &) const { return true; }
|
||||
bool operator()(const True &, const True &) const { return true; }
|
||||
bool operator()(const False &, const False &) const { return true; }
|
||||
bool operator()(const Null &, const Null &) const { return true; }
|
||||
|
||||
// bool operator()(const False &, const True &) const
|
||||
// {
|
||||
// reason = lhs_path + " is false but " + rhs_path + " is true";
|
||||
// return false;
|
||||
// }
|
||||
// bool operator()(const True &, const False &) const
|
||||
// {
|
||||
// reason = lhs_path + " is true but " + rhs_path + " is false";
|
||||
// return false;
|
||||
// }
|
||||
bool operator()(const False &, const True &) const
|
||||
{
|
||||
reason = lhs_path + " is false but " + rhs_path + " is true";
|
||||
return false;
|
||||
}
|
||||
bool operator()(const True &, const False &) const
|
||||
{
|
||||
reason = lhs_path + " is true but " + rhs_path + " is false";
|
||||
return false;
|
||||
}
|
||||
|
||||
// template <typename T1,
|
||||
// typename T2,
|
||||
// typename = typename std::enable_if<!std::is_same<T1, T2>::value>::type>
|
||||
// bool operator()(const T1 &, const T2 &)
|
||||
// {
|
||||
// reason = lhs_path + " and " + rhs_path + " have different types";
|
||||
// return false;
|
||||
// }
|
||||
template <typename T1,
|
||||
typename T2,
|
||||
typename = typename std::enable_if<!std::is_same<T1, T2>::value>::type>
|
||||
bool operator()(const T1 &, const T2 &)
|
||||
{
|
||||
reason = lhs_path + " and " + rhs_path + " have different types";
|
||||
return false;
|
||||
}
|
||||
|
||||
// private:
|
||||
// std::string &reason;
|
||||
// const std::string &lhs_path;
|
||||
// const std::string &rhs_path;
|
||||
// };
|
||||
private:
|
||||
std::string &reason;
|
||||
const std::string &lhs_path;
|
||||
const std::string &rhs_path;
|
||||
};
|
||||
|
||||
// inline bool compare(const Value &reference, const Value &result, std::string &reason)
|
||||
// {
|
||||
// return std::visit(Comparator(reason, "reference", "result"), reference, result);
|
||||
// }
|
||||
// } // namespace osrm::util::json
|
||||
inline bool compare(const Value &reference, const Value &result, std::string &reason)
|
||||
{
|
||||
return std::visit(Comparator(reason, "reference", "result"), reference, result);
|
||||
}
|
||||
} // namespace osrm::util::json
|
||||
|
||||
// #endif
|
||||
#endif
|
||||
|
||||
+33
-7
@@ -1,24 +1,50 @@
|
||||
#ifndef OSRM_UTIL_MSB_HPP
|
||||
#define OSRM_UTIL_MSB_HPP
|
||||
|
||||
#include <bit>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <climits>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <utility>
|
||||
|
||||
namespace osrm::util
|
||||
{
|
||||
|
||||
// get the msb of an integer
|
||||
// return 0 for integers without msb
|
||||
template <typename T> std::size_t msb(T value)
|
||||
{
|
||||
BOOST_ASSERT(value > 0);
|
||||
|
||||
static_assert(std::is_integral<T>::value && !std::is_signed<T>::value, "Integer required.");
|
||||
constexpr auto MSB_INDEX = std::numeric_limits<unsigned char>::digits * sizeof(T) - 1;
|
||||
|
||||
return MSB_INDEX - std::countl_zero(value);
|
||||
std::size_t msb = 0;
|
||||
while (value > 0)
|
||||
{
|
||||
value >>= 1u;
|
||||
msb++;
|
||||
}
|
||||
BOOST_ASSERT(msb > 0);
|
||||
return msb - 1;
|
||||
}
|
||||
|
||||
#if (defined(__clang__) || defined(__GNUC__) || defined(__GNUG__))
|
||||
inline std::size_t msb(unsigned long long v)
|
||||
{
|
||||
BOOST_ASSERT(v > 0);
|
||||
constexpr auto MSB_INDEX = CHAR_BIT * sizeof(unsigned long long) - 1;
|
||||
return MSB_INDEX - __builtin_clzll(v);
|
||||
}
|
||||
inline std::size_t msb(unsigned long v)
|
||||
{
|
||||
BOOST_ASSERT(v > 0);
|
||||
constexpr auto MSB_INDEX = CHAR_BIT * sizeof(unsigned long) - 1;
|
||||
return MSB_INDEX - __builtin_clzl(v);
|
||||
}
|
||||
inline std::size_t msb(unsigned int v)
|
||||
{
|
||||
BOOST_ASSERT(v > 0);
|
||||
constexpr auto MSB_INDEX = CHAR_BIT * sizeof(unsigned int) - 1;
|
||||
return MSB_INDEX - __builtin_clz(v);
|
||||
}
|
||||
#endif
|
||||
} // namespace osrm::util
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <bit>
|
||||
#include <boost/assert.hpp>
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <new>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm::util
|
||||
{
|
||||
|
||||
inline size_t align_up(size_t n, size_t alignment)
|
||||
{
|
||||
return (n + alignment - 1) & ~(alignment - 1);
|
||||
}
|
||||
|
||||
inline size_t get_next_power_of_two_exponent(size_t n)
|
||||
{
|
||||
BOOST_ASSERT(n > 0);
|
||||
return (sizeof(size_t) * 8) - std::countl_zero(n - 1);
|
||||
}
|
||||
|
||||
class MemoryPool
|
||||
{
|
||||
private:
|
||||
constexpr static size_t MIN_CHUNK_SIZE_BYTES = 4096;
|
||||
|
||||
public:
|
||||
static std::shared_ptr<MemoryPool> instance()
|
||||
{
|
||||
static thread_local std::shared_ptr<MemoryPool> instance;
|
||||
if (!instance)
|
||||
{
|
||||
instance = std::shared_ptr<MemoryPool>(new MemoryPool());
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
template <typename T> T *allocate(std::size_t items_count)
|
||||
{
|
||||
static_assert(alignof(T) <= alignof(std::max_align_t),
|
||||
"Type is over-aligned for this allocator.");
|
||||
|
||||
size_t free_list_index = get_next_power_of_two_exponent(items_count * sizeof(T));
|
||||
auto &free_list = free_lists_[free_list_index];
|
||||
if (free_list.empty())
|
||||
{
|
||||
size_t block_size_in_bytes = 1u << free_list_index;
|
||||
block_size_in_bytes = align_up(block_size_in_bytes, alignof(std::max_align_t));
|
||||
// check if there is space in current memory chunk
|
||||
if (current_chunk_left_bytes_ < block_size_in_bytes)
|
||||
{
|
||||
allocate_chunk(block_size_in_bytes);
|
||||
}
|
||||
|
||||
free_list.push_back(current_chunk_ptr_);
|
||||
current_chunk_left_bytes_ -= block_size_in_bytes;
|
||||
current_chunk_ptr_ += block_size_in_bytes;
|
||||
}
|
||||
auto ptr = reinterpret_cast<T *>(free_list.back());
|
||||
free_list.pop_back();
|
||||
return ptr;
|
||||
}
|
||||
|
||||
template <typename T> void deallocate(T *p, std::size_t n) noexcept
|
||||
{
|
||||
size_t free_list_index = get_next_power_of_two_exponent(n * sizeof(T));
|
||||
// NOLINTNEXTLINE(bugprone-multi-level-implicit-pointer-conversion)
|
||||
free_lists_[free_list_index].push_back(reinterpret_cast<void *>(p));
|
||||
}
|
||||
|
||||
~MemoryPool()
|
||||
{
|
||||
for (auto chunk : chunks_)
|
||||
{
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-no-malloc)
|
||||
std::free(chunk);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
MemoryPool() = default;
|
||||
MemoryPool(const MemoryPool &) = delete;
|
||||
MemoryPool &operator=(const MemoryPool &) = delete;
|
||||
|
||||
void allocate_chunk(size_t bytes)
|
||||
{
|
||||
auto chunk_size = std::max(bytes, MIN_CHUNK_SIZE_BYTES);
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-no-malloc)
|
||||
void *chunk = std::malloc(chunk_size);
|
||||
if (!chunk)
|
||||
{
|
||||
throw std::bad_alloc();
|
||||
}
|
||||
chunks_.push_back(chunk);
|
||||
current_chunk_ptr_ = static_cast<uint8_t *>(chunk);
|
||||
current_chunk_left_bytes_ = chunk_size;
|
||||
}
|
||||
|
||||
// we have 64 free lists, one for each possible power of two
|
||||
std::array<std::vector<void *>, sizeof(std::size_t) * 8> free_lists_;
|
||||
|
||||
// list of allocated memory chunks, we don't free them until the pool is destroyed
|
||||
std::vector<void *> chunks_;
|
||||
|
||||
uint8_t *current_chunk_ptr_ = nullptr;
|
||||
size_t current_chunk_left_bytes_ = 0;
|
||||
};
|
||||
|
||||
template <typename T> class PoolAllocator
|
||||
{
|
||||
public:
|
||||
using value_type = T;
|
||||
|
||||
PoolAllocator() noexcept : pool(MemoryPool::instance()){};
|
||||
|
||||
template <typename U>
|
||||
PoolAllocator(const PoolAllocator<U> &) noexcept : pool(MemoryPool::instance())
|
||||
{
|
||||
}
|
||||
|
||||
template <typename U> struct rebind
|
||||
{
|
||||
using other = PoolAllocator<U>;
|
||||
};
|
||||
|
||||
T *allocate(std::size_t n) { return pool->allocate<T>(n); }
|
||||
|
||||
void deallocate(T *p, std::size_t n) noexcept { pool->deallocate<T>(p, n); }
|
||||
|
||||
PoolAllocator(const PoolAllocator &) = default;
|
||||
PoolAllocator &operator=(const PoolAllocator &) = default;
|
||||
PoolAllocator(PoolAllocator &&) noexcept = default;
|
||||
PoolAllocator &operator=(PoolAllocator &&) noexcept = default;
|
||||
|
||||
private:
|
||||
// using shared_ptr guarantees that memory pool won't be destroyed before all allocators using
|
||||
// it (important if there are static instances of PoolAllocator)
|
||||
std::shared_ptr<MemoryPool> pool;
|
||||
};
|
||||
template <typename T, typename U>
|
||||
bool operator==(const PoolAllocator<T> &, const PoolAllocator<U> &)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename T, typename U>
|
||||
bool operator!=(const PoolAllocator<T> &, const PoolAllocator<U> &)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace osrm::util
|
||||
@@ -1,17 +1,16 @@
|
||||
#ifndef OSRM_UTIL_QUERY_HEAP_HPP
|
||||
#define OSRM_UTIL_QUERY_HEAP_HPP
|
||||
|
||||
#include "util/pool_allocator.hpp"
|
||||
#include <algorithm>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/heap/d_ary_heap.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm::util
|
||||
{
|
||||
|
||||
@@ -56,7 +55,11 @@ template <typename NodeID, typename Key> class UnorderedMapStorage
|
||||
void Clear() { nodes.clear(); }
|
||||
|
||||
private:
|
||||
std::unordered_map<NodeID, Key> nodes;
|
||||
template <typename K, typename V>
|
||||
using UnorderedMap = std::
|
||||
unordered_map<K, V, std::hash<K>, std::equal_to<K>, PoolAllocator<std::pair<const K, V>>>;
|
||||
|
||||
UnorderedMap<NodeID, Key> nodes;
|
||||
};
|
||||
|
||||
template <typename NodeID,
|
||||
@@ -142,10 +145,12 @@ class QueryHeap
|
||||
return weight > other.weight;
|
||||
}
|
||||
};
|
||||
|
||||
using HeapContainer = boost::heap::d_ary_heap<HeapData,
|
||||
boost::heap::arity<4>,
|
||||
boost::heap::mutable_<true>,
|
||||
boost::heap::compare<std::greater<HeapData>>>;
|
||||
boost::heap::compare<std::greater<HeapData>>,
|
||||
boost::heap::allocator<PoolAllocator<HeapData>>>;
|
||||
using HeapHandle = typename HeapContainer::handle_type;
|
||||
|
||||
public:
|
||||
@@ -160,6 +165,9 @@ class QueryHeap
|
||||
Data data;
|
||||
};
|
||||
|
||||
QueryHeap(const QueryHeap &other) = delete;
|
||||
QueryHeap(QueryHeap &&other) = delete;
|
||||
|
||||
template <typename... StorageArgs> explicit QueryHeap(StorageArgs... args) : node_index(args...)
|
||||
{
|
||||
Clear();
|
||||
|
||||
@@ -10,7 +10,7 @@ set -o nounset
|
||||
# http://git.661346.n2.nabble.com/subtree-merges-lose-prefix-after-rebase-td7332850.html
|
||||
|
||||
OSMIUM_PATH="osmcode/libosmium"
|
||||
OSMIUM_TAG=v2.20.0
|
||||
OSMIUM_TAG=v2.14.0
|
||||
|
||||
SOL_PATH="ThePhD/sol2"
|
||||
SOL_TAG=v3.3.0
|
||||
@@ -22,7 +22,7 @@ MICROTAR_PATH="rxi/microtar"
|
||||
MICROTAR_TAG=v0.1.0
|
||||
|
||||
PROTOZERO_PATH="mapbox/protozero"
|
||||
PROTOZERO_TAG=v1.7.1
|
||||
PROTOZERO_TAG=v1.6.2
|
||||
|
||||
VTZERO_PATH="mapbox/vtzero"
|
||||
VTZERO_TAG=v1.1.0
|
||||
|
||||
@@ -143,8 +143,8 @@ util::json::Object makeIntersection(const guidance::IntermediateIntersection &in
|
||||
});
|
||||
|
||||
result.values.emplace("location", detail::coordinateToLonLat(intersection.location));
|
||||
result.values.emplace("bearings", std::move(bearings));
|
||||
result.values.emplace("entry", std::move(entry));
|
||||
result.values.emplace("bearings", bearings);
|
||||
result.values.emplace("entry", entry);
|
||||
if (intersection.in != guidance::IntermediateIntersection::NO_INDEX)
|
||||
result.values.emplace("in", intersection.in);
|
||||
if (intersection.out != guidance::IntermediateIntersection::NO_INDEX)
|
||||
|
||||
@@ -222,6 +222,7 @@ oneToManySearch(SearchEngineData<Algorithm> &engine_working_data,
|
||||
std::vector<EdgeDuration> durations_table(target_indices.size(), MAXIMAL_EDGE_DURATION);
|
||||
std::vector<EdgeDistance> distances_table(calculate_distance ? target_indices.size() : 0,
|
||||
MAXIMAL_EDGE_DISTANCE);
|
||||
std::vector<NodeID> middle_nodes_table(target_indices.size(), SPECIAL_NODEID);
|
||||
|
||||
// Collect destination (source) nodes into a map
|
||||
std::unordered_multimap<NodeID, std::tuple<std::size_t, EdgeWeight, EdgeDuration, EdgeDistance>>
|
||||
@@ -306,6 +307,7 @@ oneToManySearch(SearchEngineData<Algorithm> &engine_working_data,
|
||||
weights_table[index] = path_weight;
|
||||
durations_table[index] = path_duration;
|
||||
current_distance = path_distance;
|
||||
middle_nodes_table[index] = node;
|
||||
}
|
||||
|
||||
// Remove node from destinations list
|
||||
|
||||
Vendored
+1
-4
@@ -1,5 +1,5 @@
|
||||
---
|
||||
Checks: '*,-abseil-string-find-str-contains,-altera-*,-android-cloexec-*,-bugprone-branch-clone,-bugprone-easily-swappable-parameters,-bugprone-macro-parentheses,-cert-dcl21-cpp,-cert-err58-cpp,-clang-analyzer-optin.cplusplus.VirtualCall,-cppcoreguidelines-avoid-c-arrays,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-macro-usage,-cppcoreguidelines-non-private-member-variables-in-classes,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-vararg,-fuchsia-*,-google-runtime-references,-hicpp-avoid-c-arrays,-hicpp-invalid-access-moved,-hicpp-no-array-decay,-hicpp-no-assembler,-hicpp-vararg,-llvmlibc-*,-llvm-qualified-auto,-misc-macro-parentheses,-misc-non-private-member-variables-in-classes,-misc-no-recursion,-misc-unused-parameters,-modernize-avoid-c-arrays,-modernize-make-unique,-modernize-raw-string-literal,-modernize-use-trailing-return-type,-readability-avoid-const-params-in-decls,-readability-convert-member-functions-to-static,-readability-function-cognitive-complexity,-readability-identifier-length,-readability-implicit-bool-cast,-readability-implicit-bool-conversion,-readability-magic-numbers,-readability-qualified-auto'
|
||||
Checks: '*,-abseil-string-find-str-contains,-altera-*,-android-cloexec-*,-bugprone-branch-clone,-bugprone-easily-swappable-parameters,-bugprone-macro-parentheses,-cert-dcl21-cpp,-cert-err58-cpp,-clang-analyzer-optin.cplusplus.VirtualCall,-cppcoreguidelines-avoid-c-arrays,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-macro-usage,-cppcoreguidelines-non-private-member-variables-in-classes,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-vararg,-fuchsia-*,-google-runtime-references,-hicpp-avoid-c-arrays,-hicpp-invalid-access-moved,-hicpp-no-array-decay,-hicpp-no-assembler,-hicpp-vararg,-llvmlibc-*,-llvm-qualified-auto,-misc-macro-parentheses,-misc-non-private-member-variables-in-classes,-misc-no-recursion,-misc-unused-parameters,-modernize-avoid-c-arrays,-modernize-make-unique,-modernize-raw-string-literal,-modernize-use-trailing-return-type,-readability-avoid-const-params-in-decls,-readability-function-cognitive-complexity,-readability-identifier-length,-readability-implicit-bool-cast,-readability-implicit-bool-conversion,-readability-magic-numbers,-readability-qualified-auto'
|
||||
#
|
||||
# For a list of check options, see:
|
||||
# https://clang.llvm.org/extra/clang-tidy/checks/list.html
|
||||
@@ -137,9 +137,6 @@ Checks: '*,-abseil-string-find-str-contains,-altera-*,-android-cloexec-*,-bugpro
|
||||
# This is header only library, so the declaration and implementation are
|
||||
# often the same and we want to have the const in implementations.
|
||||
#
|
||||
# readability-convert-member-functions-to-static
|
||||
# Reports too many false positives
|
||||
#
|
||||
# readability-function-cognitive-complexity
|
||||
# Sometimes the large functions are needed.
|
||||
#
|
||||
|
||||
@@ -7,13 +7,7 @@ runs:
|
||||
run: mkdir build
|
||||
shell: bash
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake -LA .. \
|
||||
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \
|
||||
-DBUILD_HEADERS=OFF \
|
||||
-DBUILD_BENCHMARKS=ON \
|
||||
-DOsmium_DEBUG=TRUE \
|
||||
-DPROTOZERO_INCLUDE_DIR=${GITHUB_WORKSPACE}/../protozero/include
|
||||
run: cmake -LA .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DBUILD_HEADERS=OFF -DBUILD_BENCHMARKS=ON -DOsmium_DEBUG=TRUE -DPROTOZERO_INCLUDE_DIR=${GITHUB_WORKSPACE}/../protozero/include
|
||||
shell: bash
|
||||
working-directory: build
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ runs:
|
||||
steps:
|
||||
- name: Install packages
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get update -q
|
||||
sudo apt-get install -yq \
|
||||
doxygen \
|
||||
libboost-dev \
|
||||
@@ -16,5 +16,8 @@ runs:
|
||||
libsparsehash-dev \
|
||||
ruby-json \
|
||||
spatialite-bin
|
||||
test "$CC" = clang-6.0 && sudo apt-get install -yq --no-install-suggests --no-install-recommends clang-6.0
|
||||
test "$CC" = clang-8 && sudo apt-get install -yq --no-install-suggests --no-install-recommends clang-8
|
||||
test "$CC" = clang-13 && sudo apt-get install -yq --no-install-suggests --no-install-recommends clang-13
|
||||
shell: bash
|
||||
|
||||
|
||||
+129
-107
@@ -3,13 +3,14 @@ name: CI
|
||||
on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 40
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
name: [Ubuntu-18, Ubuntu-20, Ubuntu-22, Debian-10, Debian-11, Debian-12, Debian-Testing, Debian-Experimental, Fedora-35, Fedora-36, Fedora-37, Fedora-38]
|
||||
name: [Ubuntu-18, Ubuntu-20, Ubuntu-21, Debian-9, Debian-10, Debian-11, Debian-Testing, Debian-Experimental, Fedora-34]
|
||||
build_type: [Dev]
|
||||
cpp_compiler: [g++]
|
||||
cpp_version: [c++11]
|
||||
@@ -18,136 +19,122 @@ jobs:
|
||||
# Uses gcc 7.5.0, clang 6.0.0, cmake 3.10.2
|
||||
image: "ubuntu:18.04"
|
||||
ubuntu: 18
|
||||
installer: apt
|
||||
- name: Ubuntu-20
|
||||
# Uses gcc 9.3.0, clang 10.0.0, cmake 3.16.3
|
||||
image: "ubuntu:20.04"
|
||||
ubuntu: 20
|
||||
- name: Ubuntu-22
|
||||
# Uses gcc 12.2.0, clang 15.0.7, cmake 3.24.2
|
||||
image: "ubuntu:22.04"
|
||||
ubuntu: 22
|
||||
CXXFLAGS: -Wno-stringop-overread
|
||||
installer: apt
|
||||
- name: Ubuntu-21
|
||||
# Uses gcc 10.3.0, clang, 12.0.0, cmake 3.18.4
|
||||
image: "ubuntu:21.04"
|
||||
ubuntu: 21
|
||||
installer: apt
|
||||
- name: Debian-9
|
||||
# Uses gcc 6.3.0, clang 3.8.1, cmake 3.7.2
|
||||
image: "debian:stretch"
|
||||
installer: apt
|
||||
- name: Debian-10
|
||||
# Uses gcc 8.3.0, clang 7.0.1, cmake 3.13.4
|
||||
image: "debian:buster"
|
||||
installer: apt
|
||||
- name: Debian-11
|
||||
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
||||
image: "debian:bullseye"
|
||||
installer: apt
|
||||
- name: Debian-11
|
||||
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
||||
image: "debian:bullseye"
|
||||
installer: apt
|
||||
cpp_version: c++17
|
||||
- name: Debian-11
|
||||
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
||||
image: "debian:bullseye"
|
||||
installer: apt
|
||||
cpp_version: c++20
|
||||
- name: Debian-11
|
||||
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
||||
image: "debian:bullseye"
|
||||
c_compiler: clang
|
||||
cpp_compiler: clang++
|
||||
- name: Debian-11
|
||||
image: "debian:bullseye"
|
||||
installer: apt
|
||||
c_compiler: clang
|
||||
cpp_compiler: clang++
|
||||
cpp_version: c++17
|
||||
- name: Debian-11
|
||||
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
||||
image: "debian:bullseye"
|
||||
installer: apt
|
||||
c_compiler: clang
|
||||
cpp_compiler: clang++
|
||||
cpp_version: c++20
|
||||
- name: Debian-11
|
||||
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
||||
image: "debian:bullseye"
|
||||
installer: apt
|
||||
build_type: RelWithDebInfo
|
||||
- name: Debian-11
|
||||
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
||||
image: "debian:bullseye"
|
||||
installer: apt
|
||||
c_compiler: clang
|
||||
cpp_compiler: clang++
|
||||
CXXFLAGS: -fsanitize=address,undefined -fno-sanitize-recover=all -fno-omit-frame-pointer
|
||||
LDFLAGS: -fsanitize=address,undefined
|
||||
- name: Debian-12
|
||||
# Uses gcc 12.2.0, clang 15.0.6, cmake 3.25.1
|
||||
image: "debian:bookworm"
|
||||
CXXFLAGS: -Wno-stringop-overread
|
||||
- name: Debian-12
|
||||
image: "debian:bookworm"
|
||||
cpp_version: c++17
|
||||
CXXFLAGS: -Wno-stringop-overread
|
||||
- name: Debian-12
|
||||
image: "debian:bookworm"
|
||||
cpp_version: c++20
|
||||
CXXFLAGS: -Wno-stringop-overread
|
||||
- name: Debian-12
|
||||
image: "debian:bookworm"
|
||||
- name: Debian-11
|
||||
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4
|
||||
image: "debian:bullseye"
|
||||
installer: apt
|
||||
c_compiler: clang
|
||||
cpp_compiler: clang++
|
||||
- name: Debian-12
|
||||
image: "debian:bookworm"
|
||||
c_compiler: clang
|
||||
cpp_compiler: clang++
|
||||
cpp_version: c++17
|
||||
- name: Debian-12
|
||||
image: "debian:bookworm"
|
||||
c_compiler: clang
|
||||
cpp_compiler: clang++
|
||||
cpp_version: c++20
|
||||
- name: Debian-12
|
||||
image: "debian:bookworm"
|
||||
build_type: RelWithDebInfo
|
||||
CXXFLAGS: -Wno-stringop-overread
|
||||
- name: Debian-12
|
||||
image: "debian:bookworm"
|
||||
c_compiler: clang
|
||||
cpp_compiler: clang++
|
||||
CXXFLAGS: -fsanitize=address,undefined -fno-sanitize-recover=all -fno-omit-frame-pointer
|
||||
LDFLAGS: -fsanitize=address,undefined
|
||||
CXXFLAGS: -fsanitize=address,undefined,integer -fno-sanitize-recover=all -fno-omit-frame-pointer
|
||||
LDFLAGS: -fsanitize=address,undefined,integer
|
||||
- name: Debian-Testing
|
||||
# Uses gcc 10.3.0, clang 11.1.0, cmake 3.21.3
|
||||
image: "debian:testing"
|
||||
CXXFLAGS: -Wno-stringop-overread -Wno-dangling-reference
|
||||
installer: apt
|
||||
CXXFLAGS: -Wno-stringop-overread
|
||||
- name: Debian-Testing
|
||||
# Uses gcc 10.3.0, clang 11.1.0, cmake 3.21.3
|
||||
image: "debian:testing"
|
||||
installer: apt
|
||||
c_compiler: clang
|
||||
cpp_compiler: clang++
|
||||
- name: Debian-Experimental
|
||||
# Uses gcc 11, clang 14, cmake 3.21.3
|
||||
image: "debian:experimental"
|
||||
CXXFLAGS: -Wno-stringop-overread -Wno-dangling-reference
|
||||
installer: apt
|
||||
CXXFLAGS: -Wno-stringop-overread
|
||||
- name: Debian-Experimental
|
||||
# Uses gcc 11, clang 14, cmake 3.21.3
|
||||
image: "debian:experimental"
|
||||
c_compiler: clang
|
||||
cpp_compiler: clang++
|
||||
installer: apt
|
||||
c_compiler: clang-14
|
||||
cpp_compiler: clang++-14
|
||||
- name: Fedora-34
|
||||
# Uses gcc 11.2.1, clang 12.0.1, cmake 3.20.5
|
||||
image: "fedora:34"
|
||||
installer: dnf
|
||||
CXXFLAGS: -Wno-stringop-overread
|
||||
- name: Fedora-35
|
||||
# Uses gcc 11.2.1, clang 12.0.1, cmake 3.20.5
|
||||
image: "fedora:35"
|
||||
installer: dnf
|
||||
CXXFLAGS: -Wno-stringop-overread
|
||||
- name: Fedora-36
|
||||
# Uses gcc 12.2.0, clang 14.0.5, cmake 3.24.2
|
||||
image: "fedora:36"
|
||||
CXXFLAGS: -Wno-stringop-overread
|
||||
- name: Fedora-37
|
||||
# Uses gcc 12.3.1, clang 15.0.7, cmake 3.26.4
|
||||
image: "fedora:37"
|
||||
CXXFLAGS: -Wno-stringop-overread
|
||||
- name: Fedora-38
|
||||
# Uses gcc 13.0.1, clang 16.0.5, cmake 3.26.4
|
||||
image: "fedora:38"
|
||||
CXXFLAGS: -Wno-stringop-overread -Wno-dangling-reference
|
||||
container:
|
||||
image: ${{ matrix.image }}
|
||||
env:
|
||||
LANG: en_US.UTF-8
|
||||
BUILD_TYPE: ${{ matrix.build_type }}
|
||||
CC: ${{ matrix.c_compiler }}
|
||||
CXX: ${{ matrix.cpp_compiler }}
|
||||
CXXFLAGS: ${{ matrix.CXXFLAGS }}
|
||||
LDFLAGS: ${{ matrix.LDFLAGS }}
|
||||
CC: ${{ matrix.c_compiler }}
|
||||
CXX: ${{ matrix.cpp_compiler }}
|
||||
CPP_VERSION: ${{ matrix.cpp_version }}
|
||||
WITH_PROJ: ON
|
||||
APT_LISTCHANGES_FRONTEND: none
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
steps:
|
||||
- name: Prepare container (apt)
|
||||
shell: bash
|
||||
if: startsWith(matrix.image, 'debian:') || startsWith(matrix.image, 'ubuntu:')
|
||||
run: |
|
||||
export APT_LISTCHANGES_FRONTEND=none
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update -qq
|
||||
apt-get install -yq \
|
||||
apt-get install -y \
|
||||
clang \
|
||||
cmake \
|
||||
doxygen \
|
||||
@@ -167,13 +154,16 @@ jobs:
|
||||
ruby-json \
|
||||
spatialite-bin \
|
||||
zlib1g-dev
|
||||
shell: bash
|
||||
if: matrix.installer == 'apt'
|
||||
- name: Install compiler
|
||||
shell: bash
|
||||
run: |
|
||||
export APT_LISTCHANGES_FRONTEND=none
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get install -y clang-14
|
||||
if: matrix.cpp_compiler == 'clang++-14'
|
||||
run: apt-get install -yq clang-14
|
||||
- name: Prepare container (dnf)
|
||||
shell: bash
|
||||
if: startsWith(matrix.image, 'fedora:')
|
||||
run: |
|
||||
dnf install --quiet --assumeyes \
|
||||
boost-devel \
|
||||
@@ -195,7 +185,9 @@ jobs:
|
||||
sparsehash-devel \
|
||||
spatialite-tools \
|
||||
zlib-devel
|
||||
# Use v1 of checkout because v3 doesn't work with submodules
|
||||
shell: bash
|
||||
if: matrix.installer == 'dnf'
|
||||
# Use v1 of checkout because v2 doesn't work with submodules
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
submodules: true
|
||||
@@ -205,23 +197,21 @@ jobs:
|
||||
- uses: ./.github/actions/ctest
|
||||
|
||||
ubuntu-latest:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 40
|
||||
env:
|
||||
CC: clang-15
|
||||
CXX: clang++-15
|
||||
CC: clang-13
|
||||
CXX: clang++-13
|
||||
BUILD_TYPE: Dev
|
||||
WITH_PROJ: ON
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- name: Install new clang
|
||||
run: |
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/llvm-snapshot.asc
|
||||
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main'
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -yq clang-15
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main'
|
||||
shell: bash
|
||||
- uses: ./.github/actions/install-ubuntu
|
||||
- uses: ./.github/actions/install-protozero
|
||||
@@ -229,27 +219,16 @@ jobs:
|
||||
- uses: ./.github/actions/build
|
||||
- uses: ./.github/actions/ctest
|
||||
|
||||
macos:
|
||||
macos10-dev:
|
||||
runs-on: macos-10.15
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- "macos-11"
|
||||
- "macos-12"
|
||||
- "macos-13"
|
||||
build_type: [Dev]
|
||||
include:
|
||||
- os: "macos-12"
|
||||
build_type: Release
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
BUILD_TYPE: ${{ matrix.build_type }}
|
||||
BUILD_TYPE: Dev
|
||||
WITH_PROJ: OFF
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/actions/install-macos
|
||||
@@ -258,17 +237,47 @@ jobs:
|
||||
- uses: ./.github/actions/build
|
||||
- uses: ./.github/actions/ctest
|
||||
|
||||
windows-minimal:
|
||||
timeout-minutes: 40
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- windows-2019
|
||||
- windows-2022
|
||||
runs-on: ${{ matrix.os }}
|
||||
macos11-dev:
|
||||
runs-on: macos-11
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
BUILD_TYPE: Dev
|
||||
WITH_PROJ: OFF
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/actions/install-macos
|
||||
- uses: ./.github/actions/install-protozero
|
||||
- uses: ./.github/actions/cmake
|
||||
- uses: ./.github/actions/build
|
||||
- uses: ./.github/actions/ctest
|
||||
|
||||
macos11-release:
|
||||
runs-on: macos-11
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
BUILD_TYPE: Release
|
||||
WITH_PROJ: OFF
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/actions/install-macos
|
||||
- uses: ./.github/actions/install-protozero
|
||||
- uses: ./.github/actions/cmake
|
||||
- uses: ./.github/actions/build
|
||||
- uses: ./.github/actions/ctest
|
||||
|
||||
windows-2019-minimal:
|
||||
runs-on: windows-2019
|
||||
timeout-minutes: 40
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/actions/install-windows
|
||||
@@ -280,7 +289,7 @@ jobs:
|
||||
windows-2019-full:
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/actions/install-windows
|
||||
@@ -292,3 +301,16 @@ jobs:
|
||||
- uses: ./.github/actions/build-windows
|
||||
- uses: ./.github/actions/ctest-windows
|
||||
|
||||
windows-2022-minimal:
|
||||
runs-on: windows-2022
|
||||
timeout-minutes: 40
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- uses: ./.github/actions/install-windows
|
||||
- uses: ./.github/actions/install-protozero
|
||||
- uses: ./.github/actions/cmake-windows
|
||||
- uses: ./.github/actions/build-windows
|
||||
- uses: ./.github/actions/ctest-windows
|
||||
|
||||
|
||||
+22
-21
@@ -3,6 +3,7 @@ name: clang-tidy
|
||||
on: workflow_dispatch
|
||||
|
||||
jobs:
|
||||
|
||||
clang-tidy:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
@@ -13,9 +14,9 @@ jobs:
|
||||
- image: "debian:bullseye"
|
||||
clang: 11
|
||||
- image: "debian:testing"
|
||||
clang: 15
|
||||
clang: 12
|
||||
- image: "debian:experimental"
|
||||
clang: 15
|
||||
clang: 14
|
||||
container:
|
||||
image: ${{ matrix.image }}
|
||||
env:
|
||||
@@ -24,29 +25,29 @@ jobs:
|
||||
CXX: clang++-${{ matrix.clang }}
|
||||
CPP_VERSION: c++11
|
||||
WITH_PROJ: ON
|
||||
APT_LISTCHANGES_FRONTEND: none
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
steps:
|
||||
- name: Prepare container (apt)
|
||||
run: |
|
||||
export APT_LISTCHANGES_FRONTEND=none
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update -qq
|
||||
apt-get install -yq \
|
||||
clang-${{ matrix.clang }} \
|
||||
clang-tidy-${{ matrix.clang }} \
|
||||
cmake \
|
||||
git \
|
||||
libboost-dev \
|
||||
libbz2-dev \
|
||||
libexpat1-dev \
|
||||
libgdal-dev \
|
||||
libgeos++-dev \
|
||||
liblz4-dev \
|
||||
libproj-dev \
|
||||
libsparsehash-dev \
|
||||
make \
|
||||
zlib1g-dev
|
||||
apt-get install -y \
|
||||
clang-${{ matrix.clang }} \
|
||||
clang-tidy-${{ matrix.clang }} \
|
||||
cmake \
|
||||
git \
|
||||
libboost-dev \
|
||||
libbz2-dev \
|
||||
libexpat1-dev \
|
||||
libgdal-dev \
|
||||
libgeos++-dev \
|
||||
liblz4-dev \
|
||||
libproj-dev \
|
||||
libsparsehash-dev \
|
||||
make \
|
||||
zlib1g-dev
|
||||
shell: bash
|
||||
# Use v1 of checkout because v3 doesn't work with submodules
|
||||
# Use v1 of checkout because v2 doesn't work with submodules
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
submodules: true
|
||||
@@ -57,7 +58,7 @@ jobs:
|
||||
shell: bash
|
||||
working-directory: build
|
||||
- name: Upload Log
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v2
|
||||
if: always()
|
||||
with:
|
||||
name: clang-tidy-${{ matrix.clang }}-log
|
||||
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# Configuration for YouCompleteMe Vim plugin
|
||||
#
|
||||
# https://valloric.github.io/YouCompleteMe/
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
from os.path import realpath, dirname
|
||||
|
||||
basedir = dirname(realpath(__file__))
|
||||
|
||||
# some default flags
|
||||
# for more information install clang-3.2-doc package and
|
||||
# check UsersManual.html
|
||||
flags = [
|
||||
'-Werror',
|
||||
'-Wall',
|
||||
'-Wextra',
|
||||
'-pedantic',
|
||||
'-Wno-return-type',
|
||||
'-Wno-unused-parameter',
|
||||
'-Wno-unused-variable',
|
||||
|
||||
'-std=c++11',
|
||||
|
||||
# '-x' and 'c++' also required
|
||||
# use 'c' for C projects
|
||||
'-x',
|
||||
'c++',
|
||||
|
||||
# workaround for https://github.com/Valloric/YouCompleteMe/issues/303
|
||||
# also see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=800618
|
||||
'-isystem',
|
||||
'/usr/lib/ycmd/clang_includes/',
|
||||
|
||||
# libosmium include dirs
|
||||
'-I%s/include' % basedir,
|
||||
'-I%s/test/include' % basedir,
|
||||
'-I%s/test/data-test/include' % basedir,
|
||||
|
||||
# include third party libraries
|
||||
'-I/usr/include/gdal',
|
||||
]
|
||||
|
||||
# youcompleteme is calling this function to get flags
|
||||
# You can also set database for flags. Check: JSONCompilationDatabase.html in
|
||||
# clang-3.2-doc package
|
||||
def FlagsForFile( filename ):
|
||||
return {
|
||||
'flags': flags,
|
||||
'do_cache': True
|
||||
}
|
||||
Vendored
+1
-35
@@ -12,38 +12,6 @@ This project adheres to [Semantic Versioning](https://semver.org/).
|
||||
|
||||
### Fixed
|
||||
|
||||
## [2.20.0] - 2023-09-20
|
||||
|
||||
### Changed
|
||||
|
||||
* Optionally allow fractional seconds in timestamps in OSM files.
|
||||
* Enable `posix_fadvise` usage on FreeBSD.
|
||||
* Make parsing PBFs a bit less picky.
|
||||
* Various small code cleanups.
|
||||
|
||||
### Fixed
|
||||
|
||||
* Don't use class template arguments on `GeometryFactory` constructor
|
||||
definition.
|
||||
|
||||
## [2.19.0] - 2023-01-19
|
||||
|
||||
### Changed
|
||||
|
||||
* Mark RapidJSON support as deprecated.
|
||||
* Update included Catch to v2.13.10.
|
||||
* Remove deprecated BoolVector class.
|
||||
* Remove deprecated NWRIdSet class.
|
||||
* Remove deprecated AssemblerConfig constructor.
|
||||
* Print start of offending string in overlong string exception.
|
||||
* Implement `set_thread_name()` on FreeBSD.
|
||||
* Some small code cleanups.
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fix return type in `MembersDatabaseCommon::count_not_removed()`.
|
||||
* Make bzip2 unit tests pass on musl-based systems.
|
||||
* Fix bug in members database test case.
|
||||
|
||||
## [2.18.0] - 2022-02-07
|
||||
|
||||
@@ -1285,9 +1253,7 @@ long time. These will not be part of the next version of libosmium:
|
||||
Doxygen (up to version 1.8.8). This version contains a workaround to fix
|
||||
this.
|
||||
|
||||
[unreleased]: https://github.com/osmcode/libosmium/compare/v2.20.0...HEAD
|
||||
[2.20.0]: https://github.com/osmcode/libosmium/compare/v2.19.0...v2.20.0
|
||||
[2.19.0]: https://github.com/osmcode/libosmium/compare/v2.18.9...v2.19.0
|
||||
[unreleased]: https://github.com/osmcode/libosmium/compare/v2.18.0...HEAD
|
||||
[2.18.0]: https://github.com/osmcode/libosmium/compare/v2.17.3...v2.18.0
|
||||
[2.17.3]: https://github.com/osmcode/libosmium/compare/v2.17.2...v2.17.3
|
||||
[2.17.2]: https://github.com/osmcode/libosmium/compare/v2.17.1...v2.17.2
|
||||
|
||||
Vendored
+2
-2
@@ -39,7 +39,7 @@ set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;MinSizeRel;Dev;Cover
|
||||
project(libosmium)
|
||||
|
||||
set(LIBOSMIUM_VERSION_MAJOR 2)
|
||||
set(LIBOSMIUM_VERSION_MINOR 20)
|
||||
set(LIBOSMIUM_VERSION_MINOR 18)
|
||||
set(LIBOSMIUM_VERSION_PATCH 0)
|
||||
|
||||
set(LIBOSMIUM_VERSION
|
||||
@@ -427,7 +427,7 @@ endif()
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
message(STATUS "Looking for clang-tidy")
|
||||
find_program(CLANG_TIDY NAMES clang-tidy clang-tidy-16 clang-tidy-15 clang-tidy-14 clang-tidy-13 clang-tidy-12 clang-tidy-11)
|
||||
find_program(CLANG_TIDY NAMES clang-tidy clang-tidy-14 clang-tidy-13 clang-tidy-12 clang-tidy-11)
|
||||
|
||||
if(CLANG_TIDY)
|
||||
message(STATUS "Looking for clang-tidy - found ${CLANG_TIDY}")
|
||||
|
||||
+2
-1
@@ -136,7 +136,8 @@ directory, some data tests in `test/osm-testdata` and tests of the examples in
|
||||
`test/examples`. They are built by the default cmake config. Run `ctest` to
|
||||
run them. We can always use more tests.
|
||||
|
||||
Tests are run automatically using Github Actions.
|
||||
Tests are run automatically using Github Actions (Linux/macOS) and Appveyor
|
||||
(Windows) services.
|
||||
|
||||
|
||||
## Documenting the code
|
||||
|
||||
Vendored
+12
-2
@@ -7,6 +7,8 @@ A fast and flexible C++ library for working with OpenStreetMap data.
|
||||
Libosmium works on Linux, macOS and Windows.
|
||||
|
||||
[](https://github.com/osmcode/libosmium/actions)
|
||||
[](https://ci.appveyor.com/project/lonvia/libosmium-eq41p/branch/master)
|
||||
[](https://codecov.io/gh/osmcode/libosmium)
|
||||
[](https://repology.org/metapackage/libosmium)
|
||||
|
||||
Please see the [Libosmium manual](https://osmcode.org/libosmium/manual.html)
|
||||
@@ -15,8 +17,9 @@ for more details than this README can provide.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
You need a C++11 compiler and standard C++ library. Osmium needs at least GCC
|
||||
4.8 or clang (LLVM) 3.4. (Some parts may work with older versions.)
|
||||
Because Libosmium uses many C++11 features you need a modern compiler and
|
||||
standard C++ library. Osmium needs at least GCC 4.8 or clang (LLVM) 3.4.
|
||||
(Some parts may work with older versions.)
|
||||
|
||||
Different parts of Libosmium (and the applications built on top of it) need
|
||||
different libraries. You DO NOT NEED to install all of them, just install those
|
||||
@@ -85,6 +88,13 @@ See the
|
||||
for instructions.
|
||||
|
||||
|
||||
## Switching from the old Osmium
|
||||
|
||||
If you have been using the old version of Osmium at
|
||||
https://github.com/joto/osmium you might want to read about the [changes
|
||||
needed](https://osmcode.org/libosmium/manual.html#changes-from-old-versions-of-osmium).
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Libosmium is available under the Boost Software License. See LICENSE.
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ int main(int argc, char* argv[]) {
|
||||
try {
|
||||
const std::string input_filename{argv[1]};
|
||||
|
||||
const osmium::memory::Buffer buffer{osmium::io::read_file(input_filename)};
|
||||
osmium::memory::Buffer buffer{osmium::io::read_file(input_filename)};
|
||||
|
||||
const auto& map_factory = osmium::index::MapFactory<osmium::unsigned_object_id_type, osmium::Location>::instance();
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
try {
|
||||
const std::string input_filename{argv[1]};
|
||||
const std::string output_filename{argv[2]};
|
||||
std::string input_filename{argv[1]};
|
||||
std::string output_filename{argv[2]};
|
||||
|
||||
osmium::io::Reader reader{input_filename};
|
||||
const osmium::io::File output_file{output_filename, "pbf"};
|
||||
const osmium::io::Header header;
|
||||
osmium::io::File output_file{output_filename, "pbf"};
|
||||
osmium::io::Header header;
|
||||
osmium::io::Writer writer{output_file, header, osmium::io::overwrite::allow};
|
||||
|
||||
while (osmium::memory::Buffer buffer = reader.read()) { // NOLINT(bugprone-use-after-move) Bug in clang-tidy https://bugs.llvm.org/show_bug.cgi?id=36516
|
||||
|
||||
+1
-8
@@ -24,11 +24,6 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
SET PATH=C:/projects/bzip2.v140.1.0.6.9/build/native/bin/x64/%config%;%PATH%
|
||||
|
||||
nuget install lz4 -Version 1.3.1.2
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
SET PATH=C:/projects/lz4.1.3.1.2/build/native/bin/x64/%config%;%PATH%
|
||||
|
||||
CD libosmium
|
||||
|
||||
ECHO config^: %config%
|
||||
@@ -57,9 +52,7 @@ SET CMAKE_CMD=cmake .. -LA -G "Visual Studio 14 Win64" ^
|
||||
-DEXPAT_INCLUDE_DIR=C:/projects/expat.v140.2.2.5/build/native/include ^
|
||||
-DEXPAT_LIBRARY=C:/projects/expat.v140.2.2.5/build/native/lib/x64/%config%/libexpat%libpostfix%.lib ^
|
||||
-DBZIP2_INCLUDE_DIR=C:/projects/bzip2.v140.1.0.6.9/build/native/include ^
|
||||
-DBZIP2_LIBRARIES=C:/projects/bzip2.v140.1.0.6.9/build/native/lib/x64/%config%/libbz2%libpostfix%.lib ^
|
||||
-DLZ4_INCLUDE_DIR=C:/projects/lz4.1.3.1.2/build/native/include ^
|
||||
-DLZ4_LIBRARY=C:/projects/lz4.1.3.1.2/build/native/lib/x64/%config%/liblz4%libpostfix%.lib
|
||||
-DBZIP2_LIBRARIES=C:/projects/bzip2.v140.1.0.6.9/build/native/lib/x64/%config%/libbz2%libpostfix%.lib
|
||||
|
||||
ECHO calling^: %CMAKE_CMD%
|
||||
%CMAKE_CMD%
|
||||
|
||||
+1
-2
@@ -16,9 +16,8 @@ call C:\msys64\mingw64\bin\gem.cmd install json
|
||||
REM Workaround for problem with spatialite (see https://github.com/osmcode/libosmium/issues/262)
|
||||
copy /y C:\msys64\mingw64\bin\libreadline8.dll C:\msys64\mingw64\bin\libreadline7.dll
|
||||
|
||||
echo "Setting PROJ_LIB/DATA variable for correct PROJ.4 working"
|
||||
echo "Setting PROJ_LIB variable for correct PROJ.4 working"
|
||||
set PROJ_LIB=c:\msys64\mingw64\share\proj
|
||||
set PROJ_DATA=c:\msys64\mingw64\share\proj
|
||||
|
||||
set CXXFLAGS=-Wno-stringop-overflow
|
||||
|
||||
|
||||
+2
-2
@@ -74,8 +74,8 @@ class AmenityHandler : public osmium::handler::Handler {
|
||||
c.y += nr.lat();
|
||||
}
|
||||
|
||||
c.x /= static_cast<double>(nr_list.size());
|
||||
c.y /= static_cast<double>(nr_list.size());
|
||||
c.x /= nr_list.size();
|
||||
c.y /= nr_list.size();
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
+2
-2
@@ -122,11 +122,11 @@ int main(int argc, char* argv[]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
const osmium::io::File input_file{argv[2]};
|
||||
osmium::io::File input_file{argv[2]};
|
||||
|
||||
// Configuration for the multipolygon assembler. Here the default settings
|
||||
// are used, but you could change multiple settings.
|
||||
const osmium::area::Assembler::config_type assembler_config;
|
||||
osmium::area::Assembler::config_type assembler_config;
|
||||
|
||||
// Set up a filter matching only forests. This will be used to only build
|
||||
// areas with matching tags.
|
||||
|
||||
+2
-2
@@ -153,8 +153,8 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
// Get input and output file names from command line.
|
||||
const std::string input_file_name{argv[1]};
|
||||
const std::string output_file_name{argv[2]};
|
||||
std::string input_file_name{argv[1]};
|
||||
std::string output_file_name{argv[2]};
|
||||
|
||||
try {
|
||||
// Initialize Reader
|
||||
|
||||
+2
-2
@@ -68,7 +68,7 @@ int main(int argc, char* argv[]) {
|
||||
try {
|
||||
// The Reader is initialized here with an osmium::io::File, but could
|
||||
// also be directly initialized with a file name.
|
||||
const osmium::io::File input_file{argv[1]};
|
||||
osmium::io::File input_file{argv[1]};
|
||||
osmium::io::Reader reader{input_file};
|
||||
|
||||
// Create an instance of our own CountHandler and push the data from the
|
||||
@@ -88,7 +88,7 @@ int main(int argc, char* argv[]) {
|
||||
// (though not this one) can use huge amounts of data. So checking actual
|
||||
// memore usage is often useful and can be done easily with this class.
|
||||
// (Currently only works on Linux, not macOS and Windows.)
|
||||
const osmium::MemoryUsage memory;
|
||||
osmium::MemoryUsage memory;
|
||||
|
||||
std::cout << "\nMemory used: " << memory.peak() << " MBytes\n";
|
||||
} catch (const std::exception& e) {
|
||||
|
||||
+2
-2
@@ -40,11 +40,11 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
// Get output file name from command line.
|
||||
const std::string output_file_name{argv[1]};
|
||||
std::string output_file_name{argv[1]};
|
||||
|
||||
// If output file name is "-", this means STDOUT. Set the OPL file type
|
||||
// in this case. Otherwise take the file type from the file name suffix.
|
||||
const osmium::io::File output_file{output_file_name, output_file_name == "-" ? ".opl" : ""};
|
||||
osmium::io::File output_file{output_file_name, output_file_name == "-" ? ".opl" : ""};
|
||||
|
||||
try {
|
||||
// Create a buffer where all objects will live. Use a sensible initial
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ int main(int argc, char* argv[]) {
|
||||
// Get entity types from command line if there is a 2nd argument.
|
||||
if (argc == 3) {
|
||||
read_types = osmium::osm_entity_bits::nothing;
|
||||
const std::string types = argv[2];
|
||||
std::string types = argv[2];
|
||||
if (types.find('n') != std::string::npos) {
|
||||
read_types |= osmium::osm_entity_bits::node;
|
||||
}
|
||||
|
||||
+7
-7
@@ -165,31 +165,31 @@ int main(int argc, char* argv[]) {
|
||||
reader.close();
|
||||
|
||||
// Write out node, way, and relation offset indexes to disk.
|
||||
const IndexFile nodes_idx{output_dir + "/nodes.idx"};
|
||||
IndexFile nodes_idx{output_dir + "/nodes.idx"};
|
||||
node_index.dump_as_list(nodes_idx.fd());
|
||||
|
||||
const IndexFile ways_idx{output_dir + "/ways.idx"};
|
||||
IndexFile ways_idx{output_dir + "/ways.idx"};
|
||||
way_index.dump_as_list(ways_idx.fd());
|
||||
|
||||
const IndexFile relations_idx{output_dir + "/relations.idx"};
|
||||
IndexFile relations_idx{output_dir + "/relations.idx"};
|
||||
relation_index.dump_as_list(relations_idx.fd());
|
||||
|
||||
// Sort the maps (so later binary search will work on them) and write
|
||||
// them to disk.
|
||||
map_node2way.sort();
|
||||
const IndexFile node2way_idx{output_dir + "/node2way.map"};
|
||||
IndexFile node2way_idx{output_dir + "/node2way.map"};
|
||||
map_node2way.dump_as_list(node2way_idx.fd());
|
||||
|
||||
map_node2relation.sort();
|
||||
const IndexFile node2relation_idx{output_dir + "/node2rel.map"};
|
||||
IndexFile node2relation_idx{output_dir + "/node2rel.map"};
|
||||
map_node2relation.dump_as_list(node2relation_idx.fd());
|
||||
|
||||
map_way2relation.sort();
|
||||
const IndexFile way2relation_idx{output_dir + "/way2rel.map"};
|
||||
IndexFile way2relation_idx{output_dir + "/way2rel.map"};
|
||||
map_way2relation.dump_as_list(way2relation_idx.fd());
|
||||
|
||||
map_relation2relation.sort();
|
||||
const IndexFile relation2relation_idx{output_dir + "/rel2rel.map"};
|
||||
IndexFile relation2relation_idx{output_dir + "/rel2rel.map"};
|
||||
map_relation2relation.dump_as_list(relation2relation_idx.fd());
|
||||
} catch (const std::exception& e) {
|
||||
// All exceptions used by the Osmium library derive from std::exception.
|
||||
|
||||
@@ -47,10 +47,10 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
try {
|
||||
// The input file, deduce file format from file suffix.
|
||||
const osmium::io::File input_file{argv[1]};
|
||||
osmium::io::File input_file{argv[1]};
|
||||
|
||||
// The output file, force XML OSM file format.
|
||||
const osmium::io::File output_file{argv[2], "osm"};
|
||||
osmium::io::File output_file{argv[2], "osm"};
|
||||
|
||||
// Initialize Reader for the input file.
|
||||
// Read only changesets (will ignore nodes, ways, and
|
||||
|
||||
+7
-7
@@ -67,8 +67,8 @@ public:
|
||||
IndexAccess(const IndexAccess&) = delete;
|
||||
IndexAccess& operator=(const IndexAccess&) = delete;
|
||||
|
||||
IndexAccess(IndexAccess&&) noexcept = delete;
|
||||
IndexAccess& operator=(IndexAccess&&) noexcept = delete;
|
||||
IndexAccess(IndexAccess&&) = delete;
|
||||
IndexAccess& operator=(IndexAccess&&) = delete;
|
||||
|
||||
virtual ~IndexAccess() noexcept = default;
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
~IndexAccessDense() noexcept override = default;
|
||||
|
||||
void dump() const override {
|
||||
const index_type index{this->fd()};
|
||||
index_type index{this->fd()};
|
||||
|
||||
for (std::size_t i = 0; i < index.size(); ++i) {
|
||||
if (index.get(i) != TValue{}) {
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
}
|
||||
|
||||
bool search(const osmium::unsigned_object_id_type& key) const override {
|
||||
const index_type index{this->fd()};
|
||||
index_type index{this->fd()};
|
||||
|
||||
try {
|
||||
TValue value = index.get(key);
|
||||
@@ -153,7 +153,7 @@ public:
|
||||
~IndexAccessSparse() noexcept override = default;
|
||||
|
||||
void dump() const override {
|
||||
const index_type index{this->fd()};
|
||||
index_type index{this->fd()};
|
||||
|
||||
for (const auto& element : index) {
|
||||
std::cout << element.first << " " << element.second << "\n";
|
||||
@@ -164,7 +164,7 @@ public:
|
||||
using element_type = typename index_type::element_type;
|
||||
index_type index{this->fd()};
|
||||
|
||||
const element_type elem{key, TValue{}};
|
||||
element_type elem{key, TValue{}};
|
||||
const auto positions = std::equal_range(index.begin(),
|
||||
index.end(),
|
||||
elem,
|
||||
@@ -347,7 +347,7 @@ int run(const IndexAccess<TValue>& index, const Options& options) {
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
// Parse command line options.
|
||||
const Options options{argc, argv};
|
||||
Options options{argc, argv};
|
||||
|
||||
// Open the index file.
|
||||
const int fd = ::open(options.filename(), O_RDWR);
|
||||
|
||||
+2
-2
@@ -27,11 +27,11 @@ int main(int argc, char* argv[]) {
|
||||
try {
|
||||
// The Reader is initialized here with an osmium::io::File, but could
|
||||
// also be directly initialized with a file name.
|
||||
const osmium::io::File input_file{argv[1]};
|
||||
osmium::io::File input_file{argv[1]};
|
||||
osmium::io::Reader reader{input_file};
|
||||
|
||||
// OSM data comes in buffers, read until there are no more.
|
||||
while (const osmium::memory::Buffer buffer = reader.read()) {
|
||||
while (osmium::memory::Buffer buffer = reader.read()) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
@@ -34,14 +34,14 @@ int main(int argc, char* argv[]) {
|
||||
try {
|
||||
// The Reader is initialized here with an osmium::io::File, but could
|
||||
// also be directly initialized with a file name.
|
||||
const osmium::io::File input_file{argv[1]};
|
||||
osmium::io::File input_file{argv[1]};
|
||||
osmium::io::Reader reader{input_file};
|
||||
|
||||
// Initialize progress bar, enable it only if STDERR is a TTY.
|
||||
osmium::ProgressBar progress{reader.file_size(), osmium::isatty(2)};
|
||||
|
||||
// OSM data comes in buffers, read until there are no more.
|
||||
while (const osmium::memory::Buffer buffer = reader.read()) {
|
||||
while (osmium::memory::Buffer buffer = reader.read()) {
|
||||
// Update progress bar for each buffer.
|
||||
progress.update(reader.offset());
|
||||
}
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
// Create a tile at this location. This will also internally use the
|
||||
// Mercator projection and then calculate the tile coordinates.
|
||||
const osmium::geom::Tile tile{static_cast<uint32_t>(zoom), location};
|
||||
const osmium::geom::Tile tile{uint32_t(zoom), location};
|
||||
std::cout << "Tile: zoom=" << tile.z << " x=" << tile.x << " y=" << tile.y << "\n";
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -213,7 +213,7 @@ namespace osmium {
|
||||
|
||||
// Now create the Area object and add the attributes and tags
|
||||
// from the relation.
|
||||
const bool okay = create_area(out_buffer, relation, members);
|
||||
bool okay = create_area(out_buffer, relation, members);
|
||||
if (okay) {
|
||||
out_buffer.commit();
|
||||
} else {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -124,6 +124,15 @@ namespace osmium {
|
||||
|
||||
AssemblerConfig() noexcept = default;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @deprecated Use default constructor and set values afterwards.
|
||||
*/
|
||||
explicit AssemblerConfig(ProblemReporter* pr, bool d = false) :
|
||||
problem_reporter(pr),
|
||||
debug_level(d) {
|
||||
}
|
||||
|
||||
}; // struct AssemblerConfig
|
||||
|
||||
} // namespace area
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -332,10 +332,10 @@ namespace osmium {
|
||||
if (!way.nodes().empty() && way.is_closed() && !way.tags().empty()) {
|
||||
const auto d = std::count_if(way.tags().cbegin(), way.tags().cend(), std::cref(filter()));
|
||||
if (d > 0) {
|
||||
const osmium::tags::KeyFilter::iterator way_fi_begin(std::cref(filter()), way.tags().cbegin(), way.tags().cend());
|
||||
const osmium::tags::KeyFilter::iterator way_fi_end(std::cref(filter()), way.tags().cend(), way.tags().cend());
|
||||
const osmium::tags::KeyFilter::iterator area_fi_begin(std::cref(filter()), area_tags.cbegin(), area_tags.cend());
|
||||
const osmium::tags::KeyFilter::iterator area_fi_end(std::cref(filter()), area_tags.cend(), area_tags.cend());
|
||||
osmium::tags::KeyFilter::iterator way_fi_begin(std::cref(filter()), way.tags().cbegin(), way.tags().cend());
|
||||
osmium::tags::KeyFilter::iterator way_fi_end(std::cref(filter()), way.tags().cend(), way.tags().cend());
|
||||
osmium::tags::KeyFilter::iterator area_fi_begin(std::cref(filter()), area_tags.cbegin(), area_tags.cend());
|
||||
osmium::tags::KeyFilter::iterator area_fi_end(std::cref(filter()), area_tags.cend(), area_tags.cend());
|
||||
#ifdef __cpp_lib_robust_nonmodifying_seq_ops
|
||||
if (!std::equal(way_fi_begin, way_fi_end, area_fi_begin, area_fi_end)) {
|
||||
#else
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -608,7 +608,7 @@ namespace osmium {
|
||||
|
||||
void create_rings_simple_case() {
|
||||
auto count_remaining = m_segment_list.size();
|
||||
for (const slocation& sl : m_locations) {
|
||||
for (slocation& sl : m_locations) {
|
||||
const NodeRefSegment& segment = m_segment_list[sl.item];
|
||||
if (!segment.is_done()) {
|
||||
count_remaining -= add_new_ring(sl);
|
||||
@@ -671,7 +671,7 @@ namespace osmium {
|
||||
std::cerr << " Trying to merge " << open_ring_its.size() << " open rings (try_to_merge)\n";
|
||||
}
|
||||
|
||||
const auto xrings = create_location_to_ring_map(open_ring_its);
|
||||
std::vector<location_to_ring_map> xrings = create_location_to_ring_map(open_ring_its);
|
||||
|
||||
auto it = xrings.cbegin();
|
||||
while (it != xrings.cend()) {
|
||||
@@ -825,7 +825,7 @@ namespace osmium {
|
||||
|
||||
find_inner_outer_complex();
|
||||
ProtoRing* outer_ring = find_enclosing_ring(ring_min->ring().min_segment());
|
||||
const bool ring_min_is_outer = !outer_ring;
|
||||
bool ring_min_is_outer = !outer_ring;
|
||||
if (debug()) {
|
||||
std::cerr << " Open ring is " << (ring_min_is_outer ? "outer" : "inner") << " ring\n";
|
||||
}
|
||||
@@ -924,7 +924,7 @@ namespace osmium {
|
||||
|
||||
// Now find all the rest of the rings (ie not starting at split locations)
|
||||
if (count_remaining > 0) {
|
||||
for (const slocation& sl : m_locations) {
|
||||
for (slocation& sl : m_locations) {
|
||||
const NodeRefSegment& segment = m_segment_list[sl.item];
|
||||
if (!segment.is_done()) {
|
||||
count_remaining -= add_new_ring_complex(sl);
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace osmium {
|
||||
|
||||
const char* role_name() const noexcept {
|
||||
static const std::array<const char*, 4> names = {{"unknown", "outer", "inner", "empty"}};
|
||||
return names[static_cast<int>(m_role)];
|
||||
return names[int(m_role)];
|
||||
}
|
||||
|
||||
const osmium::Way* way() const noexcept {
|
||||
@@ -327,9 +327,9 @@ namespace osmium {
|
||||
|
||||
if ((d > 0 && na >= 0 && na <= d && nb >= 0 && nb <= d) ||
|
||||
(d < 0 && na <= 0 && na >= d && nb <= 0 && nb >= d)) {
|
||||
const double ua = static_cast<double>(na) / static_cast<double>(d);
|
||||
const double ua = double(na) / d;
|
||||
const vec i = p0 + ua * (p1 - p0);
|
||||
return osmium::Location{static_cast<int32_t>(i.x), static_cast<int32_t>(i.y)};
|
||||
return osmium::Location{int32_t(i.x), int32_t(i.y)};
|
||||
}
|
||||
|
||||
return osmium::Location{};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -86,16 +86,16 @@ namespace osmium {
|
||||
int64_t m_num;
|
||||
#endif
|
||||
|
||||
int64_t m_sum = 0;
|
||||
int64_t m_sum;
|
||||
|
||||
public:
|
||||
|
||||
explicit ProtoRing(NodeRefSegment* segment) noexcept :
|
||||
m_min_segment(segment)
|
||||
m_min_segment(segment),
|
||||
#ifdef OSMIUM_DEBUG_RING_NO
|
||||
, m_num(next_num())
|
||||
m_num(next_num()),
|
||||
#endif
|
||||
{
|
||||
m_sum(0) {
|
||||
add_segment_back(segment);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -333,7 +333,7 @@ namespace osmium {
|
||||
}
|
||||
|
||||
if (y_range_overlap(s1, s2)) {
|
||||
const osmium::Location intersection{calculate_intersection(s1, s2)};
|
||||
osmium::Location intersection{calculate_intersection(s1, s2)};
|
||||
if (intersection) {
|
||||
++found_intersections;
|
||||
if (m_debug) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -89,12 +89,12 @@ namespace osmium {
|
||||
|
||||
// scale vector
|
||||
constexpr inline vec operator*(double s, const vec& v) noexcept {
|
||||
return vec{static_cast<int64_t>(s * static_cast<double>(v.x)), static_cast<int64_t>(s * static_cast<double>(v.y))};
|
||||
return vec{int64_t(s * v.x), int64_t(s * v.y)};
|
||||
}
|
||||
|
||||
// scale vector
|
||||
constexpr inline vec operator*(const vec& v, double s) noexcept {
|
||||
return vec{static_cast<int64_t>(s * static_cast<double>(v.x)), static_cast<int64_t>(s * static_cast<double>(v.y))};
|
||||
return vec{int64_t(s * v.x), int64_t(s * v.y)};
|
||||
}
|
||||
|
||||
// equality
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -75,15 +75,15 @@ namespace osmium {
|
||||
void set_object(gdalcpp::Feature& feature) {
|
||||
const char t[2] = {osmium::item_type_to_char(m_object_type), '\0'};
|
||||
feature.set_field("obj_type", t);
|
||||
feature.set_field("obj_id", static_cast<int32_t>(m_object_id));
|
||||
feature.set_field("nodes", static_cast<int32_t>(m_nodes));
|
||||
feature.set_field("obj_id", int32_t(m_object_id));
|
||||
feature.set_field("nodes", int32_t(m_nodes));
|
||||
}
|
||||
|
||||
void write_point(const char* problem_type, osmium::object_id_type id1, osmium::object_id_type id2, osmium::Location location) {
|
||||
gdalcpp::Feature feature{m_layer_perror, m_ogr_factory.create_point(location)};
|
||||
set_object(feature);
|
||||
feature.set_field("id1", static_cast<double>(id1));
|
||||
feature.set_field("id2", static_cast<double>(id2));
|
||||
feature.set_field("id1", double(id1));
|
||||
feature.set_field("id2", double(id2));
|
||||
feature.set_field("problem", problem_type);
|
||||
feature.add_to_layer();
|
||||
}
|
||||
@@ -176,7 +176,7 @@ namespace osmium {
|
||||
try {
|
||||
gdalcpp::Feature feature{m_layer_lerror, m_ogr_factory.create_linestring(way)};
|
||||
set_object(feature);
|
||||
feature.set_field("id1", static_cast<int32_t>(way.id()));
|
||||
feature.set_field("id1", int32_t(way.id()));
|
||||
feature.set_field("id2", 0);
|
||||
feature.set_field("problem", "way_in_multiple_rings");
|
||||
feature.add_to_layer();
|
||||
@@ -192,7 +192,7 @@ namespace osmium {
|
||||
try {
|
||||
gdalcpp::Feature feature{m_layer_lerror, m_ogr_factory.create_linestring(way)};
|
||||
set_object(feature);
|
||||
feature.set_field("id1", static_cast<int32_t>(way.id()));
|
||||
feature.set_field("id1", int32_t(way.id()));
|
||||
feature.set_field("id2", 0);
|
||||
feature.set_field("problem", "inner_with_same_tags");
|
||||
feature.add_to_layer();
|
||||
@@ -208,7 +208,7 @@ namespace osmium {
|
||||
try {
|
||||
gdalcpp::Feature feature{m_layer_lerror, m_ogr_factory.create_linestring(way)};
|
||||
set_object(feature);
|
||||
feature.set_field("id1", static_cast<int32_t>(way.id()));
|
||||
feature.set_field("id1", int32_t(way.id()));
|
||||
feature.set_field("id2", 0);
|
||||
feature.set_field("problem", "duplicate_way");
|
||||
feature.add_to_layer();
|
||||
@@ -229,7 +229,7 @@ namespace osmium {
|
||||
try {
|
||||
gdalcpp::Feature feature{m_layer_ways, m_ogr_factory.create_linestring(way)};
|
||||
set_object(feature);
|
||||
feature.set_field("way_id", static_cast<int32_t>(way.id()));
|
||||
feature.set_field("way_id", int32_t(way.id()));
|
||||
feature.add_to_layer();
|
||||
} catch (const osmium::geometry_error&) {
|
||||
// XXX
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -125,8 +125,8 @@ namespace osmium {
|
||||
if (value_length > osmium::max_osm_string_length) {
|
||||
throw std::length_error{"OSM tag value is too long"};
|
||||
}
|
||||
add_size(append_with_zero(key, static_cast<osmium::memory::item_size_type>(key_length)));
|
||||
add_size(append_with_zero(value, static_cast<osmium::memory::item_size_type>(value_length)));
|
||||
add_size(append_with_zero(key, osmium::memory::item_size_type(key_length)));
|
||||
add_size(append_with_zero(value, osmium::memory::item_size_type(value_length)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,8 +142,8 @@ namespace osmium {
|
||||
if (value.size() > osmium::max_osm_string_length) {
|
||||
throw std::length_error{"OSM tag value is too long"};
|
||||
}
|
||||
add_size(append(key.data(), static_cast<osmium::memory::item_size_type>(key.size()) + 1));
|
||||
add_size(append(value.data(), static_cast<osmium::memory::item_size_type>(value.size()) + 1));
|
||||
add_size(append(key.data(), osmium::memory::item_size_type(key.size()) + 1));
|
||||
add_size(append(value.data(), osmium::memory::item_size_type(value.size()) + 1));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,8 +240,8 @@ namespace osmium {
|
||||
if (length > osmium::max_osm_string_length) {
|
||||
throw std::length_error{"OSM relation member role is too long"};
|
||||
}
|
||||
member.set_role_size(static_cast<osmium::string_size_type>(length) + 1);
|
||||
add_size(append_with_zero(role, static_cast<osmium::memory::item_size_type>(length)));
|
||||
member.set_role_size(osmium::string_size_type(length) + 1);
|
||||
add_size(append_with_zero(role, osmium::memory::item_size_type(length)));
|
||||
add_padding(true);
|
||||
}
|
||||
|
||||
@@ -330,16 +330,16 @@ namespace osmium {
|
||||
if (length > osmium::max_osm_string_length) {
|
||||
throw std::length_error{"OSM user name is too long"};
|
||||
}
|
||||
comment.set_user_size(static_cast<osmium::string_size_type>(length) + 1);
|
||||
add_size(append_with_zero(user, static_cast<osmium::memory::item_size_type>(length)));
|
||||
comment.set_user_size(osmium::string_size_type(length) + 1);
|
||||
add_size(append_with_zero(user, osmium::memory::item_size_type(length)));
|
||||
}
|
||||
|
||||
void add_text(osmium::ChangesetComment& comment, const char* text, const std::size_t length) {
|
||||
if (length > std::numeric_limits<osmium::changeset_comment_size_type>::max() - 1) {
|
||||
throw std::length_error{"OSM changeset comment is too long"};
|
||||
}
|
||||
comment.set_text_size(static_cast<osmium::changeset_comment_size_type>(length) + 1);
|
||||
add_size(append_with_zero(text, static_cast<osmium::memory::item_size_type>(length)));
|
||||
comment.set_text_size(osmium::changeset_comment_size_type(length) + 1);
|
||||
add_size(append_with_zero(text, osmium::memory::item_size_type(length)));
|
||||
add_padding(true);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+4
-4
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace osmium {
|
||||
|
||||
public:
|
||||
|
||||
GeometryFactory() :
|
||||
GeometryFactory<TGeomImpl, TProjection>() :
|
||||
m_projection(),
|
||||
m_impl(m_projection.epsg()) {
|
||||
}
|
||||
@@ -175,7 +175,7 @@ namespace osmium {
|
||||
* Constructor for default initialized projection.
|
||||
*/
|
||||
template <typename... TArgs>
|
||||
explicit GeometryFactory(TArgs&&... args) :
|
||||
explicit GeometryFactory<TGeomImpl, TProjection>(TArgs&&... args) :
|
||||
m_projection(),
|
||||
m_impl(m_projection.epsg(), std::forward<TArgs>(args)...) {
|
||||
}
|
||||
@@ -185,7 +185,7 @@ namespace osmium {
|
||||
* projection is moved into the GeometryFactory.
|
||||
*/
|
||||
template <typename... TArgs>
|
||||
explicit GeometryFactory(TProjection&& projection, TArgs&&... args) :
|
||||
explicit GeometryFactory<TGeomImpl, TProjection>(TProjection&& projection, TArgs&&... args) :
|
||||
m_projection(std::move(projection)),
|
||||
m_impl(m_projection.epsg(), std::forward<TArgs>(args)...) {
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -47,9 +47,6 @@ namespace osmium {
|
||||
/**
|
||||
* A geometry factory implementation that can be used with the
|
||||
* RapidJSON (https://github.com/miloyip/rapidjson) JSON writer.
|
||||
*
|
||||
* @deprecated The RapidJSON support will be removed in a future
|
||||
* version of libosmium.
|
||||
*/
|
||||
template <typename TWriter>
|
||||
class RapidGeoJSONFactoryImpl {
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace osmium {
|
||||
std::string out;
|
||||
out.reserve(str.size() * 2);
|
||||
|
||||
for (const char c : str) {
|
||||
for (char c : str) {
|
||||
out += lookup_hex[(static_cast<unsigned int>(c) >> 4U) & 0xfU];
|
||||
out += lookup_hex[ static_cast<unsigned int>(c) & 0xfU];
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
#ifndef OSMIUM_INDEX_BOOL_VECTOR_HPP
|
||||
#define OSMIUM_INDEX_BOOL_VECTOR_HPP
|
||||
|
||||
/*
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#include <osmium/index/id_set.hpp>
|
||||
|
||||
namespace osmium {
|
||||
|
||||
namespace index {
|
||||
|
||||
/// @deprecated Use osmium::index::IdSet instead.
|
||||
template <typename T>
|
||||
using BoolVector = IdSet<T>;
|
||||
|
||||
} // namespace index
|
||||
|
||||
} // namespace osmium
|
||||
|
||||
#endif // OSMIUM_INDEX_BOOL_VECTOR_HPP
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -241,7 +241,7 @@ namespace osmium {
|
||||
void dump_as_array(const int fd) final {
|
||||
constexpr const size_t value_size = sizeof(TValue);
|
||||
constexpr const size_t buffer_size = (10L * 1024L * 1024L) / value_size;
|
||||
const std::unique_ptr<TValue[]> output_buffer{new TValue[buffer_size]};
|
||||
std::unique_ptr<TValue[]> output_buffer{new TValue[buffer_size]};
|
||||
|
||||
size_t buffer_start_id = 0;
|
||||
for (auto it = cbegin(); it != cend();) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+21
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -503,6 +503,26 @@ namespace osmium {
|
||||
|
||||
}; // class IdSetSmall
|
||||
|
||||
/// @deprecated Use nwr_array helper class instead.
|
||||
template <template <typename> class IdSetType>
|
||||
class NWRIdSet {
|
||||
|
||||
using id_set_type = IdSetType<osmium::unsigned_object_id_type>;
|
||||
|
||||
std::array<id_set_type, 3> m_sets;
|
||||
|
||||
public:
|
||||
|
||||
id_set_type& operator()(osmium::item_type type) noexcept {
|
||||
return m_sets[osmium::item_type_to_nwr_index(type)];
|
||||
}
|
||||
|
||||
const id_set_type& operator()(osmium::item_type type) const noexcept {
|
||||
return m_sets[osmium::item_type_to_nwr_index(type)];
|
||||
}
|
||||
|
||||
}; // class NWRIdSet
|
||||
|
||||
} // namespace index
|
||||
|
||||
} // namespace osmium
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
+1
-2
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -236,7 +236,6 @@ namespace osmium {
|
||||
|
||||
std::vector<std::string> map_types() const {
|
||||
std::vector<std::string> result;
|
||||
result.reserve(m_callbacks.size());
|
||||
|
||||
for (const auto& cb : m_callbacks) {
|
||||
result.push_back(cb.first);
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This file is part of Osmium (https://osmcode.org/libosmium).
|
||||
|
||||
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user