Public Member Functions | Private Member Functions | Private Attributes | List of all members
NETGeographicLib::CassiniSoldner Class Reference

.NET wrapper for GeographicLib::CassiniSoldner. More...

#include <CassiniSoldner.h>

Public Member Functions

 CassiniSoldner (double lat0, double lon0)
 
 CassiniSoldner (double lat0, double lon0, Geodesic^ earth)
 
void Forward (double lat, double lon, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y)
 
void Forward (double lat, double lon, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y, [System::Runtime::InteropServices::Out] double% azi, [System::Runtime::InteropServices::Out] double% rk)
 
void Reset (double lat0, double lon0)
 
void Reverse (double x, double y, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon)
 
void Reverse (double x, double y, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon, [System::Runtime::InteropServices::Out] double% azi, [System::Runtime::InteropServices::Out] double% rk)
 
 ~CassiniSoldner ()
 

Public Attributes

Inspector functions
property double LatitudeOrigin { double get()
 
property double LongitudeOrigin { double get()
 
property double MajorRadius { double get()
 
property double Flattening { double get()
 

Private Member Functions

 !CassiniSoldner ()
 

Private Attributes

GeographicLib::CassiniSoldnerm_pCassiniSoldner
 

Detailed Description

.NET wrapper for GeographicLib::CassiniSoldner.

This class allows .NET applications to access GeographicLib::CassiniSoldner.

Cassini-Soldner projection centered at an arbitrary position, lat0, lon0, on the ellipsoid. This projection is a transverse cylindrical equidistant projection. The projection from (lat, lon) to easting and northing (x, y) is defined by geodesics as follows. Go north along a geodesic a distance y from the central point; then turn clockwise 90° and go a distance x along a geodesic. (Although the initial heading is north, this changes to south if the pole is crossed.) This procedure uniquely defines the reverse projection. The forward projection is constructed as follows. Find the point (lat1, lon1) on the meridian closest to (lat, lon). Here we consider the full meridian so that lon1 may be either lon0 or lon0 + 180°. x is the geodesic distance from (lat1, lon1) to (lat, lon), appropriately signed according to which side of the central meridian (lat, lon) lies. y is the shortest distance along the meridian from (lat0, lon0) to (lat1, lon1), again, appropriately signed according to the initial heading. [Note that, in the case of prolate ellipsoids, the shortest meridional path from (lat0, lon0) to (lat1, lon1) may not be the shortest path.] This procedure uniquely defines the forward projection except for a small class of points for which there may be two equally short routes for either leg of the path.

Because of the properties of geodesics, the (x, y) grid is orthogonal. The scale in the easting direction is unity. The scale, k, in the northing direction is unity on the central meridian and increases away from the central meridian. The projection routines return azi, the true bearing of the easting direction, and rk = 1/k, the reciprocal of the scale in the northing direction.

The conversions all take place using a Geodesic object (by default Geodesic::WGS84). For more information on geodesics see geodesic. The determination of (lat1, lon1) in the forward projection is by solving the inverse geodesic problem for (lat, lon) and its twin obtained by reflection in the meridional plane. The scale is found by determining where two neighboring geodesics intersecting the central meridian at lat1 and lat1 + dlat1 intersect and taking the ratio of the reduced lengths for the two geodesics between that point and, respectively, (lat1, lon1) and (lat, lon).

C# Example:

using System;
namespace example_CassiniSoldner
{
class Program
{
static void Main(string[] args)
{
try {
Geodesic geod = new Geodesic(); // WGS84
const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris
CassiniSoldner proj = new CassiniSoldner(lat0, lon0, geod);
{
// Sample forward calculation
double lat = 50.9, lon = 1.8; // Calais
double x, y;
proj.Forward(lat, lon, out x, out y);
Console.WriteLine(String.Format("X: {0} Y: {1}", x, y));
}
{
// Sample reverse calculation
double x = -38e3, y = 230e3;
double lat, lon;
proj.Reverse(x, y, out lat, out lon);
Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat, lon));
}
}
catch (GeographicErr e) {
Console.WriteLine( String.Format( "Caught exception: {0}", e.Message ) );
}
}
}
}

Managed C++ Example:

// Example of using the GeographicLib::CassiniSoldner class
#include <iostream>
#include <exception>
using namespace std;
using namespace GeographicLib;
int main() {
try {
Geodesic geod(Constants::WGS84_a(), Constants::WGS84_f());
// Alternatively: const Geodesic& geod = Geodesic::WGS84();
const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris
CassiniSoldner proj(lat0, lon0, geod);
{
// Sample forward calculation
double lat = 50.9, lon = 1.8; // Calais
double x, y;
proj.Forward(lat, lon, x, y);
cout << x << " " << y << "\n";
}
{
// Sample reverse calculation
double x = -38e3, y = 230e3;
double lat, lon;
proj.Reverse(x, y, lat, lon);
cout << lat << " " << lon << "\n";
}
}
catch (const exception& e) {
cerr << "Caught exception: " << e.what() << "\n";
return 1;
}
}

Visual Basic Example:

Imports NETGeographicLib
Module example_CassiniSoldner
Sub Main()
Try
Dim geod As Geodesic = New Geodesic() ' WGS84
Dim lat0 As Double = 48 + 50 / 60.0, lon0 = 2 + 20 / 60.0 ' Paris
Dim proj As CassiniSoldner = New CassiniSoldner(lat0, lon0, geod)
' Sample forward calculation
Dim lat As Double = 50.9, lon = 1.8 ' Calais
Dim x, y As Double
proj.Forward(lat, lon, x, y)
Console.WriteLine(String.Format("X: {0} Y: {1}", x, y))
' Sample reverse calculation
x = -38000.0 : y = 230000.0
proj.Reverse(x, y, lat, lon)
Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat, lon))
Catch ex As GeographicErr
Console.WriteLine(String.Format("Caught exception: {0}", ex.Message))
End Try
End Sub
End Module

