#include <opennurbs_3dm_settings.h>

Public Member Functions

 ON_EarthAnchorPoint ()=default
 
 ON_EarthAnchorPoint (const ON_EarthAnchorPoint &)=default
 
 ~ON_EarthAnchorPoint ()=default
 
ON::EarthCoordinateSystem EarthCoordinateSystem () const
 System used to define latiude, longitude and elevation. More...
 
ON_3dPoint EarthLocation () const
 
ON_3dPoint EarthLocation (ON_3dPoint unset_location) const
 
bool EarthLocationIsSet () const
 
double Elevation (const class ON_UnitSystem &elevation_unit_system) const
 
double Elevation (ON::LengthUnitSystem elevation_unit_system) const
 
double Elevation (const class ON_UnitSystem &elevation_unit_system, double unset_elevation) const
 
double Elevation (ON::LengthUnitSystem elevation_unit_system, double unset_elevation) const
 
double ElevationInMeters () const
 
bool GetModelCompass (ON_Plane &model_compass) const
 
bool GetModelToEarthXform (const ON_UnitSystem &model_unit_system, ON_Xform &model_to_earth) const
 Get a transformation from model coordinates to earth coordinates. This transformation assumes the model is small enough that the curvature of the earth can be ignored. More...
 
double Latitude () const
 
double Latitude (double unset_latitude) const
 
double Longitude () const
 
double Longitude (double unset_longitude) const
 
const ON_3dVectorModelEast () const
 
bool ModelLocationIsSet () const
 
const ON_3dVectorModelNorth () const
 
const ON_3dPointModelPoint () const
 
ON_EarthAnchorPointoperator= (const ON_EarthAnchorPoint &)=default
 
bool Read (ON_BinaryArchive &)
 
void SetEarthCoordinateSystem (ON::EarthCoordinateSystem earth_coordinate_system)
 System used to define Earth latiude, longitude, and elevation coordinates. More...
 
void SetEarthLocation (ON::EarthCoordinateSystem earth_coordinate_system, const class ON_UnitSystem &elevation_unit_system, double latitude_degrees, double longitude_degrees, double elevation)
 
void SetEarthLocation (ON::EarthCoordinateSystem earth_coordinate_system, ON::LengthUnitSystem elevation_unit_system, double latitude_degrees, double longitude_degrees, double elevation)
 
void SetElevation (const ON_UnitSystem &elevation_unit_system, double elevation)
 
void SetElevation (ON::LengthUnitSystem elevation_unit_system, double elevation)
 
void SetLatitude (double latitude_degrees)
 
void SetLatitudeAndLongitude (double latitude_degrees, double longitude_degrees)
 
void SetLongitude (double longitude_degrees)
 
void SetModelEast (ON_3dVector model_east)
 
void SetModelLocation (ON_3dPoint model_point, ON_3dVector model_north, ON_3dVector model_east)
 
void SetModelNorth (ON_3dVector model_north)
 
void SetModelPoint (ON_3dPoint model_point)
 
bool Write (ON_BinaryArchive &) const
 

Static Public Member Functions

static int Compare (const ON_EarthAnchorPoint *, const ON_EarthAnchorPoint *)
 
static int CompareEarthLocation (const ON_EarthAnchorPoint *, const ON_EarthAnchorPoint *)
 
static int CompareIdentification (const ON_EarthAnchorPoint *, const ON_EarthAnchorPoint *)
 
static int CompareModelDirection (const ON_EarthAnchorPoint *, const ON_EarthAnchorPoint *)
 

Public Attributes

ON_wString m_description
 
ON_UUID m_id = ON_nil_uuid
 Identification information about this location. More...
 
ON_wString m_name
 
ON_wString m_url
 
ON_wString m_url_tag
 

Static Public Attributes

static const ON_EarthAnchorPoint SeattleSpaceNeedle
 Latitude, longitude, and elevation are the Seattle Space Needle. More...
 
static const ON_EarthAnchorPoint Unset
 Latitude, longitude, and elevation are ON_UNSET_VALUE. More...
 

Constructor & Destructor Documentation

◆ ON_EarthAnchorPoint() [1/2]

ON_EarthAnchorPoint::ON_EarthAnchorPoint ( )
default

◆ ~ON_EarthAnchorPoint()

ON_EarthAnchorPoint::~ON_EarthAnchorPoint ( )
default

◆ ON_EarthAnchorPoint() [2/2]

ON_EarthAnchorPoint::ON_EarthAnchorPoint ( const ON_EarthAnchorPoint )
default

Member Function Documentation

◆ Compare()

