uncompressed edges get serialized correctly'ish
This commit is contained in:
@@ -61,7 +61,8 @@ public:
|
||||
bool ra,
|
||||
bool ig,
|
||||
bool ar,
|
||||
bool cf
|
||||
bool cf,
|
||||
bool is_split
|
||||
) : _source(s),
|
||||
_target(t),
|
||||
_name(n),
|
||||
@@ -72,7 +73,8 @@ public:
|
||||
_roundabout(ra),
|
||||
_ignoreInGrid(ig),
|
||||
_accessRestricted(ar),
|
||||
_contraFlow(cf)
|
||||
_contraFlow(cf),
|
||||
is_split(is_split)
|
||||
{
|
||||
if(ty < 0) {
|
||||
throw OSRMException("negative edge type");
|
||||
@@ -93,6 +95,7 @@ public:
|
||||
bool ignoreInGrid() const { return _ignoreInGrid; }
|
||||
bool isAccessRestricted() const { return _accessRestricted; }
|
||||
bool isContraFlow() const { return _contraFlow; }
|
||||
bool IsSplit() const { return is_split; }
|
||||
|
||||
//TODO: names need to be fixed.
|
||||
NodeID _source;
|
||||
@@ -106,6 +109,7 @@ public:
|
||||
bool _ignoreInGrid:1;
|
||||
bool _accessRestricted:1;
|
||||
bool _contraFlow:1;
|
||||
bool is_split:1;
|
||||
|
||||
private:
|
||||
NodeBasedEdge() { }
|
||||
|
||||
@@ -44,11 +44,17 @@ struct ExternalMemoryNode : NodeInfo {
|
||||
bollard(bollard),
|
||||
trafficLight(traffic_light)
|
||||
{ }
|
||||
ExternalMemoryNode() : bollard(false), trafficLight(false) {}
|
||||
|
||||
ExternalMemoryNode()
|
||||
:
|
||||
bollard(false),
|
||||
trafficLight(false)
|
||||
{ }
|
||||
|
||||
static ExternalMemoryNode min_value() {
|
||||
return ExternalMemoryNode(0,0,0, false, false);
|
||||
}
|
||||
|
||||
static ExternalMemoryNode max_value() {
|
||||
return ExternalMemoryNode(
|
||||
std::numeric_limits<int>::max(),
|
||||
@@ -58,9 +64,11 @@ struct ExternalMemoryNode : NodeInfo {
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
NodeID key() const {
|
||||
return id;
|
||||
}
|
||||
|
||||
bool bollard;
|
||||
bool trafficLight;
|
||||
};
|
||||
|
||||
@@ -33,9 +33,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
struct PhantomNode {
|
||||
PhantomNode() :
|
||||
forward_node_id(UINT_MAX),
|
||||
reverse_node_id(UINT_MAX),
|
||||
name_id(UINT_MAX),
|
||||
forward_node_id(std::numeric_limits<unsigned>::max()),
|
||||
reverse_node_id(std::numeric_limits<unsigned>::max()),
|
||||
name_id(std::numeric_limits<unsigned>::max()),
|
||||
forward_weight(INT_MAX),
|
||||
reverse_weight(INT_MAX),
|
||||
ratio(0.)
|
||||
@@ -50,15 +50,15 @@ struct PhantomNode {
|
||||
FixedPointCoordinate location;
|
||||
|
||||
void Reset() {
|
||||
forward_node_id = UINT_MAX;
|
||||
name_id = UINT_MAX;
|
||||
forward_node_id = std::numeric_limits<unsigned>::max();
|
||||
name_id = std::numeric_limits<unsigned>::max();
|
||||
forward_weight = INT_MAX;
|
||||
reverse_weight = INT_MAX;
|
||||
ratio = 0.;
|
||||
location.Reset();
|
||||
}
|
||||
bool isBidirected() const {
|
||||
return forward_weight != INT_MAX && reverse_weight != INT_MAX;
|
||||
return forward_node_id != UINT_MAX && reverse_node_id != UINT_MAX;
|
||||
}
|
||||
bool isValid(const unsigned numberOfNodes) const {
|
||||
return
|
||||
@@ -67,7 +67,7 @@ struct PhantomNode {
|
||||
( (forward_weight != INT_MAX) || (reverse_weight != INT_MAX) ) &&
|
||||
(ratio >= 0.) &&
|
||||
(ratio <= 1.) &&
|
||||
(name_id != UINT_MAX);
|
||||
(name_id != std::numeric_limits<unsigned>::max());
|
||||
}
|
||||
|
||||
bool operator==(const PhantomNode & other) const {
|
||||
@@ -88,7 +88,7 @@ struct PhantomNodes {
|
||||
}
|
||||
|
||||
bool AtLeastOnePhantomNodeIsUINTMAX() const {
|
||||
return !(startPhantom.forward_node_id == UINT_MAX || targetPhantom.forward_node_id == UINT_MAX);
|
||||
return !(startPhantom.forward_node_id == std::numeric_limits<unsigned>::max() || targetPhantom.forward_node_id == std::numeric_limits<unsigned>::max());
|
||||
}
|
||||
|
||||
bool PhantomNodesHaveEqualLocation() const {
|
||||
|
||||
@@ -722,6 +722,11 @@ public:
|
||||
}
|
||||
result_phantom_node.ratio = ratio;
|
||||
|
||||
SimpleLogger().Write(logDEBUG) << "result location: " << result_phantom_node.location;
|
||||
SimpleLogger().Write(logDEBUG) << "fwd node: " << result_phantom_node.forward_node_id << ", rev node: " << result_phantom_node.reverse_node_id;
|
||||
SimpleLogger().Write(logDEBUG) << "fwd weight: " << result_phantom_node.forward_weight << ", rev weight: " << result_phantom_node.reverse_weight << ", ratio: " << result_phantom_node.ratio;
|
||||
|
||||
|
||||
return found_a_nearest_edge;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user