PyGeographicLib.cpp 584 Bytes
Newer Older
Valentin Platzgummer's avatar
Valentin Platzgummer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#include <boost/python.hpp>
#include <GeographicLib/Geoid.hpp>

using namespace boost::python;
using namespace GeographicLib;

double EllipsoidHeight(Geoid& geoid,
                       double lat, double lon, double hmsl) {
  return hmsl + Geoid::GEOIDTOELLIPSOID * geoid(lat, lon);
}

BOOST_PYTHON_MODULE(PyGeographicLib) {

  class_<Geoid, boost::noncopyable>("Geoid", init<std::string>())
    .def("EllipsoidHeight", &EllipsoidHeight,
         "Return geoid height:\n\
    input: lat, lon, height_above_geoid\n\
    output: height_above_ellipsoid")
    ;

}