User Manual 4.15 Projections

De Wiki
Révision de 21 novembre 2024 à 15:55 par Admin tsn (discussion | contributions) (Page créée avec « == Introduction == === Scope === The scope of this section is to present the projections features available in Patrius library. Patrius provides classes to perform project... »)

(diff) ← Version précédente | Voir la version courante (diff) | Version suivante → (diff)
Aller à : navigation, rechercher

Introduction

Scope

The scope of this section is to present the projections features available in Patrius library. Patrius provides classes to perform projections on an ellipsoid as well as various computation on the surface of an ellipsoid. Common available projections are:

  • Mercator
  • Flamsteed-Samson
  • Identity projection

Javadoc

All the classes related to projections are in the following packages:

Library Javadoc
Patrius [[[:Modèle:JavaDoc4.15]]/fr/cnes/sirius/patrius/projections/package-summary.html Package fr.cnes.sirius.patrius.projections]

Links

More information about specific projections can be found using the following links:

Useful Documents

None as of now.

Package Overview

The projections package gathers:

  • An interface for all projections: IProjection
  • Some available projections : Mercator, GeneralizedFlamsteedSamson and IdentityProjection
  • A ellipsoid with extended features: ProjectionEllipsoid

The projection package can be summarized with the following UML diagram.

Please note that not all implementations are present in the following diagram for the sake of clarity.

Projections.png

Features Description

Projections provide three main features:

  • Projection on an ellipsoid (and its inverse application)
  • Discretisation between points on the surface of an ellipsoid
  • Geometric computation on the surface of an ellipsoid using class ProjectionEllipsoid

Projection on an ellipsoid

Projection on an ellipsoid is a transformation taking geodetic coordinates (latitude, longitude, altitude) as input and returning 2D map coordinates (X, Y) as output. Inverse transformation takes 2D map coordinates (X, Y) as input and returns geodetic coordinates (latitude, longitude, altitude) as output.

Projection classes inherit projection interface IProjection.
Available projections are:

  • Mercator projection: Mercator. The Mercator projection is a cylindrical map projection which became the standard map projection for nautical purposes because of its ability to represent lines of constant course, known loxodromes, as straight segments. Mercator projection is conformal (angles are preserved) but not equivalent (areas are not preserved).
MercatorProjection.jpg
  • Flamsteed-Samson projection: GeneralizedFlamsteedSamson. This projection is also known as the sinusoidal projection. The sinusoidal projection is equal-area and preserves distances along the horizontals but is not conformal (angles are not preserved).
SinusoidalProjection.jpg
  • Identity projection: IdentityProjection. Identity projection is the projection [latitude, longitude, altitude] => [X = latitude, Y = longitude].

All projections provide:

  • direct transformation using method applyTo(). It returns 2D map coordinates (X, Y) from geodetic coordinates (latitude, longitude, altitude).
  • inverse transformation using method applyInverseTo(). It returns geodetic coordinates (latitude, longitude, altitude) from 2D map coordinates (X, Y).

Discretization

All projection classes provide various discretization methods between geodetic points.

  • Discretization between two projected points using the method discretize(). Maximum distance between discretized point has to be provided.
  • Discretization along a polygon line of geodetic coordinates using the method discretizeAndApplyTo(). Maximum distance between discretized point has to be provided as well as the discretization strategy.

The discretization strategy is provided with the enumeration EnumLineProperty. It offers the following possibilities:

  • STRAIGHT: straight line between two geodetic points.
  • GREAT_CIRCLE: arc being the shortest way to connect two geodetic points on an ellipsoid. The center of the ellipsis is the ellipsoid center.
  • STRAIGHT_RHUMB_LINE: arc between two geodetic points crossing all meridians of longitude at the same angle. It corresponds to a path of constant bearing as measured relative to true north. On Mercator projection, it is represented by a straight line.

Other methods are available. For more information, refer to the javadoc of [[[:Modèle:JavaDoc4.15]]/fr/cnes/sirius/patrius/projections/AbstractProjection.html AbstractProjection] class.

Computation on the surface of an ellipsoid

A specific ellipsoid class has been defined to handle projections: ProjectionEllipsoid. This class inherits the class OneAxisEllipsoid.
It provides many useful projection-related computations on the surface of an ellipsoid.
Available features of ProjectionEllipsoid are:

  • Distance computation:

Orthodromic distance using method computeOrthodromicDistance(). Orthodromic distance is the shortest path between two points.
Loxodromic distance using method computeLoxodromicDistance(). Loxodromic distance follows path of constant bearing: this is a straight line on Mercator projection.
Meridional distance using method computeMeridionalDistance(). Meridional distance is the shortest distance from one point to the equator (along a meridian).

On next image, Loxodromic distance is in red, orthodromic distance in blue:

LoxodromieOrthodromie.png
  • Azimuth computation:

Bearing using method computeBearing().
Spherical azimuth using method computeSphericalAzimuth().

  • Other computations:

Point along loxodrome, given a point, a distance from this point and an azimuth from this point, using method computePointAlongLoxodrome().
Point along orthodrome, given a point, a distance from this point and an azimuth from this point, using method computePointAlongOrthodrome().