INTERFACE DIFFERENCES:
The LatitudeOrigin, LongitudeOrigin, MajorRadius and Flattening functions are implimented as properties.

Definition at line 70 of file CassiniSoldner.h.

Constructor & Destructor Documentation

◆ !CassiniSoldner()

CassiniSoldner::!CassiniSoldner ( )
private

Definition at line 22 of file dotnet/NETGeographicLib/CassiniSoldner.cpp.

◆ CassiniSoldner() [1/2]

CassiniSoldner::CassiniSoldner ( double  lat0,
double  lon0 
)

Constructor for CassiniSoldner specifying a center point and assuming the WGS84 ellipsoid.

Parameters
[in]lat0latitude of center point of projection (degrees).
[in]lon0longitude of center point of projection (degrees).

Definition at line 32 of file dotnet/NETGeographicLib/CassiniSoldner.cpp.

◆ CassiniSoldner() [2/2]

CassiniSoldner::CassiniSoldner ( double  lat0,
double  lon0,
Geodesic earth 
)

Constructor for CassiniSoldner specifying a center point.

Parameters
[in]lat0latitude of center point of projection (degrees).
[in]lon0longitude of center point of projection (degrees).
[in]earththe Geodesic object to use for geodesic calculations. By default this uses the WGS84 ellipsoid.

lat0 should be in the range [−90°, 90°].

Definition at line 46 of file dotnet/NETGeographicLib/CassiniSoldner.cpp.

◆ ~CassiniSoldner()

NETGeographicLib::CassiniSoldner::~CassiniSoldner ( )
inline

The destructor calls the finalizer.

Definition at line 103 of file CassiniSoldner.h.

Member Function Documentation

◆ Forward() [1/2]

void CassiniSoldner::Forward ( double  lat,
double  lon,
[System::Runtime::InteropServices::Out] double%  x,
[System::Runtime::InteropServices::Out] double%  y 
)

CassiniSoldner::Forward without returning the azimuth and scale.

Definition at line 99 of file dotnet/NETGeographicLib/CassiniSoldner.cpp.

◆ Forward() [2/2]

void CassiniSoldner::Forward ( double  lat,
double  lon,
[System::Runtime::InteropServices::Out] double%  x,
[System::Runtime::InteropServices::Out] double%  y,
[System::Runtime::InteropServices::Out] double%  azi,
[System::Runtime::InteropServices::Out] double%  rk 
)

Forward projection, from geographic to Cassini-Soldner.

Parameters
[in]latlatitude of point (degrees).
[in]lonlongitude of point (degrees).
[out]xeasting of point (meters).
[out]ynorthing of point (meters).
[out]aziazimuth of easting direction at point (degrees).
[out]rkreciprocal of azimuthal northing scale at point.

lat should be in the range [−90°, 90°]. A call to Forward followed by a call to Reverse will return the original (lat, lon) (to within roundoff). The routine does nothing if the origin has not been set.

