Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | Related Functions | List of all members
vpgl_lvcs Class Reference

#include <vpgl_lvcs.h>

Inheritance diagram for vpgl_lvcs:
Inheritance graph
[legend]

Public Types

enum  LenUnits { FEET, METERS }
 
enum  AngUnits { RADIANS, DEG }
 
enum  cs_names {
  wgs84 =0, nad27n, wgs72, utm,
  NumNames
}
 

Public Member Functions

 vpgl_lvcs (double orig_lat=0, double orig_lon=0, double orig_elev=0, cs_names cs_name=wgs84, double lat_scale=0, double lon_scale=0, AngUnits ang_unit=DEG, LenUnits len_unit=METERS, double lox=0, double loy=0, double theta=0)
 Radians from y axis to north in local co-ordinates. More...
 
 vpgl_lvcs (double orig_lat, double orig_lon, double orig_elev, cs_names cs_name, AngUnits ang_unit=DEG, LenUnits len_unit=METERS)
 A simplified constructor that takes the origin and specified coordinate system. More...
 
 vpgl_lvcs (double lat_low, double lon_low, double lat_high, double lon_high, double elev, cs_names cs_name=wgs84, AngUnits ang_unit=DEG, LenUnits elev_unit=METERS)
 This constructor takes a lat-lon bounding box and erects a local vertical coordinate system at the center. More...
 
 vpgl_lvcs (const vpgl_lvcs &)
 
vpgl_lvcsoperator= (const vpgl_lvcs &)
 
void local_to_global (const double lx, const double ly, const double lz, cs_names cs_name, double &lon, double &lat, double &gz, AngUnits output_ang_unit=DEG, LenUnits output_len_unit=METERS)
 Converts pointin, given in local vertical coord system, to pointout in the global coord system given by the string lobalcs_name. More...
 
void global_to_local (const double lon, const double lat, const double gz, cs_names cs_name, double &lx, double &ly, double &lz, AngUnits output_ang_unit=DEG, LenUnits output_len_unit=METERS)
 Converts pointin, given in a global coord system described by global_cs_name, to pointout in the local vertical coord system. More...
 
void radians_to_degrees (double &lon, double &lat, double &z)
 
double radians_to_degrees (const double val)
 
void degrees_to_dms (double, int &degrees, int &minutes, double &seconds)
 
void radians_to_dms (double, int &degrees, int &minutes, double &seconds)
 
void angle_diff_to_cartesian_vector (const double lon0, const double lat0, const double lon1, const double lat1, double &cart_dx, double &cart_dy)
 
void get_origin (double &lat, double &lon, double &elev) const
 return the origin of the local system. More...
 
void get_scale (double &lat, double &lon) const
 return the scale for lat lon and elevation. More...
 
void get_transform (double &lox, double &loy, double &theta) const
 Return the compass alignment transform. More...
 
void set_transform (const double lox, const double loy, const double theta)
 Set the compass alignment transform. More...
 
void set_origin (const double lon, const double lat, const double elev)
 Set the origin of the local system. More...
 
cs_names get_cs_name () const
 return the coordinate system. More...
 
LenUnits local_length_unit () const
 
AngUnits geo_angle_unit () const
 
void print (std::ostream &) const
 Print internals on strm. More...
 
bool save (std::string fname)
 
void read (std::istream &strm)
 Read internals from strm. More...
 
void write (std::ostream &strm)
 
bool operator== (vpgl_lvcs const &r) const
 
void get_utm_origin (double &x, double &y, double &elev, int &zone) const
 
void b_write (vsl_b_ostream &os) const
 Binary save self to stream. More...
 
void b_read (vsl_b_istream &is)
 Binary load self from stream. More...
 
short version () const
 Return IO version number;. More...
 
void ref ()
 
void unref ()
 
long get_references () const
 
bool is_referenced () const
 

Static Public Member Functions

static vpgl_lvcs::cs_names str_to_enum (const char *)
 

Static Public Attributes

static VPGL_EXPORT const char * cs_name_strings [] = { "wgs84", "nad27n", "wgs72", "utm"}
 

