45 const std::vector<std::string>& removeByNames)
46 : myPruningBoundary(pruningBoundary), myDoPrune(prune),
47 myRemoveByNames(removeByNames) {}
96PCPolyContainer::addLanePos(
const std::string& poiID,
const std::string& laneID,
const double lanePos,
const bool friendlyPos,
const double lanePosLat) {
105 WRITE_WARNING(
TL(
"Ignoring option \"proj.plain-geo\" because no geo-conversion has been defined"));
117 i.second->writeXML(out, useGeo);
122 std::map<std::string, LanePos>::const_iterator it =
myLanePosPois.find(
POI.first);
124 POI.second->writeXML(out, useGeo, zOffset);
126 POI.second->writeXML(out, useGeo, zOffset, it->second.laneID, it->second.pos, it->second.friendlyPos, it->second.posLat);
135 device <<
"# Format matches Extraction version: V6.5 \n";
136 std::stringstream tmp;
138 tmp.seekg(std::ios_base::beg);
141 std::getline(tmp, line);
142 device <<
"# " << line <<
"\n";
153 const double geoScale = pow(10.0f, haveGeo ? 5 : 2);
159 out <<
"# ID\tCITY\tTYPE\tNAME\tgeo_x\tgeo_y\n";
161 for (
const auto& i :
myPOIs) {
167 out << i.second->getShapeType() <<
"\t";
168 out << i.first <<
"\t";
169 out << pos.
x() <<
"\t";
170 out << pos.
y() <<
"\t";
179 out2 <<
"# ID\tCITY\tTYPE\tNAME\tgeo_x1\tgeo_y1\t[geo_x2 geo_y2 ...]\n";
184 out2 << i.second->getShapeType() <<
"\t";
185 out2 << i.first <<
"\t";
187 for (
Position pos : i.second->getShape()) {
190 out2 << pos.x() <<
"\t";
191 out2 << pos.y() <<
"\t";
215 friendlyPos(_friendlyPos),
#define WRITE_WARNING(msg)
A class that stores a 2D geometrical boundary.
bool partialWithin(const AbstractPoly &poly, double offset=0) const
Returns whether the boundary is partially within the given polygon.
bool around(const Position &p, double offset=0) const
Returns whether the boundary contains the given coordinate.
static methods for processing the coordinates conversion for the current net
static void writeLocation(OutputDevice &into)
writes the location element
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
const std::string & getID() const
Returns the id.
void clear()
Removes all items from the container (deletes them, too)
A storage for options typed value containers)
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
void writeConfiguration(std::ostream &os, const bool filled, const bool complete, const bool addComments, const std::string &relativeTo="", const bool forceRelative=false, const bool inComment=false) const
Writes the configuration.
static OptionsCont & getOptions()
Retrieves the options.
Static storage of an output device and its base (abstract) implementation.
void close()
Closes the device and removes it from the dictionary.
void setPrecision(int precision=gPrecision)
Sets the precision or resets it to default.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.
bool writeXMLHeader(const std::string &rootElement, const std::string &schemaFile, std::map< SumoXMLAttr, std::string > attrs=std::map< SumoXMLAttr, std::string >(), bool includeConfig=true)
Writes an XML header with optional configuration.
std::map< std::string, LanePos > myLanePosPois
An id to pos map for lane pos specs.
static void writeDlrTDPHeader(OutputDevice &device, const OptionsCont &oc)
write DLR TDP Header
bool myDoPrune
Information whether the pruning boundary shall be used.
~PCPolyContainer()
Destructor.
void save(const std::string &file, bool useGeo)
Saves the stored polygons and pois into the given file.
bool add(SUMOPolygon *poly, bool ignorePruning=false)
Adds a polygon to the storage.
void saveDlrTDP(const std::string &prefix)
Saves the stored polygons and pois into the given file in dlrTDP format.
std::vector< std::string > myRemoveByNames
List of names of polygons/pois that shall be removed.
PCPolyContainer(bool prune, const Boundary &pruningBoundary, const std::vector< std::string > &removeByNames)
Constructor.
std::map< std::string, int > myIDEnums
An id to int map for proper enumeration.
int getEnumIDFor(const std::string &key)
Retuns a unique id for a given name.
void addLanePos(const std::string &poiID, const std::string &laneID, const double lanePos, const bool friendlyPos, const double lanePosLat)
add lane pos
Boundary myPruningBoundary
The boundary that described the rectangle within which an object must be in order to be kept.
C++ TraCI client API implementation.
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
void mul(double val)
Multiplies position with the given value.
double y() const
Returns the y-position.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
const PositionVector & getShape() const
Returns the shape of the polygon.
virtual bool add(SUMOPolygon *poly, bool ignorePruning=false)
add polygon
Polygons myPolygons
stored Polygons
LanePos()
default constructor