|
SUMO - Simulation of Urban MObility
|
static methods for processing the coordinates conversion for the current net More...
#include <GeoConvHelper.h>
Public Member Functions | |
| void | cartesian2geo (Position &cartesian) |
| Converts the given cartesian (shifted) position to its geo (lat/long) representation. | |
| GeoConvHelper (OptionsCont &oc) | |
| Constructor based on the stored options. | |
| GeoConvHelper (const std::string &proj, const Position &offset, const Boundary &orig, const Boundary &conv, int shift=0, bool inverse=false, bool baseFound=false) | |
| Constructor. | |
| const Boundary & | getConvBoundary () const |
| Returns the converted boundary. | |
| const Position | getOffset () const |
| Returns the network offset. | |
| const Position | getOffsetBase () const |
| Returns the network base. | |
| const Boundary & | getOrigBoundary () const |
| Returns the original boundary. | |
| const std::string & | getProjString () const |
| Returns the network offset. | |
| void | moveConvertedBy (SUMOReal x, SUMOReal y) |
| Shifts the converted boundary by the given amounts. | |
| bool | usingGeoProjection () const |
| Returns whether a transformation from geo to metric coordinates will be performed. | |
| bool | usingInverseGeoProjection () const |
| Returns the information whether an inverse transformation will happen. | |
| bool | x2cartesian (Position &from, bool includeInBoundary=true) |
| Converts the given coordinate into a cartesian using the previous initialisation. | |
| ~GeoConvHelper () | |
| Destructor. | |
Static Public Member Functions | |
| static void | addProjectionOptions (OptionsCont &oc) |
| Adds projection options to the given container. | |
| static GeoConvHelper & | getDefaultInstance () |
| the coordinate transformation to use for input conversion | |
| static const GeoConvHelper & | getOutputInstance () |
| the coordinate transformation for writing the location element | |
| static bool | init (OptionsCont &oc) |
| Initialises the default and the output instance using the given options. | |
| static void | init (const std::string &proj, const Position &offset, const Boundary &orig, const Boundary &conv) |
| Initialises the default and the output instance using the given proj.4-definition and complete network parameter. | |
| static void | setLoaded (const GeoConvHelper &loaded) |
| sets the coordinate transformation loaded from a location element | |
Private Types | |
| enum | ProjectionMethod { NONE, SIMPLE, UTM, DHDN, PROJ } |
Private Member Functions | |
| GeoConvHelper (const GeoConvHelper &) | |
| invalidated copy constructor. | |
| GeoConvHelper & | operator= (const GeoConvHelper &) |
| assignment operator. | |
Private Attributes | |
| bool | myBaseFound |
| Information whether the first node conversion was done. | |
| double | myBaseX |
| The initial x/y-coordinates for a very simple geocoordinates conversion. | |
| double | myBaseY |
| Boundary | myConvBoundary |
| The boundary after conversion (x2cartesian) | |
| double | myGeoScale |
| The scaling to apply to geo-coordinates. | |
| Position | myOffset |
| The offset to apply. | |
| Boundary | myOrigBoundary |
| The boundary before conversion (x2cartesian) | |
| ProjectionMethod | myProjectionMethod |
| Information whether no projection shall be done. | |
| std::string | myProjString |
| A proj options string describing the proj.4-projection to use. | |
| bool | myUseInverseProjection |
| Information whether inverse projection shall be used. | |
Static Private Attributes | |
| static GeoConvHelper | myDefault |
| coordinate transformation to use for input conversion | |
| static GeoConvHelper | myLoaded |
| coordinate transformation loaded from a location element | |
| static int | myNumLoaded = 0 |
| the numer of coordinate transformations loaded from location elements | |
| static GeoConvHelper | myOutput |
| coordinate transformation to use for writing location element | |
static methods for processing the coordinates conversion for the current net
Definition at line 55 of file GeoConvHelper.h.
enum GeoConvHelper::ProjectionMethod [private] |
Definition at line 139 of file GeoConvHelper.h.
| GeoConvHelper::GeoConvHelper | ( | OptionsCont & | oc | ) |
Constructor based on the stored options.
| [in] | oc | The OptionsCont from which to read options |
Referenced by getOutputInstance(), and init().
| GeoConvHelper::GeoConvHelper | ( | const std::string & | proj, |
| const Position & | offset, | ||
| const Boundary & | orig, | ||
| const Boundary & | conv, | ||
| int | shift = 0, |
||
| bool | inverse = false, |
||
| bool | baseFound = false |
||
| ) |
Constructor.
Definition at line 55 of file GeoConvHelper.cpp.
References DHDN, myProjectionMethod, NONE, PROJ, SIMPLE, and UTM.
| GeoConvHelper::~GeoConvHelper | ( | ) |
Destructor.
Definition at line 91 of file GeoConvHelper.cpp.
| GeoConvHelper::GeoConvHelper | ( | const GeoConvHelper & | ) | [private] |
invalidated copy constructor.
| void GeoConvHelper::addProjectionOptions | ( | OptionsCont & | oc | ) | [static] |
Adds projection options to the given container.
| [in] | oc | The options container to add the options to |
Definition at line 199 of file GeoConvHelper.cpp.
References OptionsCont::addDescription(), OptionsCont::addOptionSubTopic(), OptionsCont::addSynonyme(), and OptionsCont::doRegister().
Referenced by fillOptions().
| void GeoConvHelper::cartesian2geo | ( | Position & | cartesian | ) |
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
Definition at line 239 of file GeoConvHelper.cpp.
References myOffset, myProjectionMethod, NONE, Position::set(), Position::sub(), SUMOReal, Position::x(), and Position::y().
Referenced by TraCIServerAPI_Simulation::commandPositionConversion(), MSVTypeProbe::execute(), GUIGLObjectPopupMenu::onCmdCopyCursorGeoPosition(), NILoader::transformCoordinates(), GUISUMOAbstractView::updatePositionInformation(), and x2cartesian().
| const Boundary & GeoConvHelper::getConvBoundary | ( | ) | const |
Returns the converted boundary.
Definition at line 338 of file GeoConvHelper.cpp.
References myConvBoundary.
Referenced by NBNetBuilder::compute(), getOutputInstance(), TraCIServerAPI_Simulation::processGet(), and NWWriter_SUMO::writeLocation().
| static GeoConvHelper& GeoConvHelper::getDefaultInstance | ( | ) | [inline, static] |
the coordinate transformation to use for input conversion
Definition at line 92 of file GeoConvHelper.h.
References myDefault.
Referenced by NGNode::buildNBNode(), GUIGlObject::buildPositionCopyEntry(), TraCIServerAPI_Simulation::commandPositionConversion(), NBNetBuilder::compute(), MSVTypeProbe::execute(), PCLoaderVisum::load(), PCLoaderArcView::load(), NILoader::load(), PCLoaderOSM::loadIfSet(), PCLoaderDlrNavteq::loadPOIFile(), PCLoaderDlrNavteq::loadPolyFile(), PCLoaderXML::myCharacters(), PCLoaderXML::myStartElement(), GUIGLObjectPopupMenu::onCmdCopyCursorGeoPosition(), TraCIServerAPI_Simulation::processGet(), NILoader::transformCoordinates(), and GUISUMOAbstractView::updatePositionInformation().
| const Position GeoConvHelper::getOffset | ( | ) | const |
Returns the network offset.
Definition at line 344 of file GeoConvHelper.cpp.
References myOffset.
Referenced by getOutputInstance().
| const Position GeoConvHelper::getOffsetBase | ( | ) | const |
Returns the network base.
Definition at line 350 of file GeoConvHelper.cpp.
References myBaseX, myBaseY, myOffset, Position::x(), and Position::y().
Referenced by NBNetBuilder::compute(), and NWWriter_SUMO::writeLocation().
| const Boundary & GeoConvHelper::getOrigBoundary | ( | ) | const |
Returns the original boundary.
Definition at line 332 of file GeoConvHelper.cpp.
References myOrigBoundary.
Referenced by NBNetBuilder::compute(), getOutputInstance(), and NWWriter_SUMO::writeLocation().
| const GeoConvHelper & GeoConvHelper::getOutputInstance | ( | ) | [static] |
the coordinate transformation for writing the location element
Definition at line 362 of file GeoConvHelper.cpp.
References GeoConvHelper(), getConvBoundary(), getOffset(), getOrigBoundary(), getProjString(), myDefault, myLoaded, myNumLoaded, myOutput, usingGeoProjection(), and WRITE_WARNING.
Referenced by NWWriter_XML::writeEdgesAndConnections(), NWWriter_SUMO::writeLocation(), and NWWriter_XML::writeNodes().
| const std::string & GeoConvHelper::getProjString | ( | ) | const |
Returns the network offset.
Definition at line 356 of file GeoConvHelper.cpp.
References myProjString.
Referenced by getOutputInstance(), and NWWriter_SUMO::writeLocation().
| bool GeoConvHelper::init | ( | OptionsCont & | oc | ) | [static] |
Initialises the default and the output instance using the given options.
Definition at line 123 of file GeoConvHelper.cpp.
References OptionsCont::exists(), GeoConvHelper(), OptionsCont::getBool(), OptionsCont::getFloat(), OptionsCont::getInt(), OptionsCont::getString(), OptionsCont::isDefault(), myDefault, and WRITE_ERROR.
Referenced by NILoader::load(), main(), and NLHandler::setLocation().
| void GeoConvHelper::init | ( | const std::string & | proj, |
| const Position & | offset, | ||
| const Boundary & | orig, | ||
| const Boundary & | conv | ||
| ) | [static] |
Initialises the default and the output instance using the given proj.4-definition and complete network parameter.
Definition at line 162 of file GeoConvHelper.cpp.
References GeoConvHelper(), and myDefault.
| void GeoConvHelper::moveConvertedBy | ( | SUMOReal | x, |
| SUMOReal | y | ||
| ) |
Shifts the converted boundary by the given amounts.
Definition at line 325 of file GeoConvHelper.cpp.
References Position::add(), Boundary::moveby(), myConvBoundary, and myOffset.
Referenced by NBNetBuilder::compute().
| GeoConvHelper & GeoConvHelper::operator= | ( | const GeoConvHelper & | orig | ) | [private] |
assignment operator.
Definition at line 101 of file GeoConvHelper.cpp.
References myBaseFound, myBaseX, myBaseY, myConvBoundary, myGeoScale, myOffset, myOrigBoundary, myProjectionMethod, myProjString, myUseInverseProjection, and PROJ.
| static void GeoConvHelper::setLoaded | ( | const GeoConvHelper & | loaded | ) | [inline, static] |
sets the coordinate transformation loaded from a location element
Definition at line 103 of file GeoConvHelper.h.
References myLoaded, and myNumLoaded.
Referenced by NIImporter_SUMO::setLocation().
| bool GeoConvHelper::usingGeoProjection | ( | ) | const |
Returns whether a transformation from geo to metric coordinates will be performed.
Definition at line 227 of file GeoConvHelper.cpp.
References myProjectionMethod, and NONE.
Referenced by getOutputInstance(), NILoader::transformCoordinates(), and NWWriter_SUMO::writeLocation().
| bool GeoConvHelper::usingInverseGeoProjection | ( | ) | const |
Returns the information whether an inverse transformation will happen.
Definition at line 233 of file GeoConvHelper.cpp.
References myUseInverseProjection.
Referenced by NWWriter_XML::writeEdgesAndConnections(), and NWWriter_XML::writeNodes().
Converts the given coordinate into a cartesian using the previous initialisation.
!! recheck whether the axes are mirrored
Definition at line 258 of file GeoConvHelper.cpp.
References Position::add(), Boundary::add(), cartesian2geo(), myBaseFound, myBaseX, myBaseY, myConvBoundary, myGeoScale, myOffset, myOrigBoundary, myProjectionMethod, myUseInverseProjection, NONE, PI, Position::set(), SIMPLE, SUMOReal, Position::x(), and Position::y().
Referenced by NGNode::buildNBNode(), TraCIServerAPI_Simulation::commandPositionConversion(), PCLoaderVisum::load(), PCLoaderArcView::load(), and NILoader::transformCoordinates().
bool GeoConvHelper::myBaseFound [private] |
Information whether the first node conversion was done.
Definition at line 168 of file GeoConvHelper.h.
Referenced by operator=(), and x2cartesian().
double GeoConvHelper::myBaseX [private] |
The initial x/y-coordinates for a very simple geocoordinates conversion.
Definition at line 171 of file GeoConvHelper.h.
Referenced by getOffsetBase(), operator=(), and x2cartesian().
double GeoConvHelper::myBaseY [private] |
Definition at line 171 of file GeoConvHelper.h.
Referenced by getOffsetBase(), operator=(), and x2cartesian().
Boundary GeoConvHelper::myConvBoundary [private] |
The boundary after conversion (x2cartesian)
Definition at line 177 of file GeoConvHelper.h.
Referenced by getConvBoundary(), moveConvertedBy(), operator=(), and x2cartesian().
GeoConvHelper GeoConvHelper::myDefault [static, private] |
coordinate transformation to use for input conversion
Definition at line 185 of file GeoConvHelper.h.
Referenced by getDefaultInstance(), getOutputInstance(), and init().
double GeoConvHelper::myGeoScale [private] |
The scaling to apply to geo-coordinates.
Definition at line 159 of file GeoConvHelper.h.
Referenced by operator=(), and x2cartesian().
GeoConvHelper GeoConvHelper::myLoaded [static, private] |
coordinate transformation loaded from a location element
Definition at line 188 of file GeoConvHelper.h.
Referenced by getOutputInstance(), and setLoaded().
int GeoConvHelper::myNumLoaded = 0 [static, private] |
the numer of coordinate transformations loaded from location elements
Definition at line 194 of file GeoConvHelper.h.
Referenced by getOutputInstance(), and setLoaded().
Position GeoConvHelper::myOffset [private] |
The offset to apply.
Definition at line 156 of file GeoConvHelper.h.
Referenced by cartesian2geo(), getOffset(), getOffsetBase(), moveConvertedBy(), operator=(), and x2cartesian().
Boundary GeoConvHelper::myOrigBoundary [private] |
The boundary before conversion (x2cartesian)
Definition at line 174 of file GeoConvHelper.h.
Referenced by getOrigBoundary(), operator=(), and x2cartesian().
GeoConvHelper GeoConvHelper::myOutput [static, private] |
coordinate transformation to use for writing location element
Definition at line 191 of file GeoConvHelper.h.
Referenced by getOutputInstance().
Information whether no projection shall be done.
Definition at line 162 of file GeoConvHelper.h.
Referenced by cartesian2geo(), GeoConvHelper(), operator=(), usingGeoProjection(), and x2cartesian().
std::string GeoConvHelper::myProjString [private] |
A proj options string describing the proj.4-projection to use.
Definition at line 148 of file GeoConvHelper.h.
Referenced by getProjString(), and operator=().
bool GeoConvHelper::myUseInverseProjection [private] |
Information whether inverse projection shall be used.
Definition at line 165 of file GeoConvHelper.h.
Referenced by operator=(), usingInverseGeoProjection(), and x2cartesian().