Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | Related Functions
vpgl_lvcs Class Reference

#include <vpgl_lvcs.h>

Inheritance diagram for vpgl_lvcs:
Inheritance graph
[legend]

List of all members.

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.
 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.
 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.
 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.
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.
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 get_origin (double &lat, double &lon, double &elev) const
 return the origin of the local system.
void get_scale (double &lat, double &lon) const
 return the scale for lat lon and elevation.
void get_transform (double &lox, double &loy, double &theta) const
 Return the compass alignment transform.
void set_transform (const double lox, const double loy, const double theta)
 Set the compass alignment transform.
void set_origin (const double lon, const double lat, const double elev)
 Set the origin of the local system.
cs_names get_cs_name () const
 return the coordinate system.
LenUnits local_length_unit () const
AngUnits geo_angle_unit () const
void print (vcl_ostream &) const
 Print internals on strm.
bool save (vcl_string fname)
void read (vcl_istream &strm)
 Read internals from strm.
bool operator== (vpgl_lvcs const &r) const
void get_utm_origin (double &x, double &y, double &elev, int &zone) const
void ref ()
void unref ()
int 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_DLL_DATA 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.
void inverse_local_transform (double &x, double &y)
 Transform from north=y,east=x aligned axes to local co-ordinates.
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.)
double localCSOriginLat_
 Lat (in radians) of the origin.
double localCSOriginLon_
 Lon (in radians) of the origin.
double localCSOriginElev_
 Elev (in radians) of the origin.
double lat_scale_
 radians/meter along lat at the origin)
double lon_scale_
 radians/meter along lon at the origin)
AngUnits geo_angle_unit_
 lat lon angle unit (degrees or radians)
LenUnits localXYZUnit_
 Input (x,y,z) unit (meters or feet) in local CS.
double lox_
 Origin in local co-ordinates.
double loy_
 Origin in local co-ordinates.
double theta_
 Direction of north in radians.
double localUTMOrigin_X_East_
double localUTMOrigin_Y_North_
int localUTMOrigin_Zone_

Friends

vcl_ostream & operator<< (vcl_ostream &os, const vpgl_lvcs &local_coord_sys)
vcl_istream & operator>> (vcl_istream &os, vpgl_lvcs &local_coord_sys)

Related Functions

(Note that these are not member functions.)

void x_write (vcl_ostream &os, vpgl_lvcs const &v, vcl_string element_name="vpgl_lvcs")
 XML save vpgl_lvcs to stream.

Detailed Description

Definition at line 40 of file vpgl_lvcs.h.


Member Enumeration Documentation

Enumerator:
RADIANS 
DEG 

Definition at line 46 of file vpgl_lvcs.h.

Enumerator:
wgs84 
nad27n 
wgs72 
utm 
NumNames 

Definition at line 47 of file vpgl_lvcs.h.

Enumerator:
FEET 
METERS 

Definition at line 45 of file vpgl_lvcs.h.


Constructor & Destructor Documentation

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 88 of file vpgl_lvcs.cxx.

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 131 of file vpgl_lvcs.cxx.

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 163 of file vpgl_lvcs.cxx.

vpgl_lvcs::vpgl_lvcs ( const vpgl_lvcs lvcs)

Definition at line 45 of file vpgl_lvcs.cxx.


Member Function Documentation

void vpgl_lvcs::compute_scale ( ) [protected]

Definition at line 217 of file vpgl_lvcs.cxx.

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

Definition at line 205 of file vpgl_lvcs.cxx.

AngUnits vpgl_lvcs::geo_angle_unit ( ) const [inline]

Definition at line 106 of file vpgl_lvcs.h.

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

return the coordinate system.

Definition at line 156 of file vpgl_lvcs.h.

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

return the origin of the local system.

Definition at line 161 of file vpgl_lvcs.h.

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

return the scale for lat lon and elevation.

Definition at line 149 of file vpgl_lvcs.h.

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

Return the compass alignment transform.

Definition at line 178 of file vpgl_lvcs.h.

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

