23 #ifndef NIImporter_OpenStreetMap_h
24 #define NIImporter_OpenStreetMap_h
219 std::set<NIOSMNode*, CompareNodes>& uniqueNodes);
290 EdgesHandler(
const std::map<SUMOLong, NIOSMNode*>& osmNodes,
291 std::map<SUMOLong, Edge*>& toFill);
360 const std::map<SUMOLong, Edge*>& osmEdges);
An internal definition of a loaded edge.
double lon
The longitude the node is located at.
const std::map< SUMOLong, NIOSMNode * > & myOSMNodes
The previously parsed nodes.
The only invalid connection is declared.
An internal representation of an OSM-node.
double lat
The latitude the node is located at.
std::string streetName
The edge's street name.
RestrictionType myRestrictionType
std::map< SUMOLong, Edge * > myEdges
the map from OSM way ids to edge objects
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
The only valid connection is declared.
std::map< SUMOLong, Edge * > & myEdgeMap
A map of built edges.
The relation tag was missing.
A container for traffic light definitions and built programs.
~RelationHandler()
Destructor.
bool applyRestriction() const
try to apply the parsed restriction and return whether successful
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;.
SUMOLong id
The edge's id.
NodesHandler & operator=(const NodesHandler &s)
invalidated assignment operator
SUMOLong myCurrentRelation
The currently parsed relation.
EdgesHandler & operator=(const EdgesHandler &s)
invalidated assignment operator
void myEndElement(int element)
Called when a closing tag occurs.
NBNode * insertNodeChecking(SUMOLong id, NBNodeCont &nc, NBTrafficLightLogicCont &tlsc)
Builds an NBNode.
SAX-handler base for SUMO-files.
SUMOLong myViaNode
the via node/way for the current restriction
NodesHandler(std::map< SUMOLong, NIOSMNode * > &toFill, std::set< NIOSMNode *, CompareNodes > &uniqueNodes)
Contructor.
RestrictionType
whether the only allowed or the only forbidden connection is defined
std::set< NIOSMNode *, CompareNodes > & myUniqueNodes
the set of unique nodes (used for duplicate detection/substitution)
NBNode * node
the NBNode that was instantiated
NIOSMNode(SUMOLong _id, double _lon, double _lat)
const std::map< SUMOLong, Edge * > & myOSMEdges
The previously parsed edges.
static const SUMOReal MAXSPEED_UNGIVEN
std::vector< SUMOLong > myCurrentNodes
The list of nodes this edge is made of.
SUMOLong myToWay
the destination way for the current restriction
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given OSM file.
Functor which compares two Edges.
RelationHandler & operator=(const RelationHandler &s)
invalidated assignment operator
int myNoLanesForward
number of lanes in forward direction or 0 if unknown, negative if backwards lanes are meant ...
~EdgesHandler()
Destructor.
void load(const OptionsCont &oc, NBNetBuilder &nb)
A class which extracts OSM-edges from a parsed OSM-file.
std::vector< int > myParentElements
The element stack.
Encapsulated SAX-Attributes.
SUMOLong myFromWay
the origination way for the current restriction
SUMOLong id
The node's id.
void myEndElement(int element)
Called when a closing tag occurs.
Storage for edges, including some functionality operating on multiple edges.
bool operator()(const NIOSMNode *n1, const NIOSMNode *n2) const
bool myIsRestriction
whether the currently parsed relation is a restriction
~NIImporter_OpenStreetMap()
std::map< SUMOLong, NIOSMNode * > & myToFill
The nodes container to fill.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
double myMaxSpeed
maximum speed in km/h, or MAXSPEED_UNGIVEN
NBEdge * findEdgeRef(SUMOLong wayRef, const std::vector< NBEdge * > &candidates) const
try to find the way segment among candidates
bool myIsInValidNodeTag
Hierarchy helper for parsing a node's tags.
int myNoLanes
number of lanes, or -1 if unknown
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.
EdgesHandler(const std::map< SUMOLong, NIOSMNode * > &osmNodes, std::map< SUMOLong, Edge * > &toFill)
Constructor.
Instance responsible for building networks.
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.
RelationHandler(const std::map< SUMOLong, NIOSMNode * > &osmNodes, const std::map< SUMOLong, Edge * > &osmEdges)
Constructor.
A storage for options typed value containers)
const std::map< SUMOLong, NIOSMNode * > & myOSMNodes
The previously parsed nodes.
A class which extracts OSM-nodes from a parsed OSM-file.
Represents a single node (junction) during network building.
void resetValues()
reset members to their defaults for parsing a new relation
bool checkEdgeRef(SUMOLong ref) const
check whether a referenced way has a corresponding edge
int myHierarchyLevel
The current hierarchy level.
std::string myHighWayType
The type, stored in "highway" key.
Importer for networks stored in OpenStreetMap format.
int insertEdge(Edge *e, int index, NBNode *from, NBNode *to, const std::vector< SUMOLong > &passed, NBNetBuilder &nb)
Builds an NBEdge.
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.
~NodesHandler()
Destructor.
Container for nodes during the netbuilding process.
std::vector< int > myParentElements
The element stack.
std::map< SUMOLong, NIOSMNode * > myOSMNodes
the map from OSM node ids to actual nodes
Functor which compares two NIOSMNodes according to their coordinates.
std::set< NIOSMNode *, CompareNodes > myUniqueNodes
the set of unique nodes used in NodesHandler, used when freeing memory
static const SUMOLong INVALID_ID
A class which extracts relevant relation information from a parsed OSM-file.
std::string myIsOneWay
Information whether this is an one-way road.
SUMOLong myLastNodeID
ID of the currently parsed node, for reporting mainly.
A storage for available types of edges.