Protected Member Functions

void compute_scale ()
 
void local_transform (double &x, double &y)
 Transform from local co-ordinates to north=y,east=x. More...
 
void inverse_local_transform (double &x, double &y)
 Transform from north=y,east=x aligned axes to local co-ordinates. More...
 
void set_angle_conversions (AngUnits ang_unit, double &to_radians, double &to_degrees)
 
void set_length_conversions (LenUnits len_unit, double &to_meters, double &to_feet)
 

Protected Attributes

cs_names local_cs_name_
 Name of local frame's coord system ("nad27n", "wgs84" etc.) More...
 
double localCSOriginLat_
 Lat (in geo_angle_unit_) of the origin. More...
 
double localCSOriginLon_
 Lon (in geo_angle_unit_) of the origin. More...
 
double localCSOriginElev_
 Elev (in localXYZUnit_) of the origin. More...
 
double lat_scale_
 radians/meter along lat at the origin) More...
 
double lon_scale_
 radians/meter along lon at the origin) More...
 
AngUnits geo_angle_unit_
 lat lon angle unit (degrees or radians) More...
 
LenUnits localXYZUnit_
 Input (x,y,z) unit (meters or feet) in local CS. More...
 
double lox_
 Origin in local co-ordinates. More...
 
double loy_
 Origin in local co-ordinates. More...
 
double theta_
 Direction of north in radians. More...
 
double localUTMOrigin_X_East_
 
double localUTMOrigin_Y_North_
 
int localUTMOrigin_Zone_
 

Friends

std::ostream & operator<< (std::ostream &os, const vpgl_lvcs &local_coord_sys)
 
std::istream & operator >> (std::istream &os, vpgl_lvcs &local_coord_sys)
 

Related Functions

(Note that these are not member functions.)

void x_write (std::ostream &os, vpgl_lvcs const &v, std::string element_name="vpgl_lvcs")
 XML save vpgl_lvcs to stream. More...
 

Detailed Description

Definition at line 48 of file vpgl_lvcs.h.

Member Enumeration Documentation

◆ AngUnits

Enumerator
RADIANS 
DEG 

Definition at line 54 of file vpgl_lvcs.h.

◆ cs_names

Enumerator
wgs84 
nad27n 
wgs72 
utm 
NumNames 

Definition at line 55 of file vpgl_lvcs.h.

◆ LenUnits

Enumerator
FEET 
METERS 

Definition at line 53 of file vpgl_lvcs.h.

Constructor & Destructor Documentation

◆ vpgl_lvcs() [1/4]

vpgl_lvcs::vpgl_lvcs ( double  orig_lat = 0,
double  orig_lon = 0,
double  orig_elev = 0,
cs_names  cs_name = wgs84,
double  lat_scale = 0,
double  lon_scale = 0,
AngUnits  ang_unit = DEG,
LenUnits  len_unit = METERS,
double  lox = 0,
double  loy = 0,
double  theta = 0 
)

Radians from y axis to north in local co-ordinates.

the origin is still given in wgs84.

Parameters
orig_latlatitude of LVCS orig in radians.
orig_lonlongitude of LVCS orig in radians.
orig_elevelev of orig LVCS in radians.
cs_namenad27n, wgs84, wgs72 or utm
lat_scaleradians/meter along lat (custom geoid)
lon_scaleradians/meter along lon (custom geoid)
ang_unitangle units
len_unitinput in LVCS in these length units.
loxOrigin in local co-ordinates.
loyOrigin in local co-ordinates.

Definition at line 91 of file vpgl_lvcs.cxx.

◆ vpgl_lvcs() [2/4]

vpgl_lvcs::vpgl_lvcs ( double  orig_lat,
double  orig_lon,
double  orig_elev,
cs_names  cs_name,
AngUnits  ang_unit = DEG,
LenUnits  len_unit = METERS 
)

A simplified constructor that takes the origin and specified coordinate system.

The units of the input latitude and longitude values are assumed to be the same as specified by ang_unit. Similarly, the unit of elevation is specified by elev_unit. The local cartesian system is aligned with North and East

