OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
geosupport.h File Reference
#include <cmath>
#include <string>
+ Include dependency graph for geosupport.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::pair< double, double > geotransform_4326_to_900913 (const double lon, const double lat)
 
std::pair< double, double > geotransform (const std::string &src_proj, const std::string &dst_proj, const double x, const double y)
 

Variables

const std::string OMNISCI_GEO_PREFIX {"omnisci_geo"}
 
const std::string LEGACY_GEO_PREFIX {"mapd_geo"}
 

Function Documentation

std::pair<double, double> geotransform ( const std::string &  src_proj,
const std::string &  dst_proj,
const double  x,
const double  y 
)
inline

Definition at line 38 of file geosupport.h.

References geotransform_4326_to_900913().

41  {
42  return geotransform_4326_to_900913(x, y);
43 }
std::pair< double, double > geotransform_4326_to_900913(const double lon, const double lat)
Definition: geosupport.h:26

+ Here is the call graph for this function:

std::pair<double, double> geotransform_4326_to_900913 ( const double  lon,
const double  lat 
)
inline

Definition at line 26 of file geosupport.h.

References pi().

Referenced by geotransform().

27  {
28  static const double e_circ = 40075016.68; // Earth's circumference, meters
29  static const double e_circ_360 = e_circ / 360;
30  static const double pi = std::acos(-1);
31 
32  std::pair<double, double> ll;
33  ll.first = lon * e_circ_360;
34  ll.second = e_circ_360 * std::log(std::tan((90 + lat) * pi / 360)) / (pi / 180);
35  return ll;
36 }
EXTENSION_NOINLINE double pi()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

const std::string LEGACY_GEO_PREFIX {"mapd_geo"}

Definition at line 24 of file geosupport.h.

Referenced by MapDHandler::import_geo_table().

const std::string OMNISCI_GEO_PREFIX {"omnisci_geo"}