48 #ifdef CHECK_MEMORY_LEAKS 50 #endif // CHECK_MEMORY_LEAKS 58 const std::vector<std::string>& removeByNames)
59 : myPruningBoundary(pruningBoundary), myDoPrune(prune),
60 myRemoveByNames(removeByNames) {}
118 WRITE_WARNING(
"Ignoring option \"proj.plain-geo\" because no geo-conversion has been defined");
130 i->second->writeXML(out, useGeo);
135 std::map<std::string, std::pair<std::string, SUMOReal> >::const_iterator it =
myLanePosPois.find(i->first);
137 i->second->writeXML(out, useGeo, zOffset);
139 i->second->writeXML(out, useGeo, zOffset, it->second.first, it->second.second);
152 strftime(buffer, 80,
"on %c", localtime(&rawtime));
153 device <<
"# Generated " << buffer <<
" by " << oc.
getFullName() <<
"\n";
154 device <<
"# Format matches Extraction version: V" << OUTPUT_VERSION <<
" \n";
155 std::stringstream tmp;
157 tmp.seekg(std::ios_base::beg);
160 std::getline(tmp, line);
161 device <<
"# " << line <<
"\n";
172 const SUMOReal geoScale = pow(10.0f, haveGeo ? 5 : 2);
178 out <<
"# ID\tCITY\tTYPE\tNAME\tgeo_x\tgeo_y\n";
186 out << i->second->getType() <<
"\t";
187 out << i->first <<
"\t";
188 out << pos.
x() <<
"\t";
189 out << pos.
y() <<
"\t";
198 out2 <<
"# ID\tCITY\tTYPE\tNAME\tgeo_x1\tgeo_y1\t[geo_x2 geo_y2 ...]\n";
203 out2 << i->second->getType() <<
"\t";
204 out2 << i->first <<
"\t";
207 for (
int i = 0; i < (int) shape.size(); i++) {
211 out2 << pos.
x() <<
"\t";
212 out2 << pos.
y() <<
"\t";
void close()
Closes the device and removes it from the dictionary.
static void writeLocation(OutputDevice &into)
writes the location element
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
bool around(const Position &p, SUMOReal offset=0) const
Returns whether the boundary contains the given coordinate.
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.
const PositionVector & getShape() const
Returns whether the shape of the polygon.
bool partialWithin(const AbstractPoly &poly, SUMOReal offset=0) const
Returns whether the boundary is partially within the given polygon.
Polygons myPolygons
stored Polygons
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.
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
const std::string & getFullName() const
SUMOReal x() const
Returns the x-position.
A class that stores a 2D geometrical boundary.
#define WRITE_WARNING(msg)
static OptionsCont & getOptions()
Retrieves the options.
void writeConfiguration(std::ostream &os, const bool filled, const bool complete, const bool addComments, const bool maskDoubleHyphen=false) const
Writes the configuration.
void clear()
Removes all items from the container (deletes them, too)
Boundary myPruningBoundary
The boundary that described the rectangle within which an object must be in order to be kept...
const std::string & getID() const
Returns the id.
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
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)
~PCPolyContainer()
Destructor.
std::map< std::string, int > myIDEnums
An id to int map for proper enumeration.
bool add(SUMO::Polygon *poly, bool ignorePruning=false)
Adds a polygon to the storage.
const IDMap & getMyMap() const
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.
SUMOReal y() const
Returns the y-position.
void addLanePos(const std::string &poiID, const std::string &laneID, SUMOReal lanePos)
A storage for options typed value containers)
std::map< std::string, std::pair< std::string, SUMOReal > > myLanePosPois
An id to pos map for lane pos specs.
std::vector< std::string > myRemoveByNames
List of names of polygons/pois that shall be removed.
void mul(SUMOReal val)
Multiplies both positions with the given value.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
Static storage of an output device and its base (abstract) implementation.
bool myDoPrune
Information whether the pruning boundary shall be used.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
static void writeDlrTDPHeader(OutputDevice &device, const OptionsCont &oc)