Definition at line 70 of file dotnet/NETGeographicLib/CassiniSoldner.cpp.

◆ Reset()

void CassiniSoldner::Reset ( double  lat0,
double  lon0 
)

Set the central point of the projection

Parameters
[in]lat0latitude of center point of projection (degrees).
[in]lon0longitude of center point of projection (degrees).

lat0 should be in the range [−90°, 90°].

Definition at line 64 of file dotnet/NETGeographicLib/CassiniSoldner.cpp.

◆ Reverse() [1/2]

void CassiniSoldner::Reverse ( double  x,
double  y,
[System::Runtime::InteropServices::Out] double%  lat,
[System::Runtime::InteropServices::Out] double%  lon 
)

CassiniSoldner::Reverse without returning the azimuth and scale.

Definition at line 110 of file dotnet/NETGeographicLib/CassiniSoldner.cpp.

◆ Reverse() [2/2]

void CassiniSoldner::Reverse ( double  x,
double  y,
[System::Runtime::InteropServices::Out] double%  lat,
[System::Runtime::InteropServices::Out] double%  lon,
[System::Runtime::InteropServices::Out] double%  azi,
[System::Runtime::InteropServices::Out] double%  rk 
)

Reverse projection, from Cassini-Soldner to geographic.

Parameters
[in]xeasting of point (meters).
[in]ynorthing of point (meters).
[out]latlatitude of point (degrees).
[out]lonlongitude of point (degrees).
[out]aziazimuth of easting direction at point (degrees).
[out]rkreciprocal of azimuthal northing scale at point.

A call to Reverse followed by a call to Forward will return the original (x, y) (to within roundoff), provided that x and y are sufficiently small not to "wrap around" the earth. The routine does nothing if the origin has not been set.

Definition at line 85 of file dotnet/NETGeographicLib/CassiniSoldner.cpp.

Member Data Documentation

◆ Flattening

property double NETGeographicLib::CassiniSoldner::Flattening { double get()
Returns
f the flattening of the ellipsoid. This is the value inherited from the Geodesic object used in the constructor.

Definition at line 195 of file CassiniSoldner.h.

◆ LatitudeOrigin

property double NETGeographicLib::CassiniSoldner::LatitudeOrigin { double get()
Returns
lat0 the latitude of origin (degrees).

Definition at line 178 of file CassiniSoldner.h.

◆ LongitudeOrigin

property double NETGeographicLib::CassiniSoldner::LongitudeOrigin { double get()
Returns
lon0 the longitude of origin (degrees).

Definition at line 183 of file CassiniSoldner.h.

◆ m_pCassiniSoldner

GeographicLib::CassiniSoldner* NETGeographicLib::CassiniSoldner::m_pCassiniSoldner
private

Definition at line 74 of file CassiniSoldner.h.

◆ MajorRadius

property double NETGeographicLib::CassiniSoldner::MajorRadius { double get()
Returns
a the equatorial radius of the ellipsoid (meters). This is the value inherited from the Geodesic object used in the constructor.

Definition at line 189 of file CassiniSoldner.h.


The documentation for this class was generated from the following files:
NETGeographicLib::CassiniSoldner::CassiniSoldner
CassiniSoldner(double lat0, double lon0)
Definition: dotnet/NETGeographicLib/CassiniSoldner.cpp:32
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
main
int main(int argc, char **argv)
Definition: cmake/example_cmake_find_gtsam/main.cpp:63
example::lat0
const double lat0
Definition: testGPSFactor.cpp:41
example::lon0
const double lon0
Definition: testGPSFactor.cpp:41
CassiniSoldner.hpp
Header for GeographicLib::CassiniSoldner class.
out
std::ofstream out("Result.txt")
y
Scalar * y
Definition: level1_cplx_impl.h:124
std
Definition: BFloat16.h:88
args
Definition: pytypes.h:2210
lon
static const double lon
Definition: testGeographicLib.cpp:34
NETGeographicLib
Definition: Accumulator.h:13
GeographicLib::Geodesic
Geodesic calculations
Definition: Geodesic.hpp:172
GeographicLib::CassiniSoldner
Cassini-Soldner projection.
Definition: CassiniSoldner.hpp:69
Geodesic.hpp
Header for GeographicLib::Geodesic class.
lat
static const double lat
Definition: testGeographicLib.cpp:34


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:25:00