MeteoIODoc 2.11.0
mio::CoordsAlgorithms Class Reference

Detailed Description

A static class to handle geographic algorithms. This class offers methods to handle lat/lon coordinates, to transform lat/lon coordinates, to compute distances on a sphere or to convert between coordinate systems.

Author
Mathias Bavay
Date
2015-09-22

#include <CoordsAlgorithms.h>

Public Types

enum  ELLIPSOIDS_NAMES {
  E_WGS84 , E_WGS72 , E_GRS80 , E_AIRY ,
  E_INTL1924 , E_CLARKE1880 , E_CLARKE1866 , E_GRS67 ,
  E_EVEREST1830 , E_IERS2003 , E_KRASSOVSKY , NONE
}
 Keywords for selecting an ellipsoid to use. More...
 

Static Public Member Functions

static double dms_to_decimal (const std::string &dms)
 Parse a latitude or longitude It can be formatted as any of the following examples: More...
 
static std::string decimal_to_dms (const double &decimal)
 Converts a decimal latitude or longitude to degrees, minutes, seconds It formats its arguments as in the following example: 46°48'03". More...
 
static void parseLatLon (const std::string &coordinates, double &lat, double &lon)
 Parse a latitude-longitude pair It can be formatted as any of the following examples: More...
 
static std::string printLatLon (const double &latitude, const double &longitude)
 Print a nicely formatted lat/lon in degrees, minutes, seconds. More...
 
static double lat_degree_lenght (const double &latitude)
 Lenght of one degree of latitude This returns the lenght in meters of one degree of latitude around the given latitude (ie: latitude-.5, latitude+.5). See https://en.wikipedia.org/wiki/Latitude#The_length_of_a_degree_of_latitude. More...
 
static double lon_degree_lenght (const double &latitude)
 Lenght of one degree of longitude This returns the lenght in meters of one degree of longitude around the given latitude (ie: latitude-.5, latitude+.5). See https://en.wikipedia.org/wiki/Latitude#The_length_of_a_degree_of_latitude. More...
 
static bool isUTM (const int &epsg)
 Does a given epsg code describe UTM coordinates? More...
 
static short int str_to_EPSG (const std::string &coordsystem, const std::string &coordparam)
 returns the epsg code matching a provided string representation For example, when given "CH1903" with empty coordparam, it will return "21781". For "LOCAL" coordinates, it returns IOUtils::snodata. More...
 
static void EPSG_to_str (const int &epsg, std::string &coordsystem, std::string &coordparam)
 Build the string representation for a given EPSG code. More...
 
