 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
46 const std::vector<std::string>& removeByNames)
47 : myPruningBoundary(pruningBoundary), myDoPrune(prune),
48 myRemoveByNames(removeByNames) {}
106 WRITE_WARNING(
"Ignoring option \"proj.plain-geo\" because no geo-conversion has been defined");
118 i.second->writeXML(out, useGeo);
123 std::map<std::string, LanePos>::const_iterator it =
myLanePosPois.find(i.first);
125 i.second->writeXML(out, useGeo, zOffset);
127 i.second->writeXML(out, useGeo, zOffset, it->second.laneID, it->second.pos, it->second.posLat);
136 device <<
"# Format matches Extraction version: V6.5 \n";
137 std::stringstream tmp;
139 tmp.seekg(std::ios_base::beg);
142 std::getline(tmp, line);
143 device <<
"# " << line <<
"\n";
154 const double geoScale = pow(10.0f, haveGeo ? 5 : 2);
160 out <<
"# ID\tCITY\tTYPE\tNAME\tgeo_x\tgeo_y\n";
162 for (
const auto& i :
myPOIs) {
168 out << i.second->getShapeType() <<
"\t";
169 out << i.first <<
"\t";
170 out << pos.
x() <<
"\t";
171 out << pos.
y() <<
"\t";
180 out2 <<
"# ID\tCITY\tTYPE\tNAME\tgeo_x1\tgeo_y1\t[geo_x2 geo_y2 ...]\n";
185 out2 << i.second->getShapeType() <<
"\t";
186 out2 << i.first <<
"\t";
189 for (
int i = 0; i < (int) shape.size(); i++) {
193 out2 << pos.
x() <<
"\t";
194 out2 << pos.
y() <<
"\t";
static void writeLocation(OutputDevice &into)
writes the location element
void saveDlrTDP(const std::string &prefix)
Saves the stored polygons and pois into the given file in dlrTDP format.
#define WRITE_WARNING(msg)
Static storage of an output device and its base (abstract) implementation.
virtual bool add(SUMOPolygon *poly, bool ignorePruning=false)
add polygon
void setPrecision(int precision=gPrecision)
Sets the precison or resets it to default.
int getEnumIDFor(const std::string &key)
Retuns a unique id for a given name.
PCPolyContainer(bool prune, const Boundary &pruningBoundary, const std::vector< std::string > &removeByNames)
Constructor.
bool partialWithin(const AbstractPoly &poly, double offset=0) const
Returns whether the boundary is partially within the given polygon.
static OptionsCont & getOptions()
Retrieves the options.
bool around(const Position &p, double offset=0) const
Returns whether the AbstractPoly the given coordinate.
void addLanePos(const std::string &poiID, const std::string &laneID, double lanePos, double lanePosLat)
static void writeDlrTDPHeader(OutputDevice &device, const OptionsCont &oc)
void close()
Closes the device and removes it from the dictionary.
static methods for processing the coordinates conversion for the current net
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
bool add(SUMOPolygon *poly, bool ignorePruning=false)
Adds a polygon to the storage.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
~PCPolyContainer()
Destructor.
A class that stores a 2D geometrical boundary.
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
A storage for options typed value containers)
void mul(double val)
Multiplies both positions with the given value.
const PositionVector & getShape() const
Returns whether the shape of the polygon.
Boundary myPruningBoundary
The boundary that described the rectangle within which an object must be in order to be kept.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
bool myDoPrune
Information whether the pruning boundary shall be used.
void save(const std::string &file, bool useGeo)
Saves the stored polygons and pois into the given file.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
double y() const
Returns the y-position.
std::vector< std::string > myRemoveByNames
List of names of polygons/pois that shall be removed.
std::map< std::string, int > myIDEnums
An id to int map for proper enumeration.
std::map< std::string, LanePos > myLanePosPois
An id to pos map for lane pos specs.
void clear()
Removes all items from the container (deletes them, too)
void writeConfiguration(std::ostream &os, const bool filled, const bool complete, const bool addComments, const bool inComment=false) const
Writes the configuration.
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.
const std::string & getID() const
Returns the id.
Polygons myPolygons
stored Polygons