56 if (oc.
isSet(
"dlr-navteq-poly-files")) {
59 if (oc.
isSet(
"dlr-navteq-poi-files")) {
68 std::vector<std::string> files = oc.
getStringVector(
"dlr-navteq-poi-files");
69 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
71 throw ProcessError(
TLF(
"Could not open dlr-navteq-poi-file '%'.", *file));
83 std::vector<std::string> files = oc.
getStringVector(
"dlr-navteq-poly-files");
84 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
86 throw ProcessError(
TLF(
"Could not open dlr-navteq-poly-file '%'.", *file));
108 if (line.length() == 0 || line.find(
"#") != std::string::npos) {
115 std::istringstream stream(line);
117 std::string name, skip, type, desc;
118 std::getline(stream, name,
'\t');
119 std::getline(stream, skip,
'\t');
120 std::getline(stream, type,
'\t');
121 std::getline(stream, desc,
'\t');
140 throw ProcessError(
TLF(
"Unable to project coordinates for POI '%'.", name));
144 bool discard = oc.
getBool(
"discard");
146 double layer = oc.
getFloat(
"layer");
162 PointOfInterest* poi =
new PointOfInterest(name, type, color, pos,
false,
"", 0,
false, 0, icon, layer);
181 if (line.length() == 0 || line.find(
"#") != std::string::npos) {
189 std::vector<std::string> values = st.
getVector();
190 if (values.size() < 6 || values.size() % 2 != 0) {
191 throw ProcessError(
TLF(
"Invalid dlr-navteq-polygon - line: '%'.", line));
193 std::string
id = values[0];
194 std::string ort = values[1];
195 std::string type = values[2];
196 std::string name = values[3];
200 while ((
int)values.size() > index) {
201 std::string xpos = values[index];
202 std::string ypos = values[index + 1];
219 if (vec.size() == 0) {
224 WRITE_WARNING(
TL(
"The name of a polygon is missing; it will be discarded."));
229 bool fill = vec.front() == vec.back();
230 bool discard = oc.
getBool(
"discard");
232 double layer = oc.
getFloat(
"layer");
#define WRITE_WARNINGF(...)
#define WRITE_WARNING(msg)
#define PROGRESS_DONE_MESSAGE()
#define PROGRESS_BEGIN_MESSAGE(msg)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static bool isReadable(std::string path)
Checks whether the given file is readable.
static GeoConvHelper & getProcessing()
the coordinate transformation to use for input conversion and processing
Retrieves a file linewise and reports the lines to a handler.
bool readLine(LineHandler &lh)
Reads a single (the next) line from the file and reports it to the given LineHandler.
bool hasMore() const
Returns whether another line may be read (the file was not read completely)
T get(const std::string &id) const
Retrieves an item.
A storage for options typed value containers)
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
static OptionsCont & getOptions()
Retrieves the options.
static void loadPOIFile(const std::string &file, OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads DLR-Navteq (Elmar)-pois from the given file.
static void loadPOIFiles(OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads pois assumed to be stored as according DLR-Navteq (Elmar)-files.
static void loadPolyFiles(OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads polygons assumed to be stored as according DLR-Navteq (Elmar)-files.
static void loadPolyFile(const std::string &file, OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads DLR-Navteq (Elmar)-polygons from the given file.
static void loadIfSet(OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads pois/polygons assumed to be stored as according DLR-Navteq (Elmar)-files.
A storage for loaded polygons and pois.
bool add(SUMOPolygon *poly, bool ignorePruning=false)
Adds a polygon to the storage.
int getEnumIDFor(const std::string &key)
Retuns a unique id for a given name.
A storage for type mappings.
const TypeDef & get(const std::string &id)
Returns a type definition.
bool has(const std::string &id)
Returns the information whether the named type is known.
A point in 2D or 3D with translation and scaling methods.
static RGBColor parseColor(std::string coldef)
Parses a color information.
const Polygons & getPolygons() const
Returns all polygons.
std::vector< std::string > getVector()
return vector of strings
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static std::string prune(const std::string &str)
Removes trailing and leading whitechars.
static std::string convertUmlaute(std::string str)
Converts german "Umlaute" to their latin-version.
A single definition of values that shall be used for a given type.
std::string icon
the icon to use
bool discard
Information whether polygons of this type shall be discarded.
std::string prefix
The prefix to use.
double layer
The layer to use.
std::string id
The new type id to use.
RGBColor color
The color to use.
Filltype allowFill
Information whether polygons of this type can be filled.