58 if (oc.
isSet(
"dlr-navteq-poly-files")) {
61 if (oc.
isSet(
"dlr-navteq-poi-files")) {
70 std::vector<std::string> files = oc.
getStringVector(
"dlr-navteq-poi-files");
71 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
73 throw ProcessError(
"Could not open dlr-navteq-poi-file '" + *file +
"'.");
85 std::vector<std::string> files = oc.
getStringVector(
"dlr-navteq-poly-files");
86 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
88 throw ProcessError(
"Could not open dlr-navteq-poly-file '" + *file +
"'.");
110 if (line.length() == 0 || line.find(
"#") != std::string::npos) {
117 std::istringstream stream(line);
119 std::string name, skip, type, desc;
120 std::getline(stream, name,
'\t');
121 std::getline(stream, skip,
'\t');
122 std::getline(stream, type,
'\t');
123 std::getline(stream, desc,
'\t');
130 throw ProcessError(
"Invalid x coordinate for POI '" + name +
"'.");
134 throw ProcessError(
"Invalid y coordinate for POI '" + name +
"'.");
142 throw ProcessError(
"Unable to project coordinates for POI '" + name +
"'.");
146 bool discard = oc.
getBool(
"discard");
147 double layer = oc.
getFloat(
"layer");
183 if (line.length() == 0 || line.find(
"#") != std::string::npos) {
191 std::vector<std::string> values = st.
getVector();
192 if (values.size() < 6 || values.size() % 2 != 0) {
193 throw ProcessError(
"Invalid dlr-navteq-polygon - line: '" + line +
"'.");
195 std::string
id = values[0];
196 std::string ort = values[1];
197 std::string type = values[2];
198 std::string name = values[3];
202 while ((
int)values.size() > index) {
203 std::string xpos = values[index];
204 std::string ypos = values[index + 1];
210 WRITE_WARNING(
"Unable to project coordinates for polygon '" +
id +
"'.");
221 if (vec.size() == 0) {
226 WRITE_WARNING(
"The name of a polygon is missing; it will be discarded.");
231 bool fill = vec.front() == vec.back();
232 bool discard = oc.
getBool(
"discard");
233 double layer = oc.
getFloat(
"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.
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.
const Polygons & getPolygons() const
Returns all polygons.
bool add(SUMOPolygon *poly, bool ignorePruning=false)
Adds a polygon to the storage.
Retrieves a file linewise and reports the lines to a handler.
static GeoConvHelper & getProcessing()
the coordinate transformation to use for input conversion and processing
T get(const std::string &id) const
Retrieves an item.
double 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.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
#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.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
A storage for type mappings.
const TypeDef & get(const std::string &id)
Returns a type definition.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter ...
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.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
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) ...
#define PROGRESS_BEGIN_MESSAGE(msg)
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
static std::string convertUmlaute(std::string str)
Converts german "Umlaute" to their latin-version.
std::vector< std::string > getVector()
return vector of strings
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.
bool hasMore() const
Returns whether another line may be read (the file was not read completely)
int getEnumIDFor(const std::string &key)
Retuns a unique id for a given name.
A storage for options typed value containers)
#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.