Other methods are available. For more information, refer to the javadoc of [[[:Modèle:JavaDoc4.15]]/fr/cnes/sirius/patrius/projections/ProjectionEllipsoid.html ProjectionEllipsoid] class.

Getting Started

Projections provide three main features:

  • Projection on an ellipsoid (and its inverse application)
  • Discretisation between points on the surface of an ellipsoid
  • Geometric computation on the surface of an ellipsoid using class ProjectionEllipsoid

Projection on an ellipsoid

First an ellipsoid and a projection have to be defined, here using a simple centered Mercator projection:

final EllipsoidBodyShape ellipsoid = new OneAxisEllipsoid(6378137.0, 1. / 298.257223563, FramesFactory.getITRF(), "earth");
final Mercator projection = new Mercator(0., ellipsoid);

Then the created projection can be used in different ways:

  • Projection of geodetic coordinates:
final EllipsoidPoint toulouse = new EllipsoidPoint(ellipsoid, LLHCoordinatesSystem.ELLIPSODETIC, 0.758011794, 0.026140528, 256., "toulouse");
final Vector2D projectedPoint = projection.applyTo(toulouse);
  • Retrieve geodetic coordinates from Mercator 2D coordinates:
final EllipsoidPoint geodeticCoordinates = projection.applyInverseTo(projectedPoint.getX(), projectedPoint.getY());

Discretization

First an ellipsoid and a projection have to be defined, here using a simple centered Mercator projection:

final EllipsoidBodyShape ellipsoid = new OneAxisEllipsoid(6378137.0, 1. / 298.257223563, FramesFactory.getITRF(), "earth");
final Mercator projection = new Mercator(0., ellipsoid);

Then the created projection can be used in different ways:

  • Discretization between two projected points with a maximum distance between points of 1km:
final EllipsoidPoint toulouse = new EllipsoidPoint(ellipsoid, LLHCoordinatesSystem.ELLIPSODETIC, 0.758011794, 0.026140528, 256., "toulouse");
final EllipsoidPoint london = new EllipsoidPoint(ellipsoid, LLHCoordinatesSystem.ELLIPSODETIC, 0.898844565, 0.002268928, 25., "london");
final Vector2D projectedToulouse = projection.applyTo(toulouse);
final Vector2D projectedLondon = projection.applyTo(london);
final List<Vector2D> points = projection.discretize(projectedToulouse, projectedLondon, 1000., true);
  • Rhumb discretization along a polygon line with a maximum distance between points of 1km followed by projection:
final List<EllipsoidPoint > list = new ArrayList<>();
list.add(toulouse);
list.add(london);
final List<Vector2D> points = projection.discretizeAndApplyTo(list , EnumLineProperty.STRAIGHT_RHUMB_LINE, 1000.);
  • etc. Other similar discretization features are available. See javadoc for more information.

Computation on the surface of an ellipsoid

First an ellipsoid has to be defined:

final EllipsoidBodyShape ellipsoid = new OneAxisEllipsoid(6378137.0, 1. / 298.257223563, FramesFactory.getITRF(), "earth");

Then this ellipsoid can be used to:

  • Compute distances on the surface of the ellipsoid:
final double orthodromicDistance = ellipsoid.computeOrthodromicDistance(toulouse, london);
final double loxodromicDistance = ellipsoid.computeLoxodromicDistance(toulouse, london);
final double meridionalDistance = ellipsoid.computeMeridionalDistance(toulouse.getLatitude());
  • Compute azimuth angles on the surface of the ellipsoid:
final double bearing = ellipsoid.computeBearing(toulouse, london);
final double sphericalAzimuth = ellipsoid.computeSphericalAzimuth(toulouse, london);
  • etc. Other similar features are available. See javadoc for more information.


Contents

Interfaces

Interface Summary Javadoc
IProjection Interface for projections on a 3D body. [[[:Modèle:JavaDoc4.15]]/fr/cnes/sirius/patrius/projections/IProjection.html ...]

Classes

Class Summary Javadoc
EnumLineProperty Enumeration of points connecting strategies on an ellipsoid. [[[:Modèle:JavaDoc4.15]]/fr/cnes/sirius/patrius/projections/EnumLineProperty.html ...]
IdentityProjection Identity projection. [[[:Modèle:JavaDoc4.15]]/fr/cnes/sirius/patrius/projections/IdentityProjection.html ...]
GeneralizedFlamsteedSamson Flamsteed-Samson projection. [[[:Modèle:JavaDoc4.15]]/fr/cnes/sirius/patrius/projections/GeneralizedFlamsteedSamson.html ...]
Mercator Mercator projection. [[[:Modèle:JavaDoc4.15]]/fr/cnes/sirius/patrius/projections/Mercator.html ...]
ProjectionEllipsoid Ellipsoid with extended features (features related to projections). [[[:Modèle:JavaDoc4.15]]/fr/cnes/sirius/patrius/projections/ProjectionEllipsoid.html ...]