49 #ifdef CHECK_MEMORY_LEAKS 51 #endif // CHECK_MEMORY_LEAKS 65 if (!oc.
isSet(
"dlr-navteq-output")) {
78 strftime(buffer, 80,
"on %c", localtime(&rawtime));
79 device <<
"# Generated " << buffer <<
" by " << oc.
getFullName() <<
"\n";
80 device <<
"# Format matches Extraction version: V6.0 \n";
81 std::stringstream tmp;
83 tmp.seekg(std::ios_base::beg);
86 std::getline(tmp, line);
87 device <<
"# " << line <<
"\n";
103 const SUMOReal geoScale = pow(10.0f, haveGeo ? 5 : 2);
106 WRITE_WARNING(
"DlrNavteq node data will be written in (floating point) cartesian coordinates");
109 device <<
"# NODE_ID\tIS_BETWEEN_NODE\tamount_of_geocoordinates\tx1\ty1\t[x2 y2 ... xn yn]\n";
111 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
116 device << n->
getID() <<
"\t0\t1\t" << pos.
x() <<
"\t" << pos.
y() <<
"\n";
119 std::vector<std::string> avoid;
120 const bool numericalIDs = oc.
getBool(
"numerical-ids");
123 std::vector<std::string> avoid2 = ec.
getAllNames();
124 avoid.insert(avoid.end(), avoid2.begin(), avoid2.end());
127 for (std::map<std::string, NBEdge*>::const_iterator i = ec.
begin(); i != ec.
end(); ++i) {
130 if (geom.size() > 2) {
131 std::string internalNodeID = e->
getID();
133 (nc.
retrieve(internalNodeID) != 0)) {
136 internalNodeID = idSupplier.
getNext();
138 internalNodeID +=
"_geometry";
141 device << internalNodeID <<
"\t1\t" << geom.size() - 2;
142 for (
int ii = 1; ii < (int)geom.size() - 1; ++ii) {
146 device <<
"\t" << pos.
x() <<
"\t" << pos.
y();
157 std::map<const std::string, std::string> nameIDs;
161 device <<
"# LINK_ID\tNODE_ID_FROM\tNODE_ID_TO\tBETWEEN_NODE_ID\tLENGTH\tVEHICLE_TYPE\tFORM_OF_WAY\tBRUNNEL_TYPE\tFUNCTIONAL_ROAD_CLASS\tSPEED_CATEGORY\tNUMBER_OF_LANES\tSPEED_LIMIT\tSPEED_RESTRICTION\tNAME_ID1_REGIONAL\tNAME_ID2_LOCAL\tHOUSENUMBERS_RIGHT\tHOUSENUMBERS_LEFT\tZIP_CODE\tAREA_ID\tSUBAREA_ID\tTHROUGH_TRAFFIC\tSPECIAL_RESTRICTIONS\tEXTENDED_NUMBER_OF_LANES\tISRAMP\tCONNECTION\n";
163 for (std::map<std::string, NBEdge*>::const_iterator i = ec.
begin(); i != ec.
end(); ++i) {
168 if (oc.
getBool(
"output.street-names")) {
169 const std::string& name = i->second->getStreetName();
170 if (name !=
"" && nameIDs.count(name) == 0) {
172 nameIDs[name] = nameID;
175 device << e->
getID() <<
"\t" 178 << betweenNodeID <<
"\t" 202 if (oc.
getBool(
"output.street-names")) {
206 namesDevice <<
"# NAME_ID\tName\n" << nameIDs.size() <<
"\n";
207 for (std::map<const std::string, std::string>::const_iterator i = nameIDs.begin(); i != nameIDs.end(); ++i) {
208 namesDevice << i->second <<
"\t" << i->first <<
"\n";
216 if (permissions ==
SVCAll) {
217 return "100000000000";
219 std::ostringstream oss;
221 oss << ((permissions & SVC_PASSENGER) > 0 ? 1 : 0);
222 oss << ((permissions & SVC_PASSENGER) > 0 ? 1 : 0);
223 oss << ((permissions & SVC_HOV) > 0 ? 1 : 0);
224 oss << ((permissions & SVC_EMERGENCY) > 0 ? 1 : 0);
225 oss << ((permissions & SVC_TAXI) > 0 ? 1 : 0);
226 oss << ((permissions & (SVC_BUS | SVC_COACH)) > 0 ? 1 : 0);
227 oss << ((permissions & SVC_DELIVERY) > 0 ? 1 : 0);
228 oss << ((permissions & (SVC_TRUCK | SVC_TRAILER)) > 0 ? 1 : 0);
229 oss << ((permissions & SVC_MOTORCYCLE) > 0 ? 1 : 0);
230 oss << ((permissions & SVC_BICYCLE) > 0 ? 1 : 0);
231 oss << ((permissions & SVC_PEDESTRIAN) > 0 ? 1 : 0);
244 type = type.substr(8);
256 }
else if (type ==
"unclassified" || type ==
"residential") {
258 }
else if (type ==
"living_street" || type ==
"road" || type ==
"service" || type ==
"track" || type ==
"cycleway" || type ==
"path" || type ==
"footway") {
336 const int code = (numLanes == 1 ? 1 :
337 (numLanes < 4 ? 2 : 3));
338 return numLanes * 10 + code;
357 const SUMOReal geoScale = pow(10.0f, haveGeo ? 5 : 2);
360 device <<
"#Traffic signal related to LINK_ID and NODE_ID with location relative to driving direction.\n#column format like pointcollection.\n#DESCRIPTION->LOCATION: 1-rechts von LINK; 2-links von LINK; 3-oberhalb LINK -1-keineAngabe\n#RELATREC_ID\tPOICOL_TYPE\tDESCRIPTION\tLONGITUDE\tLATITUDE\tLINK_ID\n";
362 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
369 for (EdgeVector::const_iterator it = incoming.begin(); it != incoming.end(); ++it) {
371 device << e->
getID() <<
"\t" 373 <<
"LSA;NODEIDS#" << n->
getID() <<
"#;LOCATION#-1#;\t" 376 << e->
getID() <<
"\n";
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
void close()
Closes the device and removes it from the dictionary.
std::map< std::string, NBNode * >::const_iterator begin() const
Returns the pointer to the begin of the stored nodes.
static int speedInKph(SUMOReal metersPerSecond)
get edge speed rounded to kmh
std::map< std::string, NBNode * >::const_iterator end() const
Returns the pointer to the end of the stored nodes.
SUMOReal length() const
Returns the length.
static void writeHeader(OutputDevice &device, const OptionsCont &oc)
write header comments (input paramters, date, etc...)
static int getRoadClass(NBEdge *edge)
get the navteq road class
const std::string & getTypeID() const
get ID of type
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
static int getSpeedCategory(int kph)
get the navteq speed class based on the speed in km/h
The representation of a single edge during network building.
void setPrecision(int precision=OUTPUT_ACCURACY)
Sets the precison or resets it to default.
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)
const std::string & getID() const
Returns the id.
const SVCPermissions SVCAll
static int getSpeedCategoryUpperBound(int kph)
get the SPEED_LIMIT as defined by elmar (upper bound of speed category)
#define WRITE_WARNING(msg)
static const std::string UNDEFINED
magic value for undefined stuff
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
bool isTLControlled() const
Returns whether this node is controlled by any tls.
static int getNavteqLaneCode(const int numLanes)
get the lane number encoding
void push_front_noDoublePos(const Position &p)
insert in front a non double position
static void writeNodesUnsplitted(const OptionsCont &oc, NBNodeCont &nc, NBEdgeCont &ec)
Writes the nodes_unsplitted file.
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.
std::map< std::string, NBEdge * >::const_iterator begin() const
Returns the pointer to the begin of the stored edges.
std::string getNext()
Returns the next id.
static methods for processing the coordinates conversion for the current net
int getNumLanes() const
Returns the number of lanes.
A point in 2D or 3D with translation and scaling methods.
NBEdgeCont & getEdgeCont()
Returns the edge container.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
Storage for edges, including some functionality operating on multiple edges.
SUMOReal x() const
Returns the x-position.
static void writeLinksUnsplitted(const OptionsCont &oc, NBEdgeCont &ec)
Writes the links_unsplitted file.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network into XML-files (nodes, edges, connections, traffic lights)
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
const PositionVector & getGeometry() const
Returns the geometry of the edge.
static std::string getAllowedTypes(SVCPermissions permissions)
build the ascii-bit-vector for column vehicle_type
std::vector< std::string > getAllNames() const
get all node names
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges.
NBNodeCont & getNodeCont()
Returns the node container.
Instance responsible for building networks.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
std::vector< NBEdge * > EdgeVector
A storage for options typed value containers)
void mul(SUMOReal val)
Multiplies both positions with the given value.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
void writeConfiguration(std::ostream &os, bool filled, bool complete, bool addComments) const
Writes the configuration.
SUMOReal getSpeed() const
Returns the speed allowed on this edge.
static SUMOReal getGraphLength(NBEdge *edge)
get the length of the edge when measured up to the junction center
const Position & getPosition() const
Returns the position of this node.
Represents a single node (junction) during network building.
const std::string & getFullName() const
static void writeTrafficSignals(const OptionsCont &oc, NBNodeCont &nc)
Writes the traffic_signals file.
Static storage of an output device and its base (abstract) implementation.
void push_back_noDoublePos(const Position &p)
insert in back a non double position
NBNode * getFromNode() const
Returns the origin node of the edge.
Container for nodes during the netbuilding process.
SUMOReal y() const
Returns the y-position.
std::vector< std::string > getAllNames() const
Returns all ids of known edges.
NBNode * getToNode() const
Returns the destination node of the edge.