the origin is still given in wgs84.

Parameters
orig_elevsimplified interface

Definition at line 134 of file vpgl_lvcs.cxx.

◆ vpgl_lvcs() [3/4]

vpgl_lvcs::vpgl_lvcs ( double  lat_low,
double  lon_low,
double  lat_high,
double  lon_high,
double  elev,
cs_names  cs_name = wgs84,
AngUnits  ang_unit = DEG,
LenUnits  elev_unit = METERS 
)

This constructor takes a lat-lon bounding box and erects a local vertical coordinate system at the center.

The units of the input latitude and longitude values are assumed to be the same as specified by ang_unit. Similarly, the unit of elevation is specified by elev_unit. The local cartesian system is aligned with North and East

the origin is still given in wgs84.

Parameters
lon_lowlower corner bounding geo_rectangle
lon_highupper corner bounding geo_rectangle
elevelevation of all rectangle corners

Definition at line 166 of file vpgl_lvcs.cxx.

◆ vpgl_lvcs() [4/4]

vpgl_lvcs::vpgl_lvcs ( const vpgl_lvcs lvcs)

Definition at line 48 of file vpgl_lvcs.cxx.

Member Function Documentation

◆ angle_diff_to_cartesian_vector()

void vpgl_lvcs::angle_diff_to_cartesian_vector ( const double  lon0,
const double  lat0,
const double  lon1,
const double  lat1,
double &  cart_dx,
double &  cart_dy 
)
inline

Definition at line 106 of file vpgl_lvcs.h.

◆ b_read()

void vpgl_lvcs::b_read ( vsl_b_istream is)

Binary load self from stream.

Definition at line 995 of file vpgl_lvcs.cxx.

◆ b_write()

void vpgl_lvcs::b_write ( vsl_b_ostream os) const

Binary save self to stream.

Definition at line 974 of file vpgl_lvcs.cxx.

◆ compute_scale()

void vpgl_lvcs::compute_scale ( )
protected

Definition at line 220 of file vpgl_lvcs.cxx.

◆ degrees_to_dms()

void vpgl_lvcs::degrees_to_dms ( double  geoval,
int &  degrees,
int &  minutes,
double &  seconds 
)

Definition at line 208 of file vpgl_lvcs.cxx.

◆ geo_angle_unit()

AngUnits vpgl_lvcs::geo_angle_unit ( ) const
inline

Definition at line 123 of file vpgl_lvcs.h.

◆ get_cs_name()

vpgl_lvcs::cs_names vpgl_lvcs::get_cs_name ( ) const
inline

return the coordinate system.

Definition at line 184 of file vpgl_lvcs.h.

◆ get_origin()

void vpgl_lvcs::get_origin ( double &  lat,
double &  lon,
double &  elev 
) const
inline

return the origin of the local system.

Definition at line 189 of file vpgl_lvcs.h.

◆ get_scale()

void vpgl_lvcs::get_scale ( double &  lat,
double &  lon 
) const
inline

return the scale for lat lon and elevation.

Definition at line 177 of file vpgl_lvcs.h.

◆ get_transform()

void vpgl_lvcs::get_transform ( double &  lox,
double &  loy,
double &  theta 
) const
inline

Return the compass alignment transform.

Definition at line 206 of file vpgl_lvcs.h.

◆ get_utm_origin()

void vpgl_lvcs::get_utm_origin ( double &  x,
double &  y,
double &  elev,
int &  zone 
) const
inline

Definition at line 196 of file vpgl_lvcs.h.

◆ global_to_local()

void vpgl_lvcs::global_to_local ( const double  pointin_lon,
const double  pointin_lat,
const double  pointin_z,
cs_names  global_cs_name,
double &  pointout_x,
double &  pointout_y,
double &  pointout_z,
AngUnits  input_ang_unit = DEG,
LenUnits  input_len_unit = METERS 
)

Converts pointin, given in a global coord system described by global_cs_name, to pointout in the local vertical coord system.

