65 if (oc.
isSet(
"dlr-navteq-poly-files")) {
68 if (oc.
isSet(
"dlr-navteq-poi-files")) {
77 std::vector<std::string> files = oc.
getStringVector(
"dlr-navteq-poi-files");
78 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
80 throw ProcessError(
"Could not open dlr-navteq-poi-file '" + *file +
"'.");
92 std::vector<std::string> files = oc.
getStringVector(
"dlr-navteq-poly-files");
93 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
95 throw ProcessError(
"Could not open dlr-navteq-poly-file '" + *file +
"'.");
117 if (line.length() == 0 || line.find(
"#") != std::string::npos) {
124 std::istringstream stream(line);
126 std::string name, skip, type, desc;
127 std::getline(stream, name,
'\t');
128 std::getline(stream, skip,
'\t');
129 std::getline(stream, type,
'\t');
130 std::getline(stream, desc,
'\t');
137 throw ProcessError(
"Invalid x coordinate for POI '" + name +
"'.");
141 throw ProcessError(
"Invalid y coordinate for POI '" + name +
"'.");
149 throw ProcessError(
"Unable to project coordinates for POI '" + name +
"'.");
153 bool discard = oc.
getBool(
"discard");
154 double layer = oc.
getFloat(
"layer");
190 if (line.length() == 0 || line.find(
"#") != std::string::npos) {
198 std::vector<std::string> values = st.
getVector();
199 if (values.size() < 6 || values.size() % 2 != 0) {
200 throw ProcessError(
"Invalid dlr-navteq-polygon - line: '" + line +
"'.");
202 std::string
id = values[0];
203 std::string ort = values[1];
204 std::string type = values[2];
205 std::string name = values[3];
209 while ((
int)values.size() > index) {
210 std::string xpos = values[index];
211 std::string ypos = values[index + 1];
217 WRITE_WARNING(
"Unable to project coordinates for polygon '" +
id +
"'.");
223 if (name ==
"noname" || toFill.
getPolygons().get(name) != 0) {
228 if (vec.size() == 0) {
233 WRITE_WARNING(
"The name of a polygon is missing; it will be discarded.");
238 bool fill = vec.front() == vec.back();
239 bool discard = oc.
getBool(
"discard");
240 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.
Retrieves a file linewise and reports the lines to a handler.
static GeoConvHelper & getProcessing()
the coordinate transformation to use for input conversion and processing
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)
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)
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.
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)
static double _2double(const E *const data)
converts a char-type array into the double value described by it
#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.