static int ON_EarthAnchorPoint::Compare ( const ON_EarthAnchorPoint ,
const ON_EarthAnchorPoint  
)
static

◆ CompareEarthLocation()

static int ON_EarthAnchorPoint::CompareEarthLocation ( const ON_EarthAnchorPoint ,
const ON_EarthAnchorPoint  
)
static

◆ CompareIdentification()

static int ON_EarthAnchorPoint::CompareIdentification ( const ON_EarthAnchorPoint ,
const ON_EarthAnchorPoint  
)
static

◆ CompareModelDirection()

static int ON_EarthAnchorPoint::CompareModelDirection ( const ON_EarthAnchorPoint ,
const ON_EarthAnchorPoint  
)
static

◆ EarthCoordinateSystem()

ON::EarthCoordinateSystem ON_EarthAnchorPoint::EarthCoordinateSystem ( ) const

System used to define latiude, longitude and elevation.

◆ EarthLocation() [1/2]

ON_3dPoint ON_EarthAnchorPoint::EarthLocation ( ) const
Returns
A 3d point with coordinates (latitude in degrees, longitude in degrees, elevation in meters).

Some coordinates may be ON_UNSET_VALUE.

◆ EarthLocation() [2/2]

ON_3dPoint ON_EarthAnchorPoint::EarthLocation ( ON_3dPoint  unset_location) const
Parameters
unset_location[in] Location to return if EarlocationIsSet() is false.
Returns
A 3d point with coordinates (latitude, longitude, elevation).

◆ EarthLocationIsSet()

bool ON_EarthAnchorPoint::EarthLocationIsSet ( ) const
Returns
True if the latitude, longitude, and elevation are set.

◆ Elevation() [1/4]

double ON_EarthAnchorPoint::Elevation ( const class ON_UnitSystem elevation_unit_system) const
Parameters
elevation_unit_system[in] length unit system for returned value.
Returns
Earth location elevation in in elevation_unit_system. The value is with Can be ON_UNSET_VALUE

◆ Elevation() [2/4]

double ON_EarthAnchorPoint::Elevation ( ON::LengthUnitSystem  elevation_unit_system) const
Parameters
elevation_unit_system[in] length unit system for returned value.
Returns
Earth location elevation in degrees. Can be ON_UNSET_VALUE

◆ Elevation() [3/4]

double ON_EarthAnchorPoint::Elevation ( const class ON_UnitSystem elevation_unit_system,
double  unset_elevation 
) const
Parameters
elevation_unit_system[in] length unit system for returned value.
unset_elevation[in] Value to return if the Earth location elevation is not set.

◆ Elevation() [4/4]

double ON_EarthAnchorPoint::Elevation ( ON::LengthUnitSystem  elevation_unit_system,
double  unset_elevation 
) const
Parameters
elevation_unit_system[in] length unit system for returned value.
unset_elevation[in] Value to return if the Earth location elevation is not set.

◆ ElevationInMeters()

double ON_EarthAnchorPoint::ElevationInMeters ( ) const

◆ GetModelCompass()

bool ON_EarthAnchorPoint::GetModelCompass ( ON_Plane model_compass) const
Parameters
model_compass[out] A plane in model coordinates whose xaxis points East, yaxis points North and zaxis points up. The origin is set to m_model_basepoint.

◆ GetModelToEarthXform()

bool ON_EarthAnchorPoint::GetModelToEarthXform ( const ON_UnitSystem model_unit_system,
ON_Xform model_to_earth 
) const

Get a transformation from model coordinates to earth coordinates. This transformation assumes the model is small enough that the curvature of the earth can be ignored.

Parameters
model_unit_system[in]
model_to_earth[out] Transformation from model coordinates to earth locations (degrees latitude,degrees longitude,elevation in meters)

If M is a point in model coordinates and E = model_to_earth*M, then E.x = latitude in decimal degrees E.y = longitude in decimal degrees E.z = elevation in meters above mean sea level

Because the earth is not flat, there is a small amount of error when using a linear transformation to calculate oblate spherical coordinates. This error is small. If the distance from P to M is d meters, then the approximation error is

 latitude error  <=
 longitude error <=
 elevation error <= 6379000*((1 + (d/6356000)^2)-1) meters

In particular, if every point in the model is within 1000 meters of the m_model_basepoint, then the maximum approximation errors are

 latitude error  <=
 longitude error <=
 elevation error <= 8 centimeters

◆ Latitude() [1/2]

double ON_EarthAnchorPoint::Latitude ( ) const
Returns
Earth location latitude in degrees. Can be ON_UNSET_VALUE

◆ Latitude() [2/2]

