adjust for comments by daniel-j-h

This commit is contained in:
Moritz Kobitzsch
2016-09-30 14:33:43 +02:00
parent 805d93912d
commit d1f1358e48
8 changed files with 180 additions and 162 deletions
+5 -5
View File
@@ -160,17 +160,17 @@ template <typename EdgeDataT, bool UseSharedMemory = false> class StaticGraph
* matching edge is found.
*/
template <typename FilterFunction>
EdgeIterator FindSmallestEdge(const NodeIterator from,
const NodeIterator to,
const FilterFunction filter) const
EdgeIterator
FindSmallestEdge(const NodeIterator from, const NodeIterator to, FilterFunction &&filter) const
{
EdgeIterator smallest_edge = SPECIAL_EDGEID;
EdgeWeight smallest_weight = INVALID_EDGE_WEIGHT;
for (auto edge : GetAdjacentEdgeRange(from))
{
const NodeID target = GetTarget(edge);
const auto data = GetEdgeData(edge);
if (target == to && data.distance < smallest_weight && filter(data))
const auto &data = GetEdgeData(edge);
if (target == to && data.distance < smallest_weight &&
std::forward<FilterFunction>(filter)(data))
{
smallest_edge = edge;
smallest_weight = data.distance;
-2
View File
@@ -85,8 +85,6 @@ static const EdgeWeight INVALID_EDGE_WEIGHT = std::numeric_limits<EdgeWeight>::m
using DatasourceID = std::uint8_t;
using DatasourceID = std::uint8_t;
struct SegmentID
{
SegmentID(const NodeID id_, const bool enabled_) : id{id_}, enabled{enabled_}
+17 -13
View File
@@ -10,25 +10,29 @@ namespace util
namespace vector_tile
{
const constexpr std::uint32_t LAYER_TAG = 3;
const constexpr std::uint32_t NAME_TAG = 1;
const constexpr std::uint32_t VERSION_TAG = 15;
const constexpr std::uint32_t EXTENT_TAG = 5;
const constexpr std::uint32_t FEATURE_TAG = 2;
const constexpr std::uint32_t GEOMETRY_TAG = 3;
const constexpr std::uint32_t VARIANT_TAG = 4;
const constexpr std::uint32_t KEY_TAG = 3;
const constexpr std::uint32_t ID_TAG = 1;
const constexpr std::uint32_t GEOMETRY_TYPE_POINT = 1;
const constexpr std::uint32_t GEOMETRY_TYPE_LINE = 2;
const constexpr std::uint32_t NAME_TAG = 1;
const constexpr std::uint32_t FEATURE_TAG = 2;
const constexpr std::uint32_t LAYER_TAG = 3;
const constexpr std::uint32_t GEOMETRY_TAG = 3;
const constexpr std::uint32_t KEY_TAG = 3;
const constexpr std::uint32_t VARIANT_TAG = 4;
const constexpr std::uint32_t EXTENT_TAG = 5;
const constexpr std::uint32_t VERSION_TAG = 15;
const constexpr std::uint32_t FEATURE_ATTRIBUTES_TAG = 2;
const constexpr std::uint32_t FEATURE_GEOMETRIES_TAG = 4;
const constexpr std::uint32_t GEOMETRY_TYPE_POINT = 1;
const constexpr std::uint32_t GEOMETRY_TYPE_LINE = 2;
const constexpr std::uint32_t VARIANT_TYPE_STRING = 1;
const constexpr std::uint32_t VARIANT_TYPE_FLOAT = 2;
const constexpr std::uint32_t VARIANT_TYPE_DOUBLE = 3;
const constexpr std::uint32_t VARIANT_TYPE_UINT64 = 5;
const constexpr std::uint32_t VARIANT_TYPE_SINT64 = 6;
const constexpr std::uint32_t VARIANT_TYPE_BOOL = 7;
const constexpr std::uint32_t VARIANT_TYPE_STRING = 1;
const constexpr std::uint32_t VARIANT_TYPE_DOUBLE = 3;
const constexpr std::uint32_t VARIANT_TYPE_FLOAT = 2;
// Vector tiles are 4096 virtual pixels on each side
const constexpr double EXTENT = 4096.0;