64 #ifdef CHECK_MEMORY_LEAKS
66 #endif // CHECK_MEMORY_LEAKS
75 oc.
addCallExample(
"-c <CONFIGURATION>",
"run with configuration options set in file");
93 oc.
addDescription(
"net-file",
"Input",
"Loads SUMO-network FILE as reference to offset and projection");
97 oc.
addDescription(
"dlr-navteq-poly-files",
"Input",
"Reads polygons from FILE assuming they're coded in DLR-Navteq (Elmar)-format");
99 oc.
addDescription(
"dlr-navteq-poi-files",
"Input",
"Reads pois from FILE+ assuming they're coded in DLR-Navteq (Elmar)-format");
104 oc.
addDescription(
"visum-files",
"Input",
"Reads polygons from FILE assuming it's a Visum-net");
109 oc.
addDescription(
"xml-files",
"Input",
"Reads pois and shapes from FILE assuming they're coded in XML");
114 oc.
addDescription(
"osm-files",
"Input",
"Reads pois from FILE+ assuming they're coded in OSM");
116 oc.
addDescription(
"osm.keep-full-type",
"Input",
"The type will be made of the key-value - pair");
118 oc.
addDescription(
"osm.use-name",
"Input",
"The id will be set from the given 'name' attribute");
122 oc.
addSynonyme(
"shapefile-prefixes",
"shapefile-prefix");
124 oc.
addSynonyme(
"shapefile-prefixes",
"shape-files",
true);
125 oc.
addDescription(
"shapefile-prefixes",
"Input",
"Reads shapes from shapefiles FILE+");
128 oc.
addSynonyme(
"shapefile.guess-projection",
"arcview.guess-projection",
true);
129 oc.
addDescription(
"shapefile.guess-projection",
"Input",
"Guesses the shapefile's projection");
132 oc.
addSynonyme(
"shapefile.id-column",
"shapefile.id-name",
true);
133 oc.
addSynonyme(
"shapefile.id-column",
"shape-files.id-name",
true);
134 oc.
addDescription(
"shapefile.id-column",
"Input",
"Defines in which column the id can be found");
137 oc.
addDescription(
"shapefile.use-running-id",
"Input",
"A running number will be used as id");
140 oc.
addDescription(
"shapefile.add-param",
"Input",
"Extract all additonal columns as params");
151 oc.
addDescription(
"output-file",
"Output",
"Write generated polygons/pois to FILE");
156 oc.
addSynonyme(
"prune.in-net",
"prune.on-net",
true);
157 oc.
addDescription(
"prune.in-net",
"Pruning",
"Enables pruning on net boundaries");
160 oc.
addSynonyme(
"prune.in-net.offsets",
"prune.on-net.offsets",
true);
161 oc.
addDescription(
"prune.in-net.offsets",
"Pruning",
"Uses STR as offset definition added to the net boundaries");
164 oc.
addDescription(
"prune.boundary",
"Pruning",
"Uses STR as pruning boundary");
168 oc.
addSynonyme(
"prune.keep-list",
"prune.ignore",
true);
169 oc.
addDescription(
"prune.keep-list",
"Pruning",
"Items in STR will be kept though out of boundary");
173 oc.
addDescription(
"prune.explicit",
"Pruning",
"Items with names in STR will be removed");
177 oc.
addSynonyme(
"offset.x",
"x-offset-to-apply",
true);
178 oc.
addDescription(
"offset.x",
"Processing",
"Adds FLOAT to net x-positions");
181 oc.
addSynonyme(
"offset.y",
"y-offset-to-apply",
true);
182 oc.
addDescription(
"offset.y",
"Processing",
"Adds FLOAT to net y-positions");
185 oc.
addDescription(
"all-attributes",
"Processing",
"Imports all attributes as key/value pairs");
188 oc.
addDescription(
"ignore-errors",
"Processing",
"Continue on broken input");
193 oc.
addDescription(
"color",
"Building Defaults",
"Sets STR as default color");
196 oc.
addDescription(
"prefix",
"Building Defaults",
"Sets STR as default prefix");
199 oc.
addDescription(
"type",
"Building Defaults",
"Sets STR as default type");
202 oc.
addDescription(
"layer",
"Building Defaults",
"Sets INT as default layer");
205 oc.
addDescription(
"discard",
"Building Defaults",
"Sets default action to discard");
209 oc.
addDescription(
"proj.plain-geo",
"Projection",
"Write geo coordinates in output");
232 if ((oc.
isSet(
"dlr-navteq-poly-files") || oc.
isSet(
"dlr-navteq-poi-files")) && oc.
isDefault(
"proj.scale")) {
235 if (!oc.
isSet(
"net")) {
238 unsigned numProjections = oc.
getBool(
"simple-projection") + oc.
getBool(
"proj.utm") + oc.
getBool(
"proj.dhdn") + (oc.
getString(
"proj").length() > 1);
239 if ((oc.
isSet(
"osm-files") || oc.
isSet(
"dlr-navteq-poly-files") || oc.
isSet(
"dlr-navteq-poi-files")) && numProjections == 0) {
240 oc.
set(
"proj.utm",
"true");
255 if (oc.
getBool(
"prune.in-net")) {
256 if (!oc.
isSet(
"net")) {
257 throw ProcessError(
"In order to prune the input on the net, you have to supply a network.");
263 pruningBoundary.xmin() + offsets.
xmin(),
264 pruningBoundary.ymin() + offsets.
ymin(),
265 pruningBoundary.xmax() + offsets.
xmax(),
266 pruningBoundary.ymax() + offsets.
ymax());
269 if (oc.
isSet(
"prune.boundary")) {
280 if (oc.
isSet(
"type-file")) {
306 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
312 }
catch (
const std::exception& e) {
313 if (std::string(e.what()) != std::string(
"")) {
326 std::cout <<
"Success." << std::endl;
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
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 void init()
Initialises the xml-subsystem.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
static void loadIfSet(OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads pois/polygons assumed to be stored as OSM-XML.
static void addReportOptions(OptionsCont &oc)
Adds reporting options to the given container.
int main(int argc, char **argv)
static void getOptions(bool loadConfig, int argc=0, char **argv=0)
Parses the command line arguments and loads the configuration optionally.
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme)
Enables or disables validation.
void addCallExample(const std::string &example, const std::string &desc)
Add a call example.
SUMOReal ymin() const
Returns minimum y-coordinate.
void setApplicationDescription(const std::string &appDesc)
Sets the application description.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
SUMOReal xmin() const
Returns minimum x-coordinate.
static Boundary parseBoundaryReporting(const std::string &def, const std::string &objecttype, const char *objectid, bool &ok, bool report=true)
Builds a boundary from its string representation, reporting occured errors.
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything's ok.
static void close()
Closes all of an applications subsystems.
static void addConfigurationOptions(OptionsCont &oc)
Adds configuration options to the given container.
SUMOReal xmax() const
Returns maximum x-coordinate.
A class that stores a 2D geometrical boundary.
A storage for loaded polygons and pois.
static OptionsCont & getOptions()
Retrieves the options.
void addSynonyme(const std::string &name1, const std::string &name2, bool isDeprecated=false)
Adds a synonyme for an options name (any order)
static void computeFinal()
compute the location attributes which will be used for output based on the loaded location data...
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.
static void loadIfSet(OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads pois/polygons assumed to be stored using VISUM-format.
static void loadIfSet(OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads pois/polygons assumed to be stored as shape files-files.
bool processMetaOptions(bool missingOptions)
Checks for help and configuration output, returns whether we should exit.
const std::string getBuildName(const std::string &version)
attach some build flags to the version string
static bool init(OptionsCont &oc)
Initialises the processing and the final instance using the given options.
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
const Boundary & getConvBoundary() const
Returns the converted boundary.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
static void addProjectionOptions(OptionsCont &oc)
Adds projection options to the given container.
A handler for loading polygon type maps.
static void load(const std::string &file, int shift)
Loads network projection if wished.
static void loadIfSet(OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads pois/polygons assumed to be stored as according DLR-Navteq (Elmar)-files.
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
void inform(std::string msg, bool addType=true)
adds a new error to the list
A storage for options typed value containers)
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
static void loadIfSet(OptionsCont &oc, PCPolyContainer &toFill, PCTypeMap &tm)
Loads pois/polygons assumed to be stored as XML.
SUMOReal ymax() const
Returns maximum y-coordinate.
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
void clear()
Clears information whether an error occured previously.
static void initOutputOptions()
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
void setApplicationName(const std::string &appName, const std::string &fullName)
Sets the application name.