static void rotatedToTrueLatLon (const double &lat_N, const double &lon_N, const double &lat_rot, const double &lon_rot, double &lat_true, double &lon_true)
 Convert rotated lat/lon into geographic lat/lon Rotated coordinates are created by moving the North pole by a given offset along latitude and longitude. The goal is to put the equator through the center of the domain of interest, so a lat/lon grid can easily be approximated by a tangential cartesian coordinate system. (see http://www.cosmo-model.org/content/model/documentation/core/default.htm, part I, chapter 3.3 for more) More...
 
static void trueLatLonToRotated (const double &lat_N, const double &lon_N, const double &lat_true, const double &lon_true, double &lat_rot, double &lon_rot)
 Convert geographic lat/lon into rotated lat/lon Rotated coordinates are created by moving the North pole by a given offset along latitude and longitude. The goal is to put the equator through the center of the domain of interest, so a lat/lon grid can easily be approximated by a tangential cartesian coordinate system. (see http://www.cosmo-model.org/content/model/documentation/core/default.htm, part I, chapter 3.3 for more) More...
 
static void Molodensky (const double &lat_in, const double &lon_in, const double &alt_in, const ELLIPSOIDS_NAMES &ellipsoid_in, double &lat_out, double &lon_out, double &alt_out, const ELLIPSOIDS_NAMES &ellipsoid_out, const double &delta_x=0., const double &delta_y=0., const double &delta_z=0.)
 Molodensky datum transformation. This converts lat/lon from one datum to another (for example, NAD27 to WGS84, or spherical to WGS84). The ellipsoid names (see CoordsAlgorithms::ELLIPSOIDS_NAMES) and delta_x/y/z that describe the datums must be provided (if no deltas are provided, they are assumed to be zeroes). For more information, see https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#Molodensky_transformation or http://www.colorado.edu/geography/gcraft/notes/datum/gif/molodens.gif. More...
 
static double cosineDistance (const double &lat1, const double &lon1, const double &lat2, const double &lon2, double &alpha)
 Spherical law of cosine Distance calculation between points in WGS84 (decimal Lat/Long) See http://www.movable-type.co.uk/scripts/latlong.html for more. More...
 
static void cosineInverse (const double &lat_ref, const double &lon_ref, const double &distance, const double &bearing, double &lat, double &lon)
 Spherical law of cosine Distance calculation between points in WGS84 (decimal Lat/Long) See http://www.movable-type.co.uk/scripts/latlong.html for more. More...
 
static double VincentyDistance (const double &lat1, const double &lon1, const double &lat2, const double &lon2, double &alpha)
 Vincenty Distance calculation between points in WGS84 (decimal Lat/Long) See T. Vincenty, "Closed formulas for the direct and reverse geodetic problems", Journal of Geodesy, 51, 3, 1977, DOI:10.1007/BF02521599, see http://www.springerlink.com/content/y7108u6862473583 for more. More...
 
static void VincentyInverse (const double &lat_ref, const double &lon_ref, const double &distance, const double &bearing, double &lat, double &lon)
 Vincenty Inverse calculation giving WGS84 (decimal Lat/Long) position given a start location (lat,lon) a distance and a bearing See T. Vincenty, "Closed formulas for the direct and reverse geodetic problems", Journal of Geodesy, 51, 3, 1977, DOI:10.1007/BF02521599, see http://www.springerlink.com/content/y7108u6862473583 for more. More...
 
static void WGS84_to_CH1903 (const double &lat_in, const double &long_in, double &east_out, double &north_out)
 Coordinate conversion: from WGS84 Lat/Long to Swiss grid See https://www.swisstopo.admin.ch/de/karten-daten-online/calculation-services.html in the "Documents" section for more. More...
 
static void CH1903_to_WGS84 (const double &east_in, const double &north_in, double &lat_out, double &long_out)
 Coordinate conversion: from Swiss grid to WGS84 Lat/Long See https://www.swisstopo.admin.ch/de/karten-daten-online/calculation-services.html in the "Documents" section for more. More...
 
static void WGS84_to_UTM (const double &lat_in, double long_in, const std::string &coordparam, double &east_out, double &north_out)
 Coordinate conversion: from WGS84 Lat/Long to UTM grid. For more, see http://www.oc.nps.edu/oc2902w/maps/utmups.pdf, USGS Bulletin 1532 or http://earth-info.nga.mil/GandG/publications/tm8358.2/TM8358_2.pdf, http://www.uwgb.edu/dutchs/usefuldata/UTMFormulas.HTM or Chuck Gantz (http://www.gpsy.com/gpsinfo/geotoutm/). More...
 
static void UTM_to_WGS84 (double east_in, double north_in, const std::string &coordparam, double &lat_out, double &long_out)
 Coordinate conversion: from UTM grid to WGS84 Lat/Long. For more, see http://www.oc.nps.edu/oc2902w/maps/utmups.pdf, USGS Bulletin 1532 or http://earth-info.nga.mil/GandG/publications/tm8358.2/TM8358_2.pdf, http://www.uwgb.edu/dutchs/usefuldata/UTMFormulas.HTM or Chuck Gantz (http://www.gpsy.com/gpsinfo/geotoutm/). More...
 
static void WGS84_to_UPS (const double &lat_in, const double &long_in, const std::string &coordparam, double &east_out, double &north_out)
 Coordinate conversion: from WGS84 Lat/Long to Universal Polar Stereographic grid see J. Hager, J. Behensky, B. Drew, THE UNIVERSAL GRIDS: Universal Transverse Mercator (UTM) and Universal Polar Stereographic (UPS), 1989, Defense Mapping Agency, DMATM 8358.2. This is valid above latitudes 84N or above 80S. More...
 
static void UPS_to_WGS84 (const double &east_in, const double &north_in, const std::string &coordparam, double &lat_out, double &long_out)
 Coordinate conversion: from Universal Polar Stereographic grid to WGS84 Lat/Long see J. Hager, J. Behensky, B. Drew, THE UNIVERSAL GRIDS: Universal Transverse Mercator (UTM) and Universal Polar Stereographic (UPS), 1989, Defense Mapping Agency, DMATM 8358.2. This is valid above latitudes 84N or above 80S. More...
 
static void WGS84_to_PROJ (const double &lat_in, const double &long_in, const std::string &coordparam, double &east_out, double &north_out)
 Coordinate conversion: from WGS84 Lat/Long to proj parameters. More...
 
static void PROJ_to_WGS84 (const double &east_in, const double &north_in, const std::string &coordparam, double &lat_out, double &long_out)
 Coordinate conversion: from proj parameters to WGS84 Lat/Long. More...
 
static int getUTMZone (const double &latitude, const double &longitude, std::string &zone_out)
 
static void parseUTMZone (const std::string &zone_info, char &zoneLetter, short int &zoneNumber)
 

Member Enumeration Documentation

◆ ELLIPSOIDS_NAMES

Keywords for selecting an ellipsoid to use.

Enumerator
E_WGS84 

Globally usable WGS84 ellipsoid.

E_WGS72 

USA/DoD.

E_GRS80 

GRS80 ellispoid, equivalent to WGS84 but used by America and Australia (NAD83)

E_AIRY 

Airy ellispoid, UK.

E_INTL1924 

International 1924 ellispoid, good for most of Europe.

E_CLARKE1880 

Clarke 1880, Africa and France.

E_CLARKE1866 

Clarke 1866, used for NAD27 (North America)

E_GRS67 

GRS67 ellispoid, good for South America.

E_EVEREST1830 

Everest1830 ellipsoid, used for India.

E_IERS2003 

IERS2003 ellipsoid.

E_KRASSOVSKY 

Krassovsky 1940 ellipsoid, USSR, Russia, Romania.

NONE 

spherical earth

Member Function Documentation

◆ CH1903_to_WGS84()

void mio::CoordsAlgorithms::CH1903_to_WGS84 ( const double &  east_in,
const double &  north_in,
double &  lat_out,
double &  long_out 
)
static

Coordinate conversion: from Swiss grid to WGS84 Lat/Long See https://www.swisstopo.admin.ch/de/karten-daten-online/calculation-services.html in the "Documents" section for more.

Parameters
[in]east_ineasting coordinate (Swiss system)
[in]north_innorthing coordinate (Swiss system)
[out]lat_outDecimal Latitude
[out]long_outDecimal Longitude

◆ cosineDistance()

double mio::CoordsAlgorithms::cosineDistance ( const double &  lat1,
const double &  lon1,
const double &  lat2,
const double &  lon2,
double &  alpha 
)
static

Spherical law of cosine Distance calculation between points in WGS84 (decimal Lat/Long) See http://www.movable-type.co.uk/scripts/latlong.html for more.

Parameters
[in]lat1Decimal Latitude (const double&)
[in]lon1Decimal Longitude (const double&)
[in]lat2Decimal Latitude (const double&)
[in]lon2Decimal Longitude (const double&)
[out]alphaaverage bearing
Returns
distance (double)

◆ cosineInverse()

void mio::CoordsAlgorithms::cosineInverse ( const double &  lat_ref,
const double &  lon_ref,
const double &  distance,
const double &  bearing,
double &  lat,
double &  lon 
)
static

Spherical law of cosine Distance calculation between points in WGS84 (decimal Lat/Long) See http://www.movable-type.co.uk/scripts/latlong.html for more.

Parameters
[in]lat_refDecimal Latitude (const double&)
[in]lon_refDecimal Longitude (const double&)
[in]distanceDistance in meters (const double&)
[in]bearingbearing in degrees, 0 being north (const double&)
[out]latDecimal latitude of target point (double&)
[out]lonDecimal longitude of target point (double&)

◆ decimal_to_dms()

std::string mio::CoordsAlgorithms::decimal_to_dms ( const double &  decimal)
static

Converts a decimal latitude or longitude to degrees, minutes, seconds It formats its arguments as in the following example: 46°48'03".

Parameters
[in]decimaldecimal coordinate to convert
Returns
string containing the formatted coordinate

◆ dms_to_decimal()

double mio::CoordsAlgorithms::dms_to_decimal ( const std::string &  dms)
static

Parse a latitude or longitude It can be formatted as any of the following examples:

  • 46° 48' 03" (with or without spaces, decimal or integer numbers) - 46d 48' 03" (with or without spaces, decimal or integer numbers)
  • 46 48' 03" (with spaces, decimal or integer numbers)
  • 48° 48.02'(with or without spaces, decimal or integer numbers)
  • 46d 48.02'(with or without spaces, decimal or integer numbers)
  • 46 48.02'(with spaces, decimal or integer numbers)
  • 46.802°
  • 46.802d
  • 46.802
    Parameters
    [in]dmsstring containing the coordinate
    Returns
    coordinate in decimal

◆ EPSG_to_str()

void mio::CoordsAlgorithms::EPSG_to_str ( const int &  epsg,
std::string &  coordsystem,
std::string &  coordparam 
)
static

Build the string representation for a given EPSG code.

Note
We assume that the ETRS datum is equal to the WGS84 (although there is a .5m difference and growing). Therefore, all ETRS coordinates will be written out as WGS84 coordinates.
Parameters
[in]epsgepsg code
[out]coordsystemstring representation of the coordinate system
[out]coordparamstring representation of the optional coordinate system parameters (such as zone for utm, etc)

◆ getUTMZone()

int mio::CoordsAlgorithms::getUTMZone ( const double &  latitude,
const double &  longitude,
std::string &  zone_out 
)
static

◆ isUTM()

bool mio::CoordsAlgorithms::isUTM ( const int &  epsg)
static

Does a given epsg code describe UTM coordinates?

Parameters
[in]epsgepsg code
Returns
true if this is for UTM coordinates, false otherwise

◆ lat_degree_lenght()

double mio::CoordsAlgorithms::lat_degree_lenght ( const double &  latitude)
static

Lenght of one degree of latitude This returns the lenght in meters of one degree of latitude around the given latitude (ie: latitude-.5, latitude+.5). See https://en.wikipedia.org/wiki/Latitude#The_length_of_a_degree_of_latitude.

Parameters
[in]latitudelatitude where to perform the computation
Returns
lenght of one degree of latitude

◆ lon_degree_lenght()

double mio::CoordsAlgorithms::lon_degree_lenght ( const double &  latitude)
static

Lenght of one degree of longitude This returns the lenght in meters of one degree of longitude around the given latitude (ie: latitude-.5, latitude+.5). See https://en.wikipedia.org/wiki/Latitude#The_length_of_a_degree_of_latitude.

Parameters
[in]latitudelatitude where to perform the computation
Returns
lenght of one degree of longitude

◆ Molodensky()

void mio::CoordsAlgorithms::Molodensky ( const double &  lat_in,
const double &  lon_in,
const double &  alt_in,
const ELLIPSOIDS_NAMES ellipsoid_in,
double &  lat_out,
double &  lon_out,
double &  alt_out,
const ELLIPSOIDS_NAMES ellipsoid_out,
const double &  delta_x = 0.,
const double &  delta_y = 0.,
const double &  delta_z = 0. 
)
static

Molodensky datum transformation. This converts lat/lon from one datum to another (for example, NAD27 to WGS84, or spherical to WGS84). The ellipsoid names (see CoordsAlgorithms::ELLIPSOIDS_NAMES) and delta_x/y/z that describe the datums must be provided (if no deltas are provided, they are assumed to be zeroes). For more information, see https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#Molodensky_transformation or http://www.colorado.edu/geography/gcraft/notes/datum/gif/molodens.gif.

Parameters
[in]lat_ininput latitude (degrees)
[in]lon_ininput longitude (degrees)
[in]alt_ininput altitude above sea level
[in]ellipsoid_inellipsoid of the input datum (see CoordsAlgorithms::ELLIPSOIDS_NAMES)
[out]lat_outoutput latitude (degrees)
[out]lon_outoutput longitude (degrees)
[out]alt_outoutput altitude above sea level
[out]ellipsoid_outellipsoid of the output datum (see CoordsAlgorithms::ELLIPSOIDS_NAMES)
[in]delta_xOrigin shift, x coordinate (default: 0)
[in]delta_yOrigin shift, y coordinate (default: 0)
[in]delta_zOrigin shift, z coordinate (default: 0)

◆ parseLatLon()

void mio::CoordsAlgorithms::parseLatLon ( const std::string &  coordinates,
double &  lat,
double &  lon 
)
static

Parse a latitude-longitude pair It can be formatted as any of the following examples:

  • lat lon (without any spaces in the latitude or longitude string)
  • lat/lon
  • (lat;lon)
  • (lat,lon)
    Parameters
    [in]coordinatesstring containing the coordinates
    [out]latparsed latitude
    [out]lonparsed longitude

◆ parseUTMZone()

void mio::CoordsAlgorithms::parseUTMZone ( const std::string &  zone_info,
char &  zoneLetter,
short int &  zoneNumber 
)
static

◆ printLatLon()

std::string mio::CoordsAlgorithms::printLatLon ( const double &  latitude,
const double &  longitude 
)
static

Print a nicely formatted lat/lon in degrees, minutes, seconds.

Returns
lat/lon

◆ PROJ_to_WGS84()

void mio::CoordsAlgorithms::PROJ_to_WGS84 ( const double &  east_in,
const double &  north_in,
const std::string &  coordparam,
double &  lat_out,
double &  long_out 
)
static

Coordinate conversion: from proj parameters to WGS84 Lat/Long.

Parameters
east_ineasting coordinate (Swiss system)
north_innorthing coordinate (Swiss system)
[in]coordparamExtra parameters necessary for the conversion (such as UTM zone, etc)
lat_outDecimal Latitude
long_outDecimal Longitude

◆ rotatedToTrueLatLon()

void mio::CoordsAlgorithms::rotatedToTrueLatLon ( const double &  lat_N,
const double &  lon_N,
const double &  lat_rot,
const double &  lon_rot,
double &  lat_true,
double &  lon_true 
)
static

Convert rotated lat/lon into geographic lat/lon Rotated coordinates are created by moving the North pole by a given offset along latitude and longitude. The goal is to put the equator through the center of the domain of interest, so a lat/lon grid can easily be approximated by a tangential cartesian coordinate system. (see http://www.cosmo-model.org/content/model/documentation/core/default.htm, part I, chapter 3.3 for more)

Note
To convert South Pole coordinates to North Pole coordinates, multiply the latitude by -1 and add 180 to the longitude.
Parameters
[in]lat_NNorth pole latitude offset
[in]lon_NNorth pole longitude offset
[in]lat_rotrotated latitude
[in]lon_rotrotated longitude
[out]lat_truegeographic latitude
[out]lon_truegeographic longitude

◆ str_to_EPSG()

short int mio::CoordsAlgorithms::str_to_EPSG ( const std::string &  coordsystem,
const std::string &  coordparam 
)
static

returns the epsg code matching a provided string representation For example, when given "CH1903" with empty coordparam, it will return "21781". For "LOCAL" coordinates, it returns IOUtils::snodata.

Parameters
[in]coordsystemstring representation of the coordinate system
[in]coordparamstring representation of the optional coordinate system parameters (such as zone for utm, etc)
Returns
epsg code

◆ trueLatLonToRotated()

void mio::CoordsAlgorithms::trueLatLonToRotated ( const double &  lat_N,
const double &  lon_N,
const double &  lat_true,
const double &  lon_true,
double &  lat_rot,
double &  lon_rot 
)
static

Convert geographic lat/lon into rotated lat/lon Rotated coordinates are created by moving the North pole by a given offset along latitude and longitude. The goal is to put the equator through the center of the domain of interest, so a lat/lon grid can easily be approximated by a tangential cartesian coordinate system. (see http://www.cosmo-model.org/content/model/documentation/core/default.htm, part I, chapter 3.3 for more)

Note
To convert South Pole coordinates to North Pole coordinates, multiply the latitude by -1 and add 180 to the longitude.
Parameters
[in]lat_NNorth pole latitude offset
[in]lon_NNorth pole longitude offset
[in]lat_truegeographic latitude
[in]lon_truegeographic longitude
[out]lat_rotrotated latitude
[out]lon_rotrotated longitude

◆ UPS_to_WGS84()

void mio::CoordsAlgorithms::UPS_to_WGS84 ( const double &  east_in,
const double &  north_in,
const std::string &  coordparam,
double &  lat_out,
double &  long_out 
)
static

Coordinate conversion: from Universal Polar Stereographic grid to WGS84 Lat/Long see J. Hager, J. Behensky, B. Drew, THE UNIVERSAL GRIDS: Universal Transverse Mercator (UTM) and Universal Polar Stereographic (UPS), 1989, Defense Mapping Agency, DMATM 8358.2. This is valid above latitudes 84N or above 80S.

Parameters
[in]east_ineasting coordinate (UTM)
[in]north_innorthing coordinate (UTM)
[in]coordparamUPS zone, either "N" or "S"
[out]lat_outDecimal Latitude
[out]long_outDecimal Longitude

◆ UTM_to_WGS84()

void mio::CoordsAlgorithms::UTM_to_WGS84 ( double  east_in,
double  north_in,
const std::string &  coordparam,
double &  lat_out,
double &  long_out 
)
static

Coordinate conversion: from UTM grid to WGS84 Lat/Long. For more, see http://www.oc.nps.edu/oc2902w/maps/utmups.pdf, USGS Bulletin 1532 or http://earth-info.nga.mil/GandG/publications/tm8358.2/TM8358_2.pdf, http://www.uwgb.edu/dutchs/usefuldata/UTMFormulas.HTM or Chuck Gantz (http://www.gpsy.com/gpsinfo/geotoutm/).

Parameters
[in]east_ineasting coordinate (UTM)
[in]north_innorthing coordinate (UTM)
[in]coordparamUTM zone of the easting/northing
[out]lat_outDecimal Latitude
[out]long_outDecimal Longitude

◆ VincentyDistance()

double mio::CoordsAlgorithms::VincentyDistance ( const double &  lat1,
const double &  lon1,
const double &  lat2,
const double &  lon2,
double &  alpha 
)
static

Vincenty Distance calculation between points in WGS84 (decimal Lat/Long) See T. Vincenty, "Closed formulas for the direct and reverse geodetic problems", Journal of Geodesy, 51, 3, 1977, DOI:10.1007/BF02521599, see http://www.springerlink.com/content/y7108u6862473583 for more.

Parameters
[in]lat1Decimal Latitude (const double&)
[in]lon1Decimal Longitude (const double&)
[in]lat2Decimal Latitude (const double&)
[in]lon2Decimal Longitude (const double&)
[in]alphaaverage bearing (double&)
Returns
distance (double)

◆ VincentyInverse()

void mio::CoordsAlgorithms::VincentyInverse ( const double &  lat_ref,
const double &  lon_ref,
const double &  distance,
const double &  bearing,
double &  lat,
double &  lon 
)
static

Vincenty Inverse calculation giving WGS84 (decimal Lat/Long) position given a start location (lat,lon) a distance and a bearing See T. Vincenty, "Closed formulas for the direct and reverse geodetic problems", Journal of Geodesy, 51, 3, 1977, DOI:10.1007/BF02521599, see http://www.springerlink.com/content/y7108u6862473583 for more.

Parameters
[in]lat_refDecimal Latitude (const double&)
[in]lon_refDecimal Longitude (const double&)
[in]distanceDistance in meters (const double&)
[in]bearingbearing in degrees, 0 being north (const double&)
[out]latDecimal latitude of target point (double&)
[out]lonDecimal longitude of target point (double&)

◆ WGS84_to_CH1903()

void mio::CoordsAlgorithms::WGS84_to_CH1903 ( const double &  lat_in,
const double &  long_in,
double &  east_out,
double &  north_out 
)
static

Coordinate conversion: from WGS84 Lat/Long to Swiss grid See https://www.swisstopo.admin.ch/de/karten-daten-online/calculation-services.html in the "Documents" section for more.

Parameters
[in]lat_inDecimal Latitude
[in]long_inDecimal Longitude
[out]east_outeasting coordinate (Swiss system)
[out]north_outnorthing coordinate (Swiss system)

◆ WGS84_to_PROJ()

void mio::CoordsAlgorithms::WGS84_to_PROJ ( const double &  lat_in,
const double &  long_in,
const std::string &  coordparam,
double &  east_out,
double &  north_out 
)
static

Coordinate conversion: from WGS84 Lat/Long to proj parameters.

Parameters
[in]lat_inDecimal Latitude
[in]long_inDecimal Longitude
[in]coordparamExtra parameters necessary for the conversion (such as UTM zone, etc)
[out]east_outeasting coordinate (target system)
[out]north_outnorthing coordinate (target system)
Note
Using libproj is currently not thread safe (see https://trac.osgeo.org/proj/wiki/ThreadSafety)

◆ WGS84_to_UPS()

void mio::CoordsAlgorithms::WGS84_to_UPS ( const double &  lat_in,
const double &  long_in,
const std::string &  coordparam,
double &  east_out,
double &  north_out 
)
static

Coordinate conversion: from WGS84 Lat/Long to Universal Polar Stereographic grid see J. Hager, J. Behensky, B. Drew, THE UNIVERSAL GRIDS: Universal Transverse Mercator (UTM) and Universal Polar Stereographic (UPS), 1989, Defense Mapping Agency, DMATM 8358.2. This is valid above latitudes 84N or above 80S.

Parameters
[in]lat_inDecimal Latitude
[in]long_inDecimal Longitude
[in]coordparamUPS zone, either "N" or "S"
[out]east_outeasting coordinate (Swiss system)
[out]north_outnorthing coordinate (Swiss system)

◆ WGS84_to_UTM()

void mio::CoordsAlgorithms::WGS84_to_UTM ( const double &  lat_in,
double  long_in,
const std::string &  coordparam,
double &  east_out,
double &  north_out 
)
static

Coordinate conversion: from WGS84 Lat/Long to UTM grid. For more, see http://www.oc.nps.edu/oc2902w/maps/utmups.pdf, USGS Bulletin 1532 or http://earth-info.nga.mil/GandG/publications/tm8358.2/TM8358_2.pdf, http://www.uwgb.edu/dutchs/usefuldata/UTMFormulas.HTM or Chuck Gantz (http://www.gpsy.com/gpsinfo/geotoutm/).

Parameters
[in]lat_inDecimal Latitude
[in]long_inDecimal Longitude
[in]coordparamUTM zone to convert to
[out]east_outeasting coordinate (Swiss system)
[out]north_outnorthing coordinate (Swiss system)

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