Definition at line 168 of file vpgl_lvcs.h.

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 546 of file vpgl_lvcs.cxx.

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 879 of file vpgl_lvcs.cxx.

LenUnits vpgl_lvcs::local_length_unit ( ) const [inline]

Definition at line 105 of file vpgl_lvcs.h.

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

Definition at line 346 of file vpgl_lvcs.cxx.

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

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

Definition at line 851 of file vpgl_lvcs.cxx.

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

Definition at line 67 of file vpgl_lvcs.cxx.

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

Definition at line 917 of file vpgl_lvcs.cxx.

void vpgl_lvcs::print ( vcl_ostream &  strm) const

Print internals on strm.

Definition at line 777 of file vpgl_lvcs.cxx.

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

Definition at line 198 of file vpgl_lvcs.cxx.

double vpgl_lvcs::radians_to_degrees ( const double  val)

Definition at line 193 of file vpgl_lvcs.cxx.

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

Definition at line 204 of file vpgl_lvcs.h.

void vpgl_lvcs::read ( vcl_istream &  strm)

Read internals from strm.

the origin is still given in wgs84.

Definition at line 796 of file vpgl_lvcs.cxx.

bool vpgl_lvcs::save ( vcl_string  fname) [inline]

Definition at line 108 of file vpgl_lvcs.h.

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

Definition at line 23 of file vpgl_lvcs.cxx.

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

Definition at line 34 of file vpgl_lvcs.cxx.

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 197 of file vpgl_lvcs.h.

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

Set the compass alignment transform.

Definition at line 187 of file vpgl_lvcs.h.

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

Definition at line 15 of file vpgl_lvcs.cxx.


Friends And Related Function Documentation

vcl_ostream& operator<< ( vcl_ostream &  os,
const vpgl_lvcs local_coord_sys 
) [friend]

Definition at line 905 of file vpgl_lvcs.cxx.

vcl_istream& operator>> ( vcl_istream &  os,
vpgl_lvcs local_coord_sys 
) [friend]

Definition at line 911 of file vpgl_lvcs.cxx.

void x_write ( vcl_ostream &  os,
vpgl_lvcs const &  v,
vcl_string  element_name = "vpgl_lvcs" 
) [related]

XML save vpgl_lvcs to stream.

Definition at line 7 of file vpgl_xio_lvcs.cxx.


Member Data Documentation

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

Definition at line 48 of file vpgl_lvcs.h.

lat lon angle unit (degrees or radians)

Definition at line 137 of file vpgl_lvcs.h.

double vpgl_lvcs::lat_scale_ [protected]

radians/meter along lat at the origin)

Definition at line 135 of file vpgl_lvcs.h.

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

Definition at line 131 of file vpgl_lvcs.h.

double vpgl_lvcs::localCSOriginElev_ [protected]

Elev (in radians) of the origin.

Definition at line 134 of file vpgl_lvcs.h.

double vpgl_lvcs::localCSOriginLat_ [protected]

Lat (in radians) of the origin.

Definition at line 132 of file vpgl_lvcs.h.

double vpgl_lvcs::localCSOriginLon_ [protected]

Lon (in radians) of the origin.

Definition at line 133 of file vpgl_lvcs.h.

Definition at line 143 of file vpgl_lvcs.h.

Definition at line 144 of file vpgl_lvcs.h.

Definition at line 145 of file vpgl_lvcs.h.

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

Definition at line 138 of file vpgl_lvcs.h.

double vpgl_lvcs::lon_scale_ [protected]

radians/meter along lon at the origin)

Definition at line 136 of file vpgl_lvcs.h.

double vpgl_lvcs::lox_ [protected]

Origin in local co-ordinates.

Definition at line 139 of file vpgl_lvcs.h.

double vpgl_lvcs::loy_ [protected]

Origin in local co-ordinates.

Definition at line 140 of file vpgl_lvcs.h.

double vpgl_lvcs::theta_ [protected]

Direction of north in radians.

Definition at line 141 of file vpgl_lvcs.h.


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