dotnet/NETGeographicLib/Geohash.cpp
Go to the documentation of this file.
1 
11 #include "stdafx.h"
13 #include "Geohash.h"
14 #include "NETGeographicLib.h"
15 
16 using namespace NETGeographicLib;
17 
18 //*****************************************************************************
19 void Geohash::Forward(double lat, double lon, int len, System::String^% geohash)
20 {
21  try
22  {
23  std::string l;
25  geohash = gcnew System::String( l.c_str() );
26  }
27  catch ( const std::exception& xcpt )
28  {
29  throw gcnew GeographicErr( xcpt.what() );
30  }
31 }
32 
33 //*****************************************************************************
34 void Geohash::Reverse(System::String^ geohash,
35  [System::Runtime::InteropServices::Out] double% lat,
36  [System::Runtime::InteropServices::Out] double% lon,
37  [System::Runtime::InteropServices::Out] int% len,
38  bool centerp )
39 {
40  try
41  {
42  double llat, llon;
43  int llen;
45  llat, llon, llen, centerp );
46  lat = llat;
47  lon = llon;
48  len = llen;
49  }
50  catch ( const std::exception& err )
51  {
52  throw gcnew GeographicErr( err.what() );
53  }
54 }
55 
56 //*****************************************************************************
58 {
60 }
61 
62 //*****************************************************************************
64 {
66 }
67 
68 //*****************************************************************************
70 {
72 }
73 
74 //*****************************************************************************
75 int Geohash::GeohashLength(double latres, double lonres)
76 {
77  return GeographicLib::Geohash::GeohashLength( latres, lonres );
78 }
79 
80 //*****************************************************************************
82 {
84 }
GeographicLib::Geohash::Forward
static void Forward(real lat, real lon, int len, std::string &geohash)
Definition: src/Geohash.cpp:20
GeographicLib::Geohash::LongitudeResolution
static Math::real LongitudeResolution(int len)
Definition: Geohash.hpp:113
NETGeographicLib::Geohash::DecimalPrecision
static int DecimalPrecision(int len)
Definition: dotnet/NETGeographicLib/Geohash.cpp:81
NETGeographicLib::Geohash::GeohashLength
static int GeohashLength(double res)
Definition: dotnet/NETGeographicLib/Geohash.cpp:69
res
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition: NETGeographicLib.h:132
NETGeographicLib::Geohash::Reverse
static void Reverse(System::String^ geohash, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon, [System::Runtime::InteropServices::Out] int% len, bool centerp)
Definition: dotnet/NETGeographicLib/Geohash.cpp:34
GeographicLib::Geohash::DecimalPrecision
static int DecimalPrecision(int len)
Definition: Geohash.hpp:167
GeographicLib::Geohash::GeohashLength
static int GeohashLength(real res)
Definition: Geohash.hpp:128
NETGeographicLib::Geohash::LatitudeResolution
static double LatitudeResolution(int len)
Definition: dotnet/NETGeographicLib/Geohash.cpp:57
Geohash.hpp
Header for GeographicLib::Geohash class.
l
static const Line3 l(Rot3(), 1, 1)
GeographicLib::Geohash::Reverse
static void Reverse(const std::string &geohash, real &lat, real &lon, int &len, bool centerp=true)
Definition: src/Geohash.cpp:59
stdafx.h
GeographicLib::Geohash::LatitudeResolution
static Math::real LatitudeResolution(int len)
Definition: Geohash.hpp:99
NETGeographicLib.h
Header for NETGeographicLib::NETGeographicLib objects.
Geohash.h
Header for NETGeographicLib::Geohash class.
NETGeographicLib::Geohash::Forward
static void Forward(double lat, double lon, int len, [System::Runtime::InteropServices::Out] System::String^% geohash)
Definition: dotnet/NETGeographicLib/Geohash.cpp:19
NETGeographicLib::Geohash::LongitudeResolution
static double LongitudeResolution(int len)
Definition: dotnet/NETGeographicLib/Geohash.cpp:63
len
size_t len(handle h)
Get the length of a Python object.
Definition: pytypes.h:2446
lon
static const double lon
Definition: testGeographicLib.cpp:34
NETGeographicLib
Definition: Accumulator.h:13
NETGeographicLib::StringConvert::ManagedToUnmanaged
static std::string ManagedToUnmanaged(System::String^ s)
Definition: NETGeographicLib.cpp:20
lat
static const double lat
Definition: testGeographicLib.cpp:34


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:22