54 const std::vector<std::string>& removeByNames)
55 : myPruningBoundary(pruningBoundary), myDoPrune(prune),
56 myRemoveByNames(removeByNames) {}
114 WRITE_WARNING(
"Ignoring option \"proj.plain-geo\" because no geo-conversion has been defined");
125 for (std::map<std::string, SUMO::Polygon*>::const_iterator i =
myPolygons.getMyMap().begin(); i !=
myPolygons.getMyMap().end(); ++i) {
126 i->second->writeXML(out, useGeo);
131 std::map<std::string, std::pair<std::string, double> >::const_iterator it =
myLanePosPois.find(i->first);
133 i->second->writeXML(out, useGeo, zOffset);
135 i->second->writeXML(out, useGeo, zOffset, it->second.first, it->second.second);
148 strftime(buffer, 80,
"on %c", localtime(&rawtime));
149 device <<
"# Generated " << buffer <<
" by " << oc.
getFullName() <<
"\n";
150 device <<
"# Format matches Extraction version: V" << OUTPUT_VERSION <<
" \n";
151 std::stringstream tmp;
153 tmp.seekg(std::ios_base::beg);
156 std::getline(tmp, line);
157 device <<
"# " << line <<
"\n";
168 const double geoScale = pow(10.0f, haveGeo ? 5 : 2);
174 out <<
"# ID\tCITY\tTYPE\tNAME\tgeo_x\tgeo_y\n";
182 out << i->second->getType() <<
"\t";
183 out << i->first <<
"\t";
184 out << pos.
x() <<
"\t";
185 out << pos.
y() <<
"\t";
194 out2 <<
"# ID\tCITY\tTYPE\tNAME\tgeo_x1\tgeo_y1\t[geo_x2 geo_y2 ...]\n";
196 for (std::map<std::string, SUMO::Polygon*>::const_iterator i =
myPolygons.getMyMap().begin(); i !=
myPolygons.getMyMap().end(); ++i) {
199 out2 << i->second->getType() <<
"\t";
200 out2 << i->first <<
"\t";
203 for (
int i = 0; i < (int) shape.size(); i++) {
207 out2 << pos.
x() <<
"\t";
208 out2 << pos.
y() <<
"\t";
void close()
Closes the device and removes it from the dictionary.
static void writeLocation(OutputDevice &into)
writes the location element
PCPolyContainer(bool prune, const Boundary &pruningBoundary, const std::vector< std::string > &removeByNames)
Constructor.
void saveDlrTDP(const std::string &prefix)
Saves the stored polygons and pois into the given file in dlrTDP format.
double y() const
Returns the y-position.
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
Polygons myPolygons
stored Polygons
double x() const
Returns the x-position.
void save(const std::string &file, bool useGeo)
Saves the stored polygons and pois into the given file.
void setPrecision(int precision=gPrecision)
Sets the precison or resets it to default.
const std::string & getID() const
Returns the id.
const PositionVector & getShape() const
Returns whether the shape of the polygon.
A class that stores a 2D geometrical boundary.
#define WRITE_WARNING(msg)
static OptionsCont & getOptions()
Retrieves the options.
void clear()
Removes all items from the container (deletes them, too)
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
Boundary myPruningBoundary
The boundary that described the rectangle within which an object must be in order to be kept...
static methods for processing the coordinates conversion for the current net
bool writeXMLHeader(const std::string &rootElement, const std::string &schemaFile, std::map< SumoXMLAttr, std::string > attrs=std::map< SumoXMLAttr, std::string >())
Writes an XML header with optional configuration.
A point in 2D or 3D with translation and scaling methods.
virtual bool add(SUMO::Polygon *poly, bool ignorePruning=false)
const IDMap & getMyMap() const
~PCPolyContainer()
Destructor.
std::map< std::string, int > myIDEnums
An id to int map for proper enumeration.
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.
bool partialWithin(const AbstractPoly &poly, double offset=0) const
Returns whether the boundary is partially within the given polygon.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
int getEnumIDFor(const std::string &key)
Retuns a unique id for a given name.
bool around(const Position &p, double offset=0) const
Returns whether the boundary contains the given coordinate.
void addLanePos(const std::string &poiID, const std::string &laneID, double lanePos)
A storage for options typed value containers)
std::vector< std::string > myRemoveByNames
List of names of polygons/pois that shall be removed.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
const std::string & getFullName() const
Static storage of an output device and its base (abstract) implementation.
void writeConfiguration(std::ostream &os, const bool filled, const bool complete, const bool addComments, const bool maskDoubleHyphen=false) const
Writes the configuration.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
void mul(double val)
Multiplies both positions with the given value.
std::map< std::string, std::pair< std::string, double > > myLanePosPois
An id to pos map for lane pos specs.
bool myDoPrune
Information whether the pruning boundary shall be used.
static void writeDlrTDPHeader(OutputDevice &device, const OptionsCont &oc)