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");
158 int layer = oc.
getInt(
"layer");
173 bool ignorePrunning =
false;
175 ignorePrunning =
true;
178 toFill.
insert(name, poi, layer, ignorePrunning);
198 if (line.length() == 0 || line.find(
"#") != std::string::npos) {
206 std::vector<std::string> values = st.
getVector();
207 if (values.size() < 6 || values.size() % 2 != 0) {
208 throw ProcessError(
"Invalid dlr-navteq-polygon - line: '" + line +
"'.");
210 std::string
id = values[0];
211 std::string ort = values[1];
212 std::string type = values[2];
213 std::string name = values[3];
217 while (values.size() > index) {
218 std::string xpos = values[index];
219 std::string ypos = values[index + 1];
225 WRITE_WARNING(
"Unable to project coordinates for polygon '" +
id +
"'.");
236 if (vec.size() == 0) {
241 WRITE_WARNING(
"The name of a polygon is missing; it will be discarded.");
246 bool fill = vec.front() == vec.back();
247 bool discard = oc.
getBool(
"discard");
248 int layer = oc.
getInt(
"layer");
265 toFill.
insert(name, poly, layer);
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) ...
bool containsPolygon(const std::string &kidey)
Returns the information whether a polygon with the given key is in the container. ...
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)
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)
bool insert(const std::string &id, Polygon *poly, int layer, bool ignorePruning=false)
Adds a polygon to the storage.
static void loadPolyFiles(OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads polygons assumed to be stored as according DLR-Navteq (Elmar)-files.
#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.
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)
static std::string convertUmlaute(std::string str)
Converts german "Umlaute" to their latin-version.
std::vector< std::string > getVector()
void push_back(const PositionVector &p)
Appends all positions from the given vector.
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)
int layer
The layer to use.
#define PROGRESS_DONE_MESSAGE()
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
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.