diff --git a/Algorithms/StronglyConnectedComponents.h b/Algorithms/StronglyConnectedComponents.h index a83110034..c8c366fb0 100644 --- a/Algorithms/StronglyConnectedComponents.h +++ b/Algorithms/StronglyConnectedComponents.h @@ -52,7 +52,6 @@ private: unsigned edgeBasedNodeID; unsigned nameID:31; bool shortcut:1; - short type; bool isAccessRestricted:1; bool forward:1; bool backward:1; @@ -165,7 +164,6 @@ public: edge.data.roundabout = i->isRoundabout(); edge.data.ignoreInGrid = i->ignoreInGrid(); edge.data.nameID = i->name(); - edge.data.type = i->type(); edge.data.isAccessRestricted = i->isAccessRestricted(); edge.data.edgeBasedNodeID = edges.size(); edges.push_back( edge ); @@ -312,27 +310,25 @@ public: for(_NodeBasedDynamicGraph::EdgeIterator e1 = _nodeBasedGraph->BeginEdges(u); e1 < _nodeBasedGraph->EndEdges(u); ++e1) { _NodeBasedDynamicGraph::NodeIterator v = _nodeBasedGraph->GetTarget(e1); - if(_nodeBasedGraph->GetEdgeData(e1).type != SHRT_MAX) { - assert(e1 != UINT_MAX); - assert(u != UINT_MAX); - assert(v != UINT_MAX); - //edges that end on bollard nodes may actually be in two distinct components - if(std::min(vectorOfComponentSizes[componentsIndex[u]], vectorOfComponentSizes[componentsIndex[v]]) < 10) { + assert(e1 != UINT_MAX); + assert(u != UINT_MAX); + assert(v != UINT_MAX); + //edges that end on bollard nodes may actually be in two distinct components + if(std::min(vectorOfComponentSizes[componentsIndex[u]], vectorOfComponentSizes[componentsIndex[v]]) < 10) { - //INFO("(" << inputNodeInfoList[u].lat/100000. << ";" << inputNodeInfoList[u].lon/100000. << ") -> (" << inputNodeInfoList[v].lat/100000. << ";" << inputNodeInfoList[v].lon/100000. << ")"); - OGRLineString lineString; - lineString.addPoint(inputNodeInfoList[u].lon/100000., inputNodeInfoList[u].lat/100000.); - lineString.addPoint(inputNodeInfoList[v].lon/100000., inputNodeInfoList[v].lat/100000.); + //INFO("(" << inputNodeInfoList[u].lat/100000. << ";" << inputNodeInfoList[u].lon/100000. << ") -> (" << inputNodeInfoList[v].lat/100000. << ";" << inputNodeInfoList[v].lon/100000. << ")"); + OGRLineString lineString; + lineString.addPoint(inputNodeInfoList[u].lon/100000., inputNodeInfoList[u].lat/100000.); + lineString.addPoint(inputNodeInfoList[v].lon/100000., inputNodeInfoList[v].lat/100000.); - OGRFeature *poFeature; - poFeature = OGRFeature::CreateFeature( poLayer->GetLayerDefn() ); - poFeature->SetGeometry( &lineString ); - if( poLayer->CreateFeature( poFeature ) != OGRERR_NONE ) - { - ERR( "Failed to create feature in shapefile.\n" ); - } - OGRFeature::DestroyFeature( poFeature ); + OGRFeature *poFeature; + poFeature = OGRFeature::CreateFeature( poLayer->GetLayerDefn() ); + poFeature->SetGeometry( &lineString ); + if( poLayer->CreateFeature( poFeature ) != OGRERR_NONE ) + { + ERR( "Failed to create feature in shapefile.\n" ); } + OGRFeature::DestroyFeature( poFeature ); } } } diff --git a/Contractor/EdgeBasedGraphFactory.cpp b/Contractor/EdgeBasedGraphFactory.cpp index 9af857159..ec3a5cd48 100644 --- a/Contractor/EdgeBasedGraphFactory.cpp +++ b/Contractor/EdgeBasedGraphFactory.cpp @@ -70,7 +70,6 @@ EdgeBasedGraphFactory::EdgeBasedGraphFactory(int nodes, std::vectorisRoundabout(); edge.data.ignoreInGrid = i->ignoreInGrid(); edge.data.nameID = i->name(); - edge.data.type = i->type(); edge.data.isAccessRestricted = i->isAccessRestricted(); edge.data.edgeBasedNodeID = edges.size(); edge.data.contraFlow = i->isContraFlow(); @@ -223,13 +222,11 @@ void EdgeBasedGraphFactory::Run(const char * originalEdgeDataFilename, lua_State for(_NodeBasedDynamicGraph::EdgeIterator e1 = _nodeBasedGraph->BeginEdges(u); e1 < _nodeBasedGraph->EndEdges(u); ++e1) { _NodeBasedDynamicGraph::NodeIterator v = _nodeBasedGraph->GetTarget(e1); - if(_nodeBasedGraph->GetEdgeData(e1).type != SHRT_MAX) { - assert(e1 != UINT_MAX); - assert(u != UINT_MAX); - assert(v != UINT_MAX); - //edges that end on bollard nodes may actually be in two distinct components - InsertEdgeBasedNode(e1, u, v, (std::min(vectorOfComponentSizes[componentsIndex[u]], vectorOfComponentSizes[componentsIndex[v]]) < 1000) ); - } + assert(e1 != UINT_MAX); + assert(u != UINT_MAX); + assert(v != UINT_MAX); + //edges that end on bollard nodes may actually be in two distinct components + InsertEdgeBasedNode(e1, u, v, (std::min(vectorOfComponentSizes[componentsIndex[u]], vectorOfComponentSizes[componentsIndex[v]]) < 1000) ); } } diff --git a/Contractor/EdgeBasedGraphFactory.h b/Contractor/EdgeBasedGraphFactory.h index 04caaf734..ba3f340d2 100644 --- a/Contractor/EdgeBasedGraphFactory.h +++ b/Contractor/EdgeBasedGraphFactory.h @@ -92,7 +92,6 @@ private: int distance; unsigned edgeBasedNodeID; unsigned nameID; - short type; bool isAccessRestricted:1; bool shortcut:1; bool forward:1; diff --git a/DataStructures/ImportEdge.h b/DataStructures/ImportEdge.h index 823de0744..ab461b65b 100644 --- a/DataStructures/ImportEdge.h +++ b/DataStructures/ImportEdge.h @@ -42,18 +42,16 @@ public: return (source() < e.source()); } - explicit NodeBasedEdge(NodeID s, NodeID t, NodeID n, EdgeWeight w, bool f, bool b, short ty, bool ra, bool ig, bool ar, bool cf, TravelMode mode) : - _source(s), _target(t), _name(n), _weight(w), forward(f), backward(b), _type(ty), _roundabout(ra), _ignoreInGrid(ig), _accessRestricted(ar), _contraFlow(cf), _mode(mode) { if(ty < 0) {ERR("Type: " << ty);}; } + explicit NodeBasedEdge(NodeID s, NodeID t, NodeID n, EdgeWeight w, bool f, bool b, bool ra, bool ig, bool ar, bool cf, TravelMode mode) : + _source(s), _target(t), _name(n), _weight(w), forward(f), backward(b), _roundabout(ra), _ignoreInGrid(ig), _accessRestricted(ar), _contraFlow(cf), _mode(mode) {} NodeID target() const {return _target; } NodeID source() const {return _source; } NodeID name() const { return _name; } EdgeWeight weight() const {return _weight; } - short type() const { assert(_type >= 0); return _type; } bool isBackward() const { return backward; } bool isForward() const { return forward; } - bool isLocatable() const { return _type != 14; } bool isRoundabout() const { return _roundabout; } bool ignoreInGrid() const { return _ignoreInGrid; } bool isAccessRestricted() const { return _accessRestricted; } @@ -66,7 +64,6 @@ public: EdgeWeight _weight; bool forward; bool backward; - short _type; bool _roundabout; bool _ignoreInGrid; bool _accessRestricted; @@ -76,7 +73,7 @@ public: private: /** Default constructor. target and weight are set to 0.*/ NodeBasedEdge() : - _source(0), _target(0), _name(0), _weight(0), forward(0), backward(0), _type(0), _roundabout(false), _ignoreInGrid(false), _accessRestricted(false), _contraFlow(false), _mode(0) { assert(false); } //shall not be used. + _source(0), _target(0), _name(0), _weight(0), forward(0), backward(0), _roundabout(false), _ignoreInGrid(false), _accessRestricted(false), _contraFlow(false), _mode(0) { assert(false); } //shall not be used. }; diff --git a/Extractor/ExtractionContainers.cpp b/Extractor/ExtractionContainers.cpp index 328525cd0..022ca9049 100644 --- a/Extractor/ExtractionContainers.cpp +++ b/Extractor/ExtractionContainers.cpp @@ -250,8 +250,6 @@ void ExtractionContainers::PrepareData(const std::string & outputFileName, const break; } fout.write((char*)&intWeight, sizeof(int)); - assert(edgeIT->type >= 0); - fout.write((char*)&edgeIT->type, sizeof(short)); fout.write((char*)&edgeIT->nameID, sizeof(unsigned)); fout.write((char*)&edgeIT->isRoundabout, sizeof(bool)); fout.write((char*)&edgeIT->ignoreInGrid, sizeof(bool)); diff --git a/Extractor/ExtractorCallbacks.cpp b/Extractor/ExtractorCallbacks.cpp index dcfa2cdbb..09885f824 100644 --- a/Extractor/ExtractorCallbacks.cpp +++ b/Extractor/ExtractorCallbacks.cpp @@ -101,7 +101,6 @@ void ExtractorCallbacks::wayFunction(ExtractionWay &parsed_way) { externalMemory->allEdges.push_back( InternalExtractorEdge(parsed_way.path[n], parsed_way.path[n+1], - parsed_way.type, (split_bidirectional_edge ? ExtractionWay::oneway : parsed_way.direction), parsed_way.speed, parsed_way.nameID, @@ -125,7 +124,6 @@ void ExtractorCallbacks::wayFunction(ExtractionWay &parsed_way) { externalMemory->allEdges.push_back( InternalExtractorEdge(parsed_way.path[n], parsed_way.path[n+1], - parsed_way.type, ExtractionWay::oneway, parsed_way.backward_speed, parsed_way.nameID, diff --git a/Extractor/ExtractorStructs.h b/Extractor/ExtractorStructs.h index eada00662..29f1e9215 100644 --- a/Extractor/ExtractorStructs.h +++ b/Extractor/ExtractorStructs.h @@ -55,7 +55,6 @@ struct ExtractionWay { speed = -1; backward_speed = -1; duration = -1; - type = -1; access = true; roundabout = false; isAccessRestricted = false; @@ -74,7 +73,6 @@ struct ExtractionWay { double speed; double backward_speed; double duration; - short type; bool access; bool roundabout; bool isAccessRestricted; @@ -94,18 +92,13 @@ struct ExtractorRelation { }; struct InternalExtractorEdge { - InternalExtractorEdge() : start(0), target(0), type(0), direction(0), speed(0), nameID(0), isRoundabout(false), ignoreInGrid(false), isDurationSet(false), isAccessRestricted(false), isContraFlow(false), mode(0) {}; - InternalExtractorEdge(NodeID s, NodeID t) : start(s), target(t), type(0), direction(0), speed(0), nameID(0), isRoundabout(false), ignoreInGrid(false), isDurationSet(false), isAccessRestricted(false), isContraFlow(false) { } - InternalExtractorEdge(NodeID s, NodeID t, short tp, short d, double sp): start(s), target(t), type(tp), direction(d), speed(sp), nameID(0), isRoundabout(false), ignoreInGrid(false), isDurationSet(false), isAccessRestricted(false), isContraFlow(false) { } - InternalExtractorEdge(NodeID s, NodeID t, short tp, short d, double sp, unsigned nid, bool isra, bool iing, bool ids, bool iar, TravelMode _mode): start(s), target(t), type(tp), direction(d), speed(sp), nameID(nid), isRoundabout(isra), ignoreInGrid(iing), isDurationSet(ids), isAccessRestricted(iar), isContraFlow(false), mode(_mode) { - assert(0 <= type); - } - InternalExtractorEdge(NodeID s, NodeID t, short tp, short d, double sp, unsigned nid, bool isra, bool iing, bool ids, bool iar, bool icf, TravelMode _mode) : start(s), target(t), type(tp), direction(d), speed(sp), nameID(nid), isRoundabout(isra), ignoreInGrid(iing), isDurationSet(ids), isAccessRestricted(iar), isContraFlow(false), mode(_mode) { - assert(0 <= type); - } + InternalExtractorEdge() : start(0), target(0), direction(0), speed(0), nameID(0), isRoundabout(false), ignoreInGrid(false), isDurationSet(false), isAccessRestricted(false), isContraFlow(false), mode(0) {}; + InternalExtractorEdge(NodeID s, NodeID t) : start(s), target(t), direction(0), speed(0), nameID(0), isRoundabout(false), ignoreInGrid(false), isDurationSet(false), isAccessRestricted(false), isContraFlow(false) {} + InternalExtractorEdge(NodeID s, NodeID t, short d, double sp): start(s), target(t), direction(d), speed(sp), nameID(0), isRoundabout(false), ignoreInGrid(false), isDurationSet(false), isAccessRestricted(false), isContraFlow(false) {} + InternalExtractorEdge(NodeID s, NodeID t, short d, double sp, unsigned nid, bool isra, bool iing, bool ids, bool iar, TravelMode _mode): start(s), target(t), direction(d), speed(sp), nameID(nid), isRoundabout(isra), ignoreInGrid(iing), isDurationSet(ids), isAccessRestricted(iar), isContraFlow(false), mode(_mode) {} + InternalExtractorEdge(NodeID s, NodeID t, short d, double sp, unsigned nid, bool isra, bool iing, bool ids, bool iar, bool icf, TravelMode _mode) : start(s), target(t), direction(d), speed(sp), nameID(nid), isRoundabout(isra), ignoreInGrid(iing), isDurationSet(ids), isAccessRestricted(iar), isContraFlow(false), mode(_mode) {} NodeID start; NodeID target; - short type; short direction; double speed; unsigned nameID; diff --git a/Extractor/ScriptingEnvironment.cpp b/Extractor/ScriptingEnvironment.cpp index 1a9cd6178..eb61827d1 100644 --- a/Extractor/ScriptingEnvironment.cpp +++ b/Extractor/ScriptingEnvironment.cpp @@ -71,7 +71,6 @@ ScriptingEnvironment::ScriptingEnvironment(const char * fileName) { .def_readwrite("speed", &ExtractionWay::speed) .def_readwrite("backward_speed", &ExtractionWay::backward_speed) .def_readwrite("duration", &ExtractionWay::duration) - .def_readwrite("type", &ExtractionWay::type) .def_readwrite("access", &ExtractionWay::access) .def_readwrite("roundabout", &ExtractionWay::roundabout) .def_readwrite("is_access_restricted", &ExtractionWay::isAccessRestricted) diff --git a/Util/GraphLoader.h b/Util/GraphLoader.h index 4b3454c82..292c9ea2d 100644 --- a/Util/GraphLoader.h +++ b/Util/GraphLoader.h @@ -98,7 +98,6 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &in, std::vector& edgeL edgeList.reserve(m); EdgeWeight weight; - short type; NodeID nameID; int length; bool isRoundabout, ignoreInGrid, isAccessRestricted, isContraFlow; @@ -110,7 +109,6 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &in, std::vector& edgeL in.read((char*)&length, sizeof(int)); in.read((char*)&dir, sizeof(short)); in.read((char*)&weight, sizeof(int)); - in.read((char*)&type, sizeof(short)); in.read((char*)&nameID, sizeof(unsigned)); in.read((char*)&isRoundabout, sizeof(bool)); in.read((char*)&ignoreInGrid, sizeof(bool)); @@ -152,8 +150,9 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &in, std::vector& edgeL std::swap(source, target); std::swap(forward, backward); } - - EdgeT inputEdge(source, target, nameID, weight, forward, backward, type, isRoundabout, ignoreInGrid, isAccessRestricted, isContraFlow, mode ); + + INFO( "inputEdge" ); + EdgeT inputEdge(source, target, nameID, weight, forward, backward, isRoundabout, ignoreInGrid, isAccessRestricted, isContraFlow, mode ); edgeList.push_back(inputEdge); } std::sort(edgeList.begin(), edgeList.end()); @@ -213,7 +212,6 @@ NodeID readDTMPGraphFromStream(std::istream &in, std::vector& edgeList, s for (EdgeID i=0; i> source >> target >> length >> dir >> speedType; @@ -297,7 +295,7 @@ NodeID readDTMPGraphFromStream(std::istream &in, std::vector& edgeList, s if(source == UINT_MAX || target == UINT_MAX) { ERR("nonexisting source or target" ); } - EdgeT inputEdge(source, target, 0, weight, forward, backward, type ); + EdgeT inputEdge(source, target, 0, weight, forward, backward ); edgeList.push_back(inputEdge); } ext2IntNodeMap.clear(); diff --git a/profile.lua b/profile.lua index 33a7247d6..2089ed268 100644 --- a/profile.lua +++ b/profile.lua @@ -206,7 +206,6 @@ function way_function (way) if ignore_in_grid[highway] ~= nil and ignore_in_grid[highway] then way.ignore_in_grid = true end - way.type = 1 return 1 end diff --git a/profiles/bicycle.lua b/profiles/bicycle.lua index 609e5ae91..f41020bf6 100644 --- a/profiles/bicycle.lua +++ b/profiles/bicycle.lua @@ -358,7 +358,6 @@ function way_function (way) way.backward_speed = maxspeed_backward end - way.type = 1 return 1 end diff --git a/profiles/car.lua b/profiles/car.lua index 7a6999d3e..a12e04357 100644 --- a/profiles/car.lua +++ b/profiles/car.lua @@ -206,7 +206,6 @@ function way_function (way) if ignore_in_grid[highway] ~= nil and ignore_in_grid[highway] then way.ignore_in_grid = true end - way.type = 1 return 1 end diff --git a/profiles/foot.lua b/profiles/foot.lua index 6a15fb2ea..9d1229305 100644 --- a/profiles/foot.lua +++ b/profiles/foot.lua @@ -188,6 +188,5 @@ function way_function (way) if ignore_in_grid[highway] ~= nil and ignore_in_grid[highway] then way.ignore_in_grid = true end - way.type = 1 return 1 end diff --git a/profiles/testbot.lua b/profiles/testbot.lua index d3fd6d4ea..df1d8481b 100644 --- a/profiles/testbot.lua +++ b/profiles/testbot.lua @@ -122,6 +122,5 @@ function way_function (way) way.direction = Way.bidirectional end - way.type = 1 return 1 end