CARLA
Loading...
Searching...
No Matches
twinmodel::LocalFrame Class Reference

WGS84 <-> local ENU metres, a transverse Mercator centred on the origin. More...

#include <Frame.h>

Public Member Functions

double GetOriginLatitude () const
double GetOriginLongitude () const
std::string GetProjString () const
 The +proj string written as the OpenDRIVE <geoReference>.
 LocalFrame ()=default
 LocalFrame (double origin_lat, double origin_lon)
void ToLocal (double lon, double lat, double &x, double &y) const
void ToWGS84 (double x, double y, double &lon, double &lat) const

Static Public Member Functions

static LocalFrame FromBoundingBox (double south, double west, double north, double east)

Private Attributes

double _origin_lat = 0.0
double _origin_lon = 0.0

Detailed Description

WGS84 <-> local ENU metres, a transverse Mercator centred on the origin.

Ported from twinmodel/frame.py, which gets the same projection from pyproj.

Definition at line 15 of file Frame.h.

Constructor & Destructor Documentation

◆ LocalFrame() [1/2]

twinmodel::LocalFrame::LocalFrame ( )
default

Referenced by FromBoundingBox().

◆ LocalFrame() [2/2]

twinmodel::LocalFrame::LocalFrame ( double origin_lat,
double origin_lon )
inline

Definition at line 20 of file Frame.h.

References _origin_lat, and _origin_lon.

Member Function Documentation

◆ FromBoundingBox()

LocalFrame twinmodel::LocalFrame::FromBoundingBox ( double south,
double west,
double north,
double east )
inlinestatic

Definition at line 23 of file Frame.h.

References LocalFrame().

◆ GetOriginLatitude()

double twinmodel::LocalFrame::GetOriginLatitude ( ) const
inline

Definition at line 27 of file Frame.h.

References _origin_lat.

Referenced by twinmodel::BuildLaneGraph().

◆ GetOriginLongitude()

double twinmodel::LocalFrame::GetOriginLongitude ( ) const
inline

Definition at line 28 of file Frame.h.

References _origin_lon.

Referenced by twinmodel::BuildLaneGraph().

◆ GetProjString()

std::string twinmodel::LocalFrame::GetProjString ( ) const

The +proj string written as the OpenDRIVE <geoReference>.

Definition at line 26 of file Frame.cpp.

References _origin_lat, and _origin_lon.

Referenced by twinmodel::ExportXodr().

◆ ToLocal()

void twinmodel::LocalFrame::ToLocal ( double lon,
double lat,
double & x,
double & y ) const

◆ ToWGS84()

void twinmodel::LocalFrame::ToWGS84 ( double x,
double y,
double & lon,
double & lat ) const

Definition at line 64 of file Frame.cpp.

References _origin_lat, and _origin_lon.

Member Data Documentation

◆ _origin_lat

double twinmodel::LocalFrame::_origin_lat = 0.0
private

Definition at line 38 of file Frame.h.

Referenced by GetOriginLatitude(), GetProjString(), LocalFrame(), ToLocal(), and ToWGS84().

◆ _origin_lon

double twinmodel::LocalFrame::_origin_lon = 0.0
private

Definition at line 39 of file Frame.h.

Referenced by GetOriginLongitude(), GetProjString(), LocalFrame(), ToLocal(), and ToWGS84().


The documentation for this class was generated from the following files: