 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
20 #ifndef NIImporter_OpenStreetMap_h
21 #define NIImporter_OpenStreetMap_h
77 NIOSMNode(
long long int _id,
double _lon,
double _lat)
90 const long long int id;
161 explicit Edge(
long long int _id)
177 const long long int id;
295 const std::vector<long long int>& passed,
NBNetBuilder& nb);
301 std::map<NBNode*, std::pair<double, double> >
407 EdgesHandler(
const std::map<long long int, NIOSMNode*>& osmNodes,
408 std::map<long long int, Edge*>& toFill, std::map<long long int, Edge*>& platformShapes);
483 const std::map<long long int, Edge*>& osmEdges,
NBPTStopCont* nbptStopCont,
484 const std::map<long long int, Edge*>& platfromShapes,
NBPTLineCont* nbptLineCont,
578 NBEdge*
findEdgeRef(
long long int wayRef,
const std::vector<NBEdge*>& candidates)
const;
std::string name
The name of the node.
std::string myIsOneWay
Information whether this is an one-way road.
NBPTStopCont * myNBPTStopCont
The previously filled pt stop container.
RelationHandler & operator=(const RelationHandler &s)
invalidated assignment operator
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
bool myIsInValidNodeTag
Hierarchy helper for parsing a node's tags.
std::map< std::string, std::string > myKnownCompoundTypes
The compound types that have already been mapped to other known types.
NBNode * insertNodeChecking(long long int id, NBNodeCont &nc, NBTrafficLightLogicCont &tlsc)
Builds an NBNode.
NIOSMNode(long long int _id, double _lon, double _lat)
An internal representation of an OSM-node.
const std::map< long long int, NIOSMNode * > & myOSMNodes
The previously parsed nodes.
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given OSM file.
std::string myName
name of the relation
An upper class for objects with additional parameters.
double ele
The elevation of this node.
const long long int id
The edge's id.
WayType myBuswayType
Information about the kind of busway along this road.
Storage for edges, including some functionality operating on multiple edges.
double ptStopLength
The length of the pt stop.
std::string myNightService
night service information of the pt line
SAX-handler base for SUMO-files.
Instance responsible for building networks.
A container for traffic light definitions and built programs.
std::string myRef
ref of the pt line
std::vector< NIIPTPlatform > myPlatforms
bus stop platforms
Functor which compares two NIOSMNodes according to their coordinates.
@ RESTRICTION_ONLY
The only valid connection is declared.
bool myCurrentIsElectrified
Information whether this is railway is electrified.
bool railwayCrossing
Whether this is a railway crossing.
~RelationHandler() override
Destructor.
void resetValues()
reset members to their defaults for parsing a new relation
RestrictionType myRestrictionType
Edge * myCurrentEdge
The currently built edge.
bool railwayBufferStop
Whether this is a railway buffer stop.
bool operator()(const NIOSMNode *n1, const NIOSMNode *n2) const
bool tlsControlled
Whether this is a tls controlled junction.
void myStartElement(int element, const SUMOSAXAttributes &attrs) override
Called on the opening of a tag;.
An internal definition of a loaded edge.
A class which extracts OSM-nodes from a parsed OSM-file.
std::vector< long long int > myCurrentNodes
The list of nodes this edge is made of.
int myHierarchyLevel
The current hierarchy level.
void reconstructLayerElevation(double layerElevation, NBNetBuilder &nb)
reconstruct elevation from layer info
void load(const OptionsCont &oc, NBNetBuilder &nb)
const std::map< long long int, Edge * > & myOSMEdges
The previously parsed edges.
void myEndElement(int element) override
Called when a closing tag occurs.
const long long int id
The node's id.
std::vector< int > myParentElements
The element stack.
NBEdge * findEdgeRef(long long int wayRef, const std::vector< NBEdge * > &candidates) const
try to find the way segment among candidates
static const double MAXSPEED_UNGIVEN
Container for nodes during the netbuilding process.
NodesHandler(std::map< long long int, NIOSMNode * > &toFill, std::set< NIOSMNode *, CompareNodes > &uniqueNodes, const OptionsCont &cont)
Contructor.
The representation of a single edge during network building.
int myNoLanesForward
number of lanes in forward direction or 0 if unknown, negative if backwards lanes are meant
@ RESTRICTION_UNKNOWN
The relation tag was missing.
void myStartElement(int element, const SUMOSAXAttributes &attrs) override
Called on the opening of a tag;.
RestrictionType
whether the only allowed or the only forbidden connection is defined
void myStartElement(int element, const SUMOSAXAttributes &attrs) override
Called on the opening of a tag;.
NIOSMNode & operator=(const NIOSMNode &s)=delete
invalidated assignment operator
static SUMOVehicleClass interpretTransportType(const std::string &type, NIOSMNode *toSet=nullptr)
translate osm transport designations into sumo vehicle class
std::string myPTRouteType
indicates whether current relation is a pt route
std::map< std::string, double > mySpeedMap
A map of non-numeric speed descriptions to their numeric values.
@ RESTRICTION_NO
The only invalid connection is declared.
void extendRailwayDistances(Edge *e, NBTypeCont &tc)
extend kilometrage data for all nodes along railway
std::vector< long long int > myStops
bus stop references
RelationHandler(const std::map< long long int, NIOSMNode * > &osmNodes, const std::map< long long int, Edge * > &osmEdges, NBPTStopCont *nbptStopCont, const std::map< long long int, Edge * > &platfromShapes, NBPTLineCont *nbptLineCont, const OptionsCont &oc)
Constructor.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
WayType myCyclewayType
Information about the kind of cycleway along this road.
const OptionsCont & myOptionsCont
the options cont
const OptionsCont & myOptionsCont
the options
SVCPermissions permissions
type of pt stop
bool checkEdgeRef(long long int ref) const
check whether a referenced way has a corresponding edge
long long int myFromWay
the origination way for the current restriction
std::vector< long long int > myWays
ways in pt line references
int insertEdge(Edge *e, int index, NBNode *from, NBNode *to, const std::vector< long long int > &passed, NBNetBuilder &nb)
Builds an NBEdge.
long long int myCurrentRelation
The currently parsed relation.
long long int myViaNode
the via node/way for the current restriction
std::map< long long int, NIOSMNode * > myOSMNodes
the map from OSM node ids to actual nodes
static const long long int INVALID_ID
std::set< std::string > myUnusableTypes
The compounds types that do not contain known types.
static double interpretDistance(NIOSMNode *node)
read distance value from node and return value in m
const std::map< long long int, Edge * > & myPlatformShapes
The previously parsed platform shapes.
int myParkingType
Information about road-side parking.
std::string position
kilometrage/mileage
~EdgesHandler() override
Destructor.
void myEndElement(int element) override
Called when a closing tag occurs.
A storage for options typed value containers)
int myInterval
service interval of the pt line in minutes
NodesHandler & operator=(const NodesHandler &s)
invalidated assignment operator
NIImporter_OpenStreetMap()
double positionMeters
position converted to m (using highest precision available)
double myMaxSpeed
maximum speed in km/h, or MAXSPEED_UNGIVEN
std::set< NIOSMNode *, CompareNodes > myUniqueNodes
the set of unique nodes used in NodesHandler, used when freeing memory
std::map< long long int, Edge * > & myPlatformShapesMap
A map of built edges.
std::string ref
The edge's track name.
bool myIsRoute
indicates whether current relation is a route
const std::map< long long int, NIOSMNode * > & myOSMNodes
The previously parsed nodes.
bool myIsRestriction
whether the currently parsed relation is a restriction
Functor which compares two Edges.
A class which extracts relevant relation information from a parsed OSM-file.
static const std::string compoundTypeSeparator
The separator within newly created compound type names.
WayType mySidewalkType
Information about the kind of sidwalk along this road.
bool myAllAttributes
whether additional way attributes shall be added to the edge
std::map< long long int, Edge * > myPlatformShapes
the map from OSM way ids to platform shapes
bool ptStopPosition
Whether this is a public transport stop position.
bool applyRestriction() const
try to apply the parsed restriction and return whether successful
int myLayer
Information about the relative z-ordering of ways.
std::vector< int > myParentElements
The element stack.
std::string usableType(const std::string &type, const std::string &id, NBTypeCont &tc)
check whether the type is known or consists of known type compounds. return empty string otherwise
int myNoLanes
number of lanes, or -1 if unknown
NBPTLineCont * myNBPTLineCont
PT Line container to be filled.
A storage for available types of edges.
RelationHandler(const RelationHandler &s)
invalidated copy constructor
NBNode * node
the NBNode that was instantiated
bool myCurrentIsPlatform
Information whether this is a pt platform.
std::string myHighWayType
The type, stored in "highway" key.
std::map< long long int, Edge * > & myEdgeMap
A map of built edges.
NodesHandler(const NodesHandler &s)
invalidated copy constructor
bool myCurrentIsRoad
Information whether this is a road.
A class which extracts OSM-edges from a parsed OSM-file.
bool railwaySignal
Whether this is a railway (main) signal.
Importer for networks stored in OpenStreetMap format.
EdgesHandler(const std::map< long long int, NIOSMNode * > &osmNodes, std::map< long long int, Edge * > &toFill, std::map< long long int, Edge * > &platformShapes)
Constructor.
void myEndElement(int element) override
Called when a closing tag occurs.
std::map< long long int, NIOSMNode * > & myToFill
The nodes container to fill.
~NIImporter_OpenStreetMap()
long long int myToWay
the destination way for the current restriction
const double lat
The latitude the node is located at.
Edge & operator=(const Edge &s)=delete
invalidated assignment operator
const bool myImportElevation
whether elevation data should be imported
Represents a single node (junction) during network building.
~NodesHandler() override
Destructor.
EdgesHandler & operator=(const EdgesHandler &s)
invalidated assignment operator
@ SVC_IGNORING
vehicles ignoring classes
Encapsulated SAX-Attributes.
long long int myLastNodeID
ID of the currently parsed node, for reporting mainly.
const double lon
The longitude the node is located at.
WayType myRailDirection
Information about the direction(s) of railway usage.
std::map< NBNode *, std::pair< double, double > > getNeighboringNodes(NBNode *node, double maxDist, const std::set< NBNode * > &knownElevation)
collect neighboring nodes with their road distance and maximum between-speed. Search does not continu...
bool myIsStopArea
indicates whether current relation is a pt stop area
EdgesHandler(const EdgesHandler &s)
invalidated copy constructor
std::map< long long int, Edge * > myEdges
the map from OSM way ids to edge objects
std::set< NIOSMNode *, CompareNodes > & myUniqueNodes
the set of unique nodes (used for duplicate detection/substitution)
std::string streetName
The edge's street name.