The units of X, Y, Z are specified by input_ang_unit and input_len_unit to define lon, lat, elev in (angle, angle, length). The output point is returned in the units specified by this->localXYZUnit_. If global_cs_name == UTM, pointin_lon is X_East, pointin_lat is Y_North

Definition at line 555 of file vpgl_lvcs.cxx.

◆ inverse_local_transform()

void vpgl_lvcs::inverse_local_transform ( double &  x,
double &  y 
)
protected

Transform from north=y,east=x aligned axes to local co-ordinates.

Definition at line 918 of file vpgl_lvcs.cxx.

◆ local_length_unit()

LenUnits vpgl_lvcs::local_length_unit ( ) const
inline

Definition at line 122 of file vpgl_lvcs.h.

◆ local_to_global()

void vpgl_lvcs::local_to_global ( const double  pointin_x,
const double  pointin_y,
const double  pointin_z,
cs_names  global_cs_name,
double &  pointout_lon,
double &  pointout_lat,
double &  pointout_z,
AngUnits  output_ang_unit = DEG,
LenUnits  output_len_unit = METERS 
)

Converts pointin, given in local vertical coord system, to pointout in the global coord system given by the string lobalcs_name.

X, Y, Z in pointin are assumed to be lengths, in the units specified by this->localXYZUnit_. pointout is written out in [angle, angle, length], as specified by the specified units If global_cs_name == UTM, pointout_lon is X_East, pointout_lat is Y_North If global_cs_name == WGS84, the pointin needs to be at same hemisphere (north or south) as the lvcs origin

Definition at line 350 of file vpgl_lvcs.cxx.

◆ local_transform()

void vpgl_lvcs::local_transform ( double &  x,
double &  y 
)
protected

Transform from local co-ordinates to north=y,east=x.

Definition at line 890 of file vpgl_lvcs.cxx.

◆ operator=()

vpgl_lvcs & vpgl_lvcs::operator= ( const vpgl_lvcs lvcs)

Definition at line 70 of file vpgl_lvcs.cxx.

◆ operator==()

bool vpgl_lvcs::operator== ( vpgl_lvcs const &  r) const

Definition at line 956 of file vpgl_lvcs.cxx.

◆ print()

void vpgl_lvcs::print ( std::ostream &  strm) const

Print internals on strm.

Definition at line 786 of file vpgl_lvcs.cxx.

◆ radians_to_degrees() [1/2]

void vpgl_lvcs::radians_to_degrees ( double &  lon,
double &  lat,
double &  z 
)

Definition at line 201 of file vpgl_lvcs.cxx.

◆ radians_to_degrees() [2/2]

double vpgl_lvcs::radians_to_degrees ( const double  val)

Definition at line 196 of file vpgl_lvcs.cxx.

◆ radians_to_dms()

void vpgl_lvcs::radians_to_dms ( double  rad,
int &  degrees,
int &  minutes,
double &  seconds 
)
inline

Definition at line 232 of file vpgl_lvcs.h.

◆ read()

void vpgl_lvcs::read ( std::istream &  strm)

Read internals from strm.

the origin is still given in wgs84.

Definition at line 805 of file vpgl_lvcs.cxx.

◆ save()

bool vpgl_lvcs::save ( std::string  fname)
inline

Definition at line 125 of file vpgl_lvcs.h.

◆ set_angle_conversions()

void vpgl_lvcs::set_angle_conversions ( AngUnits  ang_unit,
double &  to_radians,
double &  to_degrees 
)
protected

Definition at line 26 of file vpgl_lvcs.cxx.

◆ set_length_conversions()

void vpgl_lvcs::set_length_conversions ( LenUnits  len_unit,
double &  to_meters,
double &  to_feet 
)
protected

Definition at line 37 of file vpgl_lvcs.cxx.

◆ set_origin()

void vpgl_lvcs::set_origin ( const double  lon,
const double  lat,
const double  elev 
)
inline

Set the origin of the local system.

Definition at line 225 of file vpgl_lvcs.h.

◆ set_transform()

void vpgl_lvcs::set_transform ( const double  lox,
const double  loy,
const double  theta 
)
inline

