Provides geodesy calculations.
- Distance between two points.
- Azimuth to go from one point to another.
- Calculate point from a given start point, azimuth and distance.
All methods return an optional value. As transformations may be involved during the calculations, there may not always be a result.
Factory to create geodesy implementations for a given coordinate reference and line type.
The reference can be ellipsoidal or cartesian.
Overview of supported combinations
The following table shows which combinations of coordinate references and line types are supported by the factory.
Coordinate Reference | Linear | Geodesic | Rhumbline |
Geographic CRS | yes | yes | yes |
Projected CRS | yes | yes | yes |
Geocentric CRS | yes | yes | yes |
non-georeferenced | no | no | no |
Implementation notes
Geographic, Projected, Geocentric - Geodesic, Rhumbline
The calculations are performed on the ellipsoid associated with the coordinate reference. Points are first transformed to the ellipsoid coordinates to perform the calculation. Results are transformed back to the coordinate reference.
Projected, Geocentric - Linear
The standard cartesian implementation of the methods. No specific (point) transformations are done.
Geographic - Linear
Performs cartesian calculations on the geographic points. The implementation takes following characteristics of geographic coordinates into account:
- wrap-around over the 180° meridian.
- stop at 90° latitude and -90° latitude.
Example usage
std::string identifier = "EPSG:4326";
double dist12 = geodesy->distance2D(p1, p2).value();
double azim12 = geodesy->forwardAzimuth2D(p1, p2).value().getDegrees();
static luciad::expected< std::shared_ptr< CoordinateReference >, ErrorInfo > create(const std::string &identifier)
Creates the coordinate reference from a given EPSG, WKT (version 1) or OGC identifier.
static std::shared_ptr< luciad::GeodesyCalculations > create(std::shared_ptr< luciad::CoordinateReference > reference, luciad::LineInterpolationType lineType)
Factory to create geodesy implementations for a given coordinate reference and line type.
@ Geodesic
Geodesic interpolation between points.
A "POD" for a 3D coordinate.
Definition: Coordinate.h:14
- Parameters
-
reference | the coordinate reference on which to perform the geodesy calculations, cannot be nullptr . |
lineType | the type of interpolation for the lines. |
- Exceptions
-