double ON_EarthAnchorPoint::Latitude ( double  unset_latitude) const
Parameters
unset_latitude[in] Value to return if the Earth location latitude is not set.
Returns
Earth location latitude in degrees.

◆ Longitude() [1/2]

double ON_EarthAnchorPoint::Longitude ( ) const
Returns
Earth location longitude in degrees. Can be ON_UNSET_VALUE

◆ Longitude() [2/2]

double ON_EarthAnchorPoint::Longitude ( double  unset_longitude) const
Parameters
unset_longitude[in] Value to return if the Earth location latitude is not set.
Returns
Earth location longitude in degrees.

◆ ModelEast()

const ON_3dVector& ON_EarthAnchorPoint::ModelEast ( ) const

◆ ModelLocationIsSet()

bool ON_EarthAnchorPoint::ModelLocationIsSet ( ) const
Returns
True if model basepoint, north and east are set.

◆ ModelNorth()

const ON_3dVector& ON_EarthAnchorPoint::ModelNorth ( ) const

◆ ModelPoint()

const ON_3dPoint& ON_EarthAnchorPoint::ModelPoint ( ) const

◆ operator=()

ON_EarthAnchorPoint& ON_EarthAnchorPoint::operator= ( const ON_EarthAnchorPoint )
default

◆ Read()

bool ON_EarthAnchorPoint::Read ( ON_BinaryArchive )

◆ SetEarthCoordinateSystem()

void ON_EarthAnchorPoint::SetEarthCoordinateSystem ( ON::EarthCoordinateSystem  earth_coordinate_system)

System used to define Earth latiude, longitude, and elevation coordinates.

◆ SetEarthLocation() [1/2]

void ON_EarthAnchorPoint::SetEarthLocation ( ON::EarthCoordinateSystem  earth_coordinate_system,
const class ON_UnitSystem elevation_unit_system,
double  latitude_degrees,
double  longitude_degrees,
double  elevation 
)
Parameters
elevation_unit_system[in]
elevation[in]

◆ SetEarthLocation() [2/2]

void ON_EarthAnchorPoint::SetEarthLocation ( ON::EarthCoordinateSystem  earth_coordinate_system,
ON::LengthUnitSystem  elevation_unit_system,
double  latitude_degrees,
double  longitude_degrees,
double  elevation 
)

◆ SetElevation() [1/2]

void ON_EarthAnchorPoint::SetElevation ( const ON_UnitSystem elevation_unit_system,
double  elevation 
)
Parameters
elevation_unit_system[in]
elevation[in]

◆ SetElevation() [2/2]

void ON_EarthAnchorPoint::SetElevation ( ON::LengthUnitSystem  elevation_unit_system,
double  elevation 
)

◆ SetLatitude()

void ON_EarthAnchorPoint::SetLatitude ( double  latitude_degrees)

◆ SetLatitudeAndLongitude()

void ON_EarthAnchorPoint::SetLatitudeAndLongitude ( double  latitude_degrees,
double  longitude_degrees 
)

◆ SetLongitude()

void ON_EarthAnchorPoint::SetLongitude ( double  longitude_degrees)

◆ SetModelEast()

void ON_EarthAnchorPoint::SetModelEast ( ON_3dVector  model_east)

◆ SetModelLocation()

void ON_EarthAnchorPoint::SetModelLocation ( ON_3dPoint  model_point,
ON_3dVector  model_north,
ON_3dVector  model_east 
)

◆ SetModelNorth()

void ON_EarthAnchorPoint::SetModelNorth ( ON_3dVector  model_north)

◆ SetModelPoint()

void ON_EarthAnchorPoint::SetModelPoint ( ON_3dPoint  model_point)

◆ Write()

bool ON_EarthAnchorPoint::Write ( ON_BinaryArchive ) const

Member Data Documentation

◆ m_description

ON_wString ON_EarthAnchorPoint::m_description

◆ m_id

ON_UUID ON_EarthAnchorPoint::m_id = ON_nil_uuid

Identification information about this location.

◆ m_name

ON_wString ON_EarthAnchorPoint::m_name

◆ m_url

ON_wString ON_EarthAnchorPoint::m_url

◆ m_url_tag

ON_wString ON_EarthAnchorPoint::m_url_tag

◆ SeattleSpaceNeedle

const ON_EarthAnchorPoint ON_EarthAnchorPoint::SeattleSpaceNeedle
static

Latitude, longitude, and elevation are the Seattle Space Needle.

◆ Unset

const ON_EarthAnchorPoint ON_EarthAnchorPoint::Unset
static

Latitude, longitude, and elevation are ON_UNSET_VALUE.