58 #ifdef CHECK_MEMORY_LEAKS 60 #endif // CHECK_MEMORY_LEAKS 69 if (oc.
isSet(
"dlr-navteq-poly-files")) {
72 if (oc.
isSet(
"dlr-navteq-poi-files")) {
81 std::vector<std::string> files = oc.
getStringVector(
"dlr-navteq-poi-files");
82 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
84 throw ProcessError(
"Could not open dlr-navteq-poi-file '" + *file +
"'.");
96 std::vector<std::string> files = oc.
getStringVector(
"dlr-navteq-poly-files");
97 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
99 throw ProcessError(
"Could not open dlr-navteq-poly-file '" + *file +
"'.");
121 if (line.length() == 0 || line.find(
"#") != std::string::npos) {
128 std::istringstream stream(line);
130 std::string name, skip, type, desc;
131 std::getline(stream, name,
'\t');
132 std::getline(stream, skip,
'\t');
133 std::getline(stream, type,
'\t');
134 std::getline(stream, desc,
'\t');
141 throw ProcessError(
"Invalid x coordinate for POI '" + name +
"'.");
145 throw ProcessError(
"Invalid y coordinate for POI '" + name +
"'.");
153 throw ProcessError(
"Unable to project coordinates for POI '" + name +
"'.");
157 bool discard = oc.
getBool(
"discard");
194 if (line.length() == 0 || line.find(
"#") != std::string::npos) {
202 std::vector<std::string> values = st.
getVector();
203 if (values.size() < 6 || values.size() % 2 != 0) {
204 throw ProcessError(
"Invalid dlr-navteq-polygon - line: '" + line +
"'.");
206 std::string
id = values[0];
207 std::string ort = values[1];
208 std::string type = values[2];
209 std::string name = values[3];
213 while ((
int)values.size() > index) {
214 std::string xpos = values[index];
215 std::string ypos = values[index + 1];
221 WRITE_WARNING(
"Unable to project coordinates for polygon '" +
id +
"'.");
232 if (vec.size() == 0) {
237 WRITE_WARNING(
"The name of a polygon is missing; it will be discarded.");
242 bool fill = vec.front() == vec.back();
243 bool discard = oc.
getBool(
"discard");
std::string id
The new type id to use.
static void loadPOIFiles(OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads pois assumed to be stored as according DLR-Navteq (Elmar)-files.
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) ...
static RGBColor parseColor(std::string coldef)
Parses a color information.
A single definition of values that shall be used for a given type.
static bool isReadable(std::string path)
Checks whether the given file is readable.
bool readLine(LineHandler &lh)
Reads a single (the next) line from the file and reports it to the given LineHandler.
static SUMOReal _2SUMOReal(const E *const data)
converts a char-type array into the SUMOReal value described by it
Retrieves a file linewise and reports the lines to a handler.
static GeoConvHelper & getProcessing()
the coordinate transformation to use for input conversion and processing
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
SUMOReal layer
The layer to use.
static void loadPolyFiles(OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads polygons assumed to be stored as according DLR-Navteq (Elmar)-files.
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
const Polygons & getPolygons() const
Returns all polygons.
#define WRITE_WARNING(msg)
bool discard
Information whether polygons of this type shall be discarded.
A storage for loaded polygons and pois.
static OptionsCont & getOptions()
Retrieves the options.
RGBColor color
The color to use.
T get(const std::string &id) const
Retrieves an item.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
A storage for type mappings.
const TypeDef & get(const std::string &id)
Returns a type definition.
A point in 2D or 3D with translation and scaling methods.
static void loadPolyFile(const std::string &file, OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads DLR-Navteq (Elmar)-polygons from the given file.
bool has(const std::string &id)
Returns the information whether the named type is known.
#define PROGRESS_BEGIN_MESSAGE(msg)
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
bool add(SUMO::Polygon *poly, bool ignorePruning=false)
Adds a polygon to the storage.
static std::string convertUmlaute(std::string str)
Converts german "Umlaute" to their latin-version.
std::vector< std::string > getVector()
static void loadIfSet(OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads pois/polygons assumed to be stored as according DLR-Navteq (Elmar)-files.
static std::string prune(const std::string &str)
Removes trailing and leading whitechars.
std::string prefix
The prefix to use.
int getEnumIDFor(const std::string &key)
Retuns a unique id for a given name.
A storage for options typed value containers)
bool hasMore() const
Returns whether another line may be read (the file was not read completely)
#define PROGRESS_DONE_MESSAGE()
static void loadPOIFile(const std::string &file, OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads DLR-Navteq (Elmar)-pois from the given file.
bool allowFill
Information whether polygons of this type can be filled.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.