60 #ifdef CHECK_MEMORY_LEAKS 62 #endif // CHECK_MEMORY_LEAKS 113 importer.
load(oc, nb);
126 for (std::map<long long int, Edge*>::iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
135 if (!oc.
isSet(
"osm-files")) {
143 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
146 WRITE_ERROR(
"Could not open osm-file '" + *file +
"'.");
149 nodesHandler.setFileName(*file);
158 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
167 if (!oc.
getBool(
"osm.skip-duplicates-check")) {
170 std::set<const Edge*, CompareEdges> dupsFinder;
171 for (std::map<long long int, Edge*>::iterator it =
myEdges.begin(); it !=
myEdges.end();) {
172 if (dupsFinder.count(it->second) > 0) {
177 dupsFinder.insert(it->second);
188 std::map<long long int, int> nodeUsage;
190 for (std::map<long long int, Edge*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
191 Edge* e = (*i).second;
194 if (nodeUsage.find(*j) == nodeUsage.end()) {
197 nodeUsage[*j] = nodeUsage[*j] + 1;
201 for (std::map<long long int, NIOSMNode*>::const_iterator nodesIt =
myOSMNodes.begin(); nodesIt !=
myOSMNodes.end(); ++nodesIt) {
202 if (nodesIt->second->tlsControlled ) {
205 nodeUsage[nodesIt->first] += 1;
214 for (std::map<long long int, Edge*>::iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
215 Edge* e = (*i).second;
228 std::vector<long long int> passed;
230 passed.push_back(*j);
233 running =
insertEdge(e, running, currentFrom, currentTo, passed, nb);
234 currentFrom = currentTo;
241 insertEdge(e, running, currentFrom, last, passed, nb);
245 if (layerElevation > 0) {
252 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
287 if (!tlsc.
insert(tlDef)) {
300 const std::vector<long long int>& passed,
NBNetBuilder& nb) {
307 if (from == 0 || to == 0) {
308 WRITE_ERROR(
"Discarding edge '" +
id +
"' because the nodes could not be built.");
317 assert(passed.size() >= 2);
318 if (passed.size() == 2) {
319 WRITE_WARNING(
"Discarding edge '" +
id +
"' which connects two identical nodes without geometry.");
323 int intermediateIndex = (int)passed.size() / 2;
325 std::vector<long long int> part1(passed.begin(), passed.begin() + intermediateIndex);
326 std::vector<long long int> part2(passed.begin() + intermediateIndex + 1, passed.end());
327 index =
insertEdge(e, index, from, intermediate, part1, nb);
328 return insertEdge(e, index, intermediate, to, part2, nb);
330 const int newIndex = index + 1;
335 for (std::vector<long long int>::const_iterator i = passed.begin(); i != passed.end(); ++i) {
339 WRITE_ERROR(
"Unable to project coordinates for edge '" +
id +
"'.");
346 if (!tc.
knows(type)) {
354 std::vector<std::string> types;
356 std::string t = tok.
next();
358 if (std::find(types.begin(), types.end(), t) == types.end()) {
361 }
else if (tok.
size() > 1) {
362 WRITE_WARNING(
"Discarding unknown compound '" + t +
"' in type '" + type +
"' (first occurence for edge '" +
id +
"').");
365 if (types.size() == 0) {
366 WRITE_WARNING(
"Discarding unusable type '" + type +
"' (first occurence for edge '" +
id +
"').");
371 if (tc.
knows(newType)) {
384 bool defaultIsOneWay =
false;
387 for (std::vector<std::string>::iterator it = types.begin(); it != types.end(); it++) {
404 WRITE_WARNING(
"Discarding compound type '" + newType +
"' (first occurence for edge '" +
id +
"').");
408 WRITE_MESSAGE(
"Adding new type '" + type +
"' (first occurence for edge '" +
id +
"').");
409 tc.
insert(newType, numLanes, maxSpeed, prio, permissions, width, defaultIsOneWay, sidewalkWidth, bikelaneWidth);
410 for (std::vector<std::string>::iterator it = types.begin(); it != types.end(); it++) {
436 bool addForward =
true;
437 bool addBackward =
true;
451 if (addForward && !addBackward) {
453 }
else if (!addForward && addBackward) {
461 numLanesForward = (int)std::ceil(e->
myNoLanes / 2.0);
463 numLanesBackward = e->
myNoLanes - numLanesForward;
466 numLanesForward =
MAX2(1, numLanesForward);
467 numLanesBackward =
MAX2(1, numLanesBackward);
470 WRITE_WARNING(
"Skipping edge '" +
id +
"' because it has zero lanes.");
495 numLanesBackward = 1;
509 numLanesBackward = 1;
516 assert(numLanesForward > 0);
536 assert(numLanesBackward > 0);
552 throw ProcessError(
"Could not add edge '-" +
id +
"'.");
564 std::map<long long int, NIOSMNode*>& toFill,
565 std::set<NIOSMNode*, CompareNodes>& uniqueNodes,
566 bool importElevation) :
570 myIsInValidNodeTag(false),
573 myImportElevation(importElevation) {
591 if (action ==
"delete") {
625 std::set<NIOSMNode*, CompareNodes>::iterator similarNode =
myUniqueNodes.find(toAdd);
630 toAdd = *similarNode;
638 WRITE_ERROR(
"Tag element on wrong XML hierarchy level.");
644 if (key ==
"highway" || key ==
"ele" || key ==
"crossing" || key ==
"railway") {
646 if (key ==
"highway" && value.find(
"traffic_signal") != std::string::npos) {
648 }
else if (key ==
"crossing" && value.find(
"traffic_signals") != std::string::npos) {
650 }
else if (key ==
"railway" && value.find(
"crossing") != std::string::npos) {
656 WRITE_WARNING(
"Value of key '" + key +
"' is not numeric ('" + value +
"') in node '" +
679 const std::map<long long int, NIOSMNode*>& osmNodes,
680 std::map<long long int, Edge*>& toFill) :
708 if (action ==
"delete") {
723 std::map<long long int, NIOSMNode*>::const_iterator node =
myOSMNodes.find(ref);
728 ref = node->second->id;
745 const std::string cyclewaySpec = key.substr(9);
747 if (cyclewaySpec ==
"right") {
749 }
else if (cyclewaySpec ==
"left") {
751 }
else if (cyclewaySpec ==
"both") {
762 const std::string buswaySpec = key.substr(7);
764 if (buswaySpec ==
"right") {
766 }
else if (buswaySpec ==
"left") {
768 }
else if (buswaySpec ==
"both") {
781 if (key ==
"highway" || key ==
"railway" || key ==
"waterway" || key ==
"cycleway" || key ==
"busway" || key ==
"route") {
784 if (key ==
"cycleway") {
787 }
else if (value ==
"opposite_track") {
789 }
else if (value ==
"opposite_lane") {
794 if (key ==
"busway") {
797 }
else if (value ==
"opposite_track") {
799 }
else if (value ==
"opposite_lane") {
806 const std::string singleTypeID = key +
"." + value;
811 types.push_back(singleTypeID);
816 }
else if (key ==
"lanes") {
822 std::vector<std::string> list = st.
getVector();
823 if (list.size() >= 2) {
826 for (std::vector<std::string>::iterator i = list.begin(); i != list.end(); ++i) {
828 minLanes =
MIN2(minLanes, numLanes);
833 WRITE_WARNING(
"Value of key '" + key +
"' is not numeric ('" + value +
"') in edge '" +
838 WRITE_WARNING(
"Value of key '" + key +
"' is not numeric ('" + value +
"') in edge '" +
841 }
else if (key ==
"lanes:forward") {
845 WRITE_WARNING(
"Value of key '" + key +
"' is not numeric ('" + value +
"') in edge '" +
848 }
else if (key ==
"lanes:backward") {
853 WRITE_WARNING(
"Value of key '" + key +
"' is not numeric ('" + value +
"') in edge '" +
856 }
else if (key ==
"maxspeed") {
865 conversion = 1.609344;
870 WRITE_WARNING(
"Value of key '" + key +
"' is not numeric ('" + value +
"') in edge '" +
874 }
else if (key ==
"junction") {
878 }
else if (key ==
"oneway") {
880 }
else if (key ==
"name") {
882 }
else if (key ==
"layer") {
886 WRITE_WARNING(
"Value of key '" + key +
"' is not numeric ('" + value +
"') in edge '" +
889 }
else if (key ==
"tracks") {
897 WRITE_WARNING(
"Value of key '" + key +
"' is not numeric ('" + value +
"') in edge '" +
923 const std::map<long long int, NIOSMNode*>& osmNodes,
924 const std::map<long long int, Edge*>& osmEdges) :
927 myOSMEdges(osmEdges) {
955 if (action ==
"delete" || !ok) {
972 }
else if (memberType ==
"node") {
991 if (key ==
"type" || key ==
"restriction") {
993 if (key ==
"type" && value ==
"restriction") {
997 if (key ==
"restriction") {
1000 if (value.substr(0, 5) ==
"only_") {
1002 }
else if (value.substr(0, 3) ==
"no_") {
1070 WRITE_WARNING(
"from-edge of restriction relation could not be determined");
1074 WRITE_WARNING(
"to-edge of restriction relation could not be determined");
1084 WRITE_WARNING(
"direction of restriction relation could not be determined");
1093 const std::string prefix =
toString(wayRef);
1094 const std::string backPrefix =
"-" + prefix;
1097 for (EdgeVector::const_iterator it = candidates.begin(); it != candidates.end(); ++it) {
1098 if (((*it)->getID().substr(0, prefix.size()) == prefix) ||
1099 ((*it)->getID().substr(0, backPrefix.size()) == backPrefix)) {
1105 WRITE_WARNING(
"Ambigous way reference '" + prefix +
"' in restriction relation");
1119 std::map<NBNode*, std::vector<std::pair<SUMOReal, SUMOReal> > > layerForces;
1122 std::set<NBNode*> knownElevation;
1123 for (std::map<long long int, Edge*>::iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
1124 Edge* e = (*i).second;
1129 knownElevation.insert(node);
1135 #ifdef DEBUG_LAYER_ELEVATION 1136 std::cout <<
"known elevations:\n";
1137 for (std::set<NBNode*>::iterator it = knownElevation.begin(); it != knownElevation.end(); ++it) {
1138 const std::vector<std::pair<SUMOReal, SUMOReal> >& primaryLayers = layerForces[*it];
1139 std::cout <<
" node=" << (*it)->
getID() <<
" ele=";
1140 for (std::vector<std::pair<SUMOReal, SUMOReal> >::const_iterator it_ele = primaryLayers.begin(); it_ele != primaryLayers.end(); ++it_ele) {
1141 std::cout << it_ele->first <<
" ";
1147 std::set<NBNode*> unknownElevation;
1148 for (std::set<NBNode*>::iterator it = knownElevation.begin(); it != knownElevation.end(); ++it) {
1151 const std::vector<std::pair<SUMOReal, SUMOReal> >& primaryLayers = layerForces[*it];
1152 for (std::vector<std::pair<SUMOReal, SUMOReal> >::const_iterator it_ele = primaryLayers.begin(); it_ele != primaryLayers.end(); ++it_ele) {
1153 eleMax =
MAX2(eleMax, it_ele->first);
1154 eleSum += it_ele->first;
1156 const SUMOReal eleAvg = eleSum / primaryLayers.size();
1157 const SUMOReal maxDist = fabs(eleMax) * 100 / layerElevation;
1159 for (std::map<NBNode*, SUMOReal>::iterator it_neigh = neighbors.begin(); it_neigh != neighbors.end(); ++it_neigh) {
1160 unknownElevation.insert(it_neigh->first);
1161 layerForces[it_neigh->first].push_back(std::make_pair(eleAvg, it_neigh->second));
1166 for (std::set<NBNode*>::iterator it = unknownElevation.begin(); it != unknownElevation.end(); ++it) {
1168 const std::vector<std::pair<SUMOReal, SUMOReal> >& primaryLayers = layerForces[*it];
1169 for (std::vector<std::pair<SUMOReal, SUMOReal> >::const_iterator it_ele = primaryLayers.begin(); it_ele != primaryLayers.end(); ++it_ele) {
1170 eleMax =
MAX2(eleMax, it_ele->first);
1172 const SUMOReal maxDist = fabs(eleMax) * 100 / layerElevation;
1174 for (std::map<NBNode*, SUMOReal>::iterator it_neigh = neighbors.begin(); it_neigh != neighbors.end(); ++it_neigh) {
1175 if (knownElevation.count(it_neigh->first) == 0 && unknownElevation.count(it_neigh->first) == 0) {
1176 layerForces[*it].push_back(std::make_pair(0, it_neigh->second));
1181 #ifdef DEBUG_LAYER_ELEVATION 1182 std::cout <<
"summation of forces\n";
1184 std::map<NBNode*, SUMOReal> nodeElevation;
1185 for (std::map<
NBNode*, std::vector<std::pair<SUMOReal, SUMOReal> > >::iterator it = layerForces.begin(); it != layerForces.end(); ++it) {
1186 const std::vector<std::pair<SUMOReal, SUMOReal> >& forces = it->second;
1187 if (forces.size() == 1) {
1188 nodeElevation[it->first] = forces.front().first;
1189 }
else if (knownElevation.count(it->first) != 0) {
1192 for (std::vector<std::pair<SUMOReal, SUMOReal> >::const_iterator it_force = forces.begin(); it_force != forces.end(); ++it_force) {
1193 eleMax =
MAX2(eleMax, it_force->first);
1195 nodeElevation[it->first] = eleMax;
1199 for (std::vector<std::pair<SUMOReal, SUMOReal> >::const_iterator it_force = forces.begin(); it_force != forces.end(); ++it_force) {
1200 distSum += it_force->second;
1204 #ifdef DEBUG_LAYER_ELEVATION 1205 std::cout <<
" node=" << it->first->getID() <<
" distSum=" << distSum <<
"\n";
1207 for (std::vector<std::pair<SUMOReal, SUMOReal> >::const_iterator it_force = forces.begin(); it_force != forces.end(); ++it_force) {
1208 const SUMOReal weight = (distSum - it_force->second) / distSum;
1209 weightSum += weight;
1210 elevation += it_force->first * weight;
1212 #ifdef DEBUG_LAYER_ELEVATION 1213 std::cout <<
" force=" << it_force->first <<
" dist=" << it_force->second <<
" weight=" << weight <<
" ele=" << elevation <<
"\n";
1216 nodeElevation[it->first] = elevation / weightSum;
1219 #ifdef DEBUG_LAYER_ELEVATION 1220 std::cout <<
"final elevations:\n";
1221 for (std::map<NBNode*, SUMOReal>::iterator it = nodeElevation.begin(); it != nodeElevation.end(); ++it) {
1222 std::cout <<
" node=" << (it->first)->getID() <<
" ele=" << it->second <<
"\n";;
1226 for (std::map<NBNode*, SUMOReal>::iterator it = nodeElevation.begin(); it != nodeElevation.end(); ++it) {
1233 for (std::map<std::string, NBEdge*>::const_iterator it = ec.
begin(); it != ec.
end(); ++it) {
1234 NBEdge* edge = it->second;
1243 for (PositionVector::const_iterator it_pos = geom.begin(); it_pos != geom.end(); ++it_pos) {
1244 if (it_pos != geom.begin()) {
1245 dist += (*it_pos).distanceTo2D(*(it_pos - 1));
1247 newGeom.push_back((*it_pos) +
Position(0, 0, zFrom + (zTo - zFrom) * dist / length));
1254 std::map<NBNode*, SUMOReal>
1256 std::map<NBNode*, SUMOReal> result;
1257 std::set<NBNode*> visited;
1258 std::vector<NBNode*> open;
1259 open.push_back(node);
1260 while (open.size() > 0) {
1263 if (visited.count(n) != 0) {
1268 for (EdgeVector::const_iterator j = edges.begin(); j != edges.end(); ++j) {
1277 if (result.count(s) == 0) {
1280 result[s] =
MIN2(dist, result[s]);
1282 if (dist < maxDist) {
const std::map< long long int, NIOSMNode * > & myOSMNodes
The previously parsed nodes.
const SUMOReal lat
The latitude the node is located at.
void reconstructLayerElevation(SUMOReal layerElevation, NBNetBuilder &nb)
reconstruct elevation from layer info
An internal definition of a loaded edge.
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
SUMOReal getSpeed(const std::string &type) const
Returns the maximal velocity for the given type [m/s].
const bool myImportElevation
whether elevation data should be imported
const std::map< long long int, Edge * > & myOSMEdges
The previously parsed edges.
The only invalid connection is declared.
An internal representation of an OSM-node.
const long long int id
The edge's id.
SUMOReal getBikeLaneWidth(const std::string &type) const
Returns the lane width for a bike lane to be added [m].
static const SUMOReal UNSPECIFIED_WIDTH
unspecified lane width
std::string streetName
The edge's street name.
NBTypeCont & getTypeCont()
Returns the type container.
RestrictionType myRestrictionType
const SUMOReal SUMO_const_laneWidth
const std::map< long long int, NIOSMNode * > & myOSMNodes
The previously parsed nodes.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
static bool transformCoordinates(Position &from, bool includeInBoundary=true, GeoConvHelper *from_srs=0)
transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height...
SUMOReal getWidth(const std::string &type) const
Returns the lane width for the given type [m].
const long long int id
The node's id.
static bool isReadable(std::string path)
Checks whether the given file is readable.
The only valid connection is declared.
static bool endsWith(const std::string &str, const std::string suffix)
Checks whether a given string ends with the suffix.
WayType myBuswayType
Information about the kind of busway along this road.
static SUMOReal _2SUMOReal(const E *const data)
converts a char-type array into the SUMOReal value described by it
The relation tag was missing.
long long int myFromWay
the origination way for the current restriction
A container for traffic light definitions and built programs.
void reinit(const Position &position, SumoXMLNodeType type, bool updateEdgeGeometries=false)
Resets initial values.
~RelationHandler()
Destructor.
EdgesHandler(const std::map< long long int, NIOSMNode *> &osmNodes, std::map< long long int, Edge *> &toFill)
Constructor.
void addSidewalk(SUMOReal width)
add a pedestrian sidewalk of the given width and shift existing connctions
NIImporter_OpenStreetMap()
void myEndElement(int element)
Called when a closing tag occurs.
The representation of a single edge during network building.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
static std::string escapeXML(const std::string &orig)
Replaces the standard escapes by their XML entities.
int getPriority(const std::string &type) const
Returns the priority for the given type.
long long int myCurrentRelation
The currently parsed relation.
bool checkEdgeRef(long long int ref) const
check whether a referenced way has a corresponding edge
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given ...
PositionVector reverse() const
reverse position vector
int getNumLanes(const std::string &type) const
Returns the number of lanes for the given type.
bool getShallBeDiscarded(const std::string &type) const
Returns the information whether edges of this type shall be discarded.
std::map< std::string, NBEdge * >::const_iterator end() const
Returns the pointer to the end of the stored edges.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
void myEndElement(int element)
Called when a closing tag occurs.
const std::string & getID() const
Returns the id.
static const SUMOReal UNSPECIFIED_OFFSET
unspecified lane offset
SAX-handler base for SUMO-files.
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything's ok.
std::vector< long long int > myCurrentNodes
The list of nodes this edge is made of.
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
#define WRITE_WARNING(msg)
std::string joinToStringSorting(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
static OptionsCont & getOptions()
Retrieves the options.
std::map< NBNode *, SUMOReal > getNeighboringNodes(NBNode *node, SUMOReal maxDist)
collect neighboring nodes with their road distance
SUMOReal ele
The elevation of this node.
std::set< NIOSMNode *, CompareNodes > & myUniqueNodes
the set of unique nodes (used for duplicate detection/substitution)
NBNode * node
the NBNode that was instantiated
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges.
static const SUMOReal MAXSPEED_UNGIVEN
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given OSM file.
Functor which compares two Edges.
WayType myCyclewayType
Information about the kind of cycleway along this road.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
int myNoLanesForward
number of lanes in forward direction or 0 if unknown, negative if backwards lanes are meant ...
~EdgesHandler()
Destructor.
bool addEdge2EdgeConnection(NBEdge *dest)
Adds a connection to another edge.
NBEdge * findEdgeRef(long long int wayRef, const std::vector< NBEdge *> &candidates) const
try to find the way segment among candidates
bool knows(const std::string &type) const
Returns whether the named type is in the container.
void load(const OptionsCont &oc, NBNetBuilder &nb)
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.
void setFileName(const std::string &name)
Sets the current file name.
std::map< std::string, NBEdge * >::const_iterator begin() const
Returns the pointer to the begin of the stored edges.
A class which extracts OSM-edges from a parsed OSM-file.
int insertEdge(Edge *e, int index, NBNode *from, NBNode *to, const std::vector< long long int > &passed, NBNetBuilder &nb)
Builds an NBEdge.
bool insert(NBEdge *edge, bool ignorePrunning=false)
Adds an edge to the dictionary.
std::vector< int > myParentElements
The element stack.
Encapsulated SAX-Attributes.
static StringBijection< TrafficLightType > TrafficLightTypes
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
A point in 2D or 3D with translation and scaling methods.
NBEdgeCont & getEdgeCont()
Returns the edge container.
T get(const std::string &str) const
RelationHandler(const std::map< long long int, NIOSMNode *> &osmNodes, const std::map< long long int, Edge *> &osmEdges)
Constructor.
const EdgeVector & getEdges() const
Returns all edges which participate in this node.
void myEndElement(int element)
Called when a closing tag occurs.
Storage for edges, including some functionality operating on multiple edges.
std::vector< std::string > getStringVector(const std::string &name) const
Returns the list of string-vector-value of the named option (only for Option_String) ...
#define PROGRESS_BEGIN_MESSAGE(msg)
bool operator()(const Edge *e1, const Edge *e2) const
SUMOReal length2D() const
Returns the length.
long long int myLastNodeID
ID of the currently parsed node, for reporting mainly.
std::map< long long int, NIOSMNode * > & myToFill
The nodes container to fill.
bool myIsRestriction
whether the currently parsed relation is a restriction
~NIImporter_OpenStreetMap()
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false)
Removes the specified connection(s)
bool railwayCrossing
Whether this is a railway crossing.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
double myMaxSpeed
maximum speed in km/h, or MAXSPEED_UNGIVEN
bool hasIncoming(const NBEdge *const e) const
Returns whether the given edge ends at this node.
void insert(const std::string &id, int numLanes, SUMOReal maxSpeed, int prio, SVCPermissions permissions, SUMOReal width, bool oneWayIsDefault, SUMOReal sidewalkWidth, SUMOReal bikeLaneWidth)
Adds a type into the list.
bool myIsInValidNodeTag
Hierarchy helper for parsing a node's tags.
std::map< long long int, Edge * > myEdges
the map from OSM way ids to edge objects
std::vector< std::string > getVector()
const PositionVector & getGeometry() const
Returns the geometry of the edge.
int myNoLanes
number of lanes, or -1 if unknown
void addBikeLane(SUMOReal width)
add a bicycle lane of the given width and shift existing connctions
static std::string to_lower_case(std::string str)
Transfers the content to lower case.
static int _2int(const E *const data)
converts a char-type array into the integer value described by it
bool tlsControlled
Whether this is a tls controlled junction.
std::map< std::string, std::string > myKnownCompoundTypes
The compound types that have already been mapped to other known types.
static std::string prune(const std::string &str)
Removes trailing and leading whitechars.
std::map< long long int, Edge * > & myEdgeMap
A map of built edges.
const SUMOReal lon
The longitude the node is located at.
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges.
NBNodeCont & getNodeCont()
Returns the node container.
long long int myToWay
the destination way for the current restriction
int myLayer
Information about the relative z-ordering of ways.
Instance responsible for building networks.
std::vector< NBEdge * > EdgeVector
SUMOReal getSidewalkWidth(const std::string &type) const
Returns the lane width for a sidewalk to be added [m].
static const std::string compoundTypeSeparator
The separator within newly created compound type names.
std::map< std::string, SUMOReal > mySpeedMap
A map of non-numeric speed descriptions to their numeric values.
virtual std::string getStringSecure(int id, const std::string &def) const =0
Returns the string-value of the named (by its enum-value) attribute.
A storage for options typed value containers)
long long int myViaNode
the via node/way for the current restriction
bool copyRestrictionsAndAttrs(const std::string &fromId, const std::string &toId)
Copy restrictions to a type.
SumoXMLNodeType getType() const
Returns the type of this node.
bool insert(const std::string &id, const Position &position, NBDistrict *district=0)
Inserts a node into the map.
NBTrafficLightLogicCont & getTLLogicCont()
Returns the traffic light logics container.
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
A class which extracts OSM-nodes from a parsed OSM-file.
const Position & getPosition() const
Returns the position of this node.
Represents a single node (junction) during network building.
void resetValues()
reset members to their defaults for parsing a new relation
NBNode * insertNodeChecking(long long int id, NBNodeCont &nc, NBTrafficLightLogicCont &tlsc)
Builds an NBNode.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
int myHierarchyLevel
The current hierarchy level.
std::string myHighWayType
The type, stored in "highway" key.
bool insert(NBTrafficLightDefinition *logic, bool forceInsert=false)
Adds a logic definition to the dictionary.
Importer for networks stored in OpenStreetMap format.
static const long long int INVALID_ID
bool myCurrentIsRoad
Information whether this is a road.
Edge * myCurrentEdge
The currently built edge.
std::set< std::string > myUnusableTypes
The compounds types that do not contain known types.
void push_back_noDoublePos(const Position &p)
insert in back a non double position
~NodesHandler()
Destructor.
NBNode * getFromNode() const
Returns the origin node of the edge.
Container for nodes during the netbuilding process.
#define PROGRESS_DONE_MESSAGE()
std::map< long long int, NIOSMNode * > myOSMNodes
the map from OSM node ids to actual nodes
A traffic light logics which must be computed (only nodes/edges are given)
std::vector< int > myParentElements
The element stack.
bool getIsOneWay(const std::string &type) const
Returns whether edges are one-way per default for the given type.
#define WRITE_MESSAGE(msg)
std::set< NIOSMNode *, CompareNodes > myUniqueNodes
the set of unique nodes used in NodesHandler, used when freeing memory
NodesHandler(std::map< long long int, NIOSMNode *> &toFill, std::set< NIOSMNode *, CompareNodes > &uniqueNodes, bool importElevation)
Contructor.
NBNode * getToNode() const
Returns the destination node of the edge.
bool applyRestriction() const
try to apply the parsed restriction and return whether successful
A class which extracts relevant relation information from a parsed OSM-file.
std::string myIsOneWay
Information whether this is an one-way road.
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
SVCPermissions getPermissions(const std::string &type) const
Returns allowed vehicle classes for the given type.
A storage for available types of edges.