Set the compass alignment transform.

Definition at line 215 of file vpgl_lvcs.h.

◆ str_to_enum()

vpgl_lvcs::cs_names vpgl_lvcs::str_to_enum ( const char *  s)
static

Definition at line 18 of file vpgl_lvcs.cxx.

◆ version()

short vpgl_lvcs::version ( ) const
inline

Return IO version number;.

Definition at line 141 of file vpgl_lvcs.h.

◆ write()

void vpgl_lvcs::write ( std::ostream &  strm)

Definition at line 858 of file vpgl_lvcs.cxx.

Friends And Related Function Documentation

◆ operator >>

std::istream& operator >> ( std::istream &  os,
vpgl_lvcs local_coord_sys 
)
friend

Definition at line 950 of file vpgl_lvcs.cxx.

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const vpgl_lvcs local_coord_sys 
)
friend

Definition at line 944 of file vpgl_lvcs.cxx.

◆ x_write()

void x_write ( std::ostream &  os,
vpgl_lvcs const &  v,
std::string  element_name = "vpgl_lvcs" 
)
related

XML save vpgl_lvcs to stream.

Definition at line 9 of file vpgl_xio_lvcs.cxx.

Member Data Documentation

◆ cs_name_strings

const char * vpgl_lvcs::cs_name_strings = { "wgs84", "nad27n", "wgs72", "utm"}
static

Definition at line 56 of file vpgl_lvcs.h.

◆ geo_angle_unit_

AngUnits vpgl_lvcs::geo_angle_unit_
protected

lat lon angle unit (degrees or radians)

Definition at line 165 of file vpgl_lvcs.h.

◆ lat_scale_

double vpgl_lvcs::lat_scale_
protected

radians/meter along lat at the origin)

Definition at line 163 of file vpgl_lvcs.h.

◆ local_cs_name_

cs_names vpgl_lvcs::local_cs_name_
protected

Name of local frame's coord system ("nad27n", "wgs84" etc.)

Definition at line 159 of file vpgl_lvcs.h.

◆ localCSOriginElev_

double vpgl_lvcs::localCSOriginElev_
protected

Elev (in localXYZUnit_) of the origin.

Definition at line 162 of file vpgl_lvcs.h.

◆ localCSOriginLat_

double vpgl_lvcs::localCSOriginLat_
protected

Lat (in geo_angle_unit_) of the origin.

Definition at line 160 of file vpgl_lvcs.h.

◆ localCSOriginLon_

double vpgl_lvcs::localCSOriginLon_
protected

Lon (in geo_angle_unit_) of the origin.

Definition at line 161 of file vpgl_lvcs.h.

◆ localUTMOrigin_X_East_

double vpgl_lvcs::localUTMOrigin_X_East_
protected

Definition at line 171 of file vpgl_lvcs.h.

◆ localUTMOrigin_Y_North_

double vpgl_lvcs::localUTMOrigin_Y_North_
protected

Definition at line 172 of file vpgl_lvcs.h.

◆ localUTMOrigin_Zone_

int vpgl_lvcs::localUTMOrigin_Zone_
protected

Definition at line 173 of file vpgl_lvcs.h.

◆ localXYZUnit_

LenUnits vpgl_lvcs::localXYZUnit_
protected

Input (x,y,z) unit (meters or feet) in local CS.

Definition at line 166 of file vpgl_lvcs.h.

◆ lon_scale_

double vpgl_lvcs::lon_scale_
protected

radians/meter along lon at the origin)

Definition at line 164 of file vpgl_lvcs.h.

◆ lox_

double vpgl_lvcs::lox_
protected

Origin in local co-ordinates.

Definition at line 167 of file vpgl_lvcs.h.

◆ loy_

double vpgl_lvcs::loy_
protected

Origin in local co-ordinates.

Definition at line 168 of file vpgl_lvcs.h.

◆ theta_

double vpgl_lvcs::theta_
protected

Direction of north in radians.

Definition at line 169 of file vpgl_lvcs.h.


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