fr.cnes.sirius.patrius.projections
Class AbstractProjection

java.lang.Object
  extended by fr.cnes.sirius.patrius.projections.AbstractProjection
All Implemented Interfaces:
IProjection, Serializable
Direct Known Subclasses:
IdentityProjection, Mercator

public abstract class AbstractProjection
extends Object
implements IProjection

Abstract class for projections. This class is the generic class to handle implemented projections methods. This class was retrieved from the LibKernel and every calculation formula are extracted from the "Map Projection, A working manual" written by John P. Snyder.

Since:
3.2
Version:
$Id: AbstractProjection.java 17585 2017-05-10 13:27:59Z bignon $
Author:
Galpin Thomas
See Also:
Serialized Form
Concurrency :
not thread-safe

Constructor Summary
AbstractProjection(GeodeticPoint pivotIn, ProjectionEllipsoid shape)
          Constructor.
 
Method Summary
 List<GeodeticPoint> applyInverseTo(double[] x, double[] y)
          Inversion transformation of arrays of x and y projected coordinates.
 List<GeodeticPoint> applyInverseTo(List<Vector2D> list)
          Inverse Projects a list of Vector2D (projected points) with a given projection.
 List<Vector2D> applyTo(List<GeodeticPoint> list)
          Project a list of GeodeticPoints with a given projection.
 List<Vector2D> applyToAndDiscretize(GeodeticPoint from, GeodeticPoint to, double maxLength, boolean lastIncluded)
          Project two points, then discretize 2D the line.
 List<Vector2D> discretize(Vector2D p1, Vector2D p2, double maxLenght, boolean p2Included)
          Generate additional vertices between two points.
 List<Vector2D> discretizeAndApplyTo(List<GeodeticPoint> list, EnumLineProperty ltype, double maxLength)
          Discretizes a polygon conforming to a line property directive, and a maximum length of discretization.
 List<Vector2D> discretizeCircleAndApplyTo(List<GeodeticPoint> list, double maxLength)
          Discretize following great circle lines between vertices of polygon and project obtained points.
 List<Vector2D> discretizeRhumbAndApplyTo(List<GeodeticPoint> list, double maxLength)
          Project a rhumb line polygon, with the given projection.
abstract  double getDistortionFactor(double latitude)
          Returns the scale factor at a specific latitude.
 GeodeticPoint getPivotPoint()
          Get the projection pivot point.
 ProjectionEllipsoid getReference()
          Get the system of reference used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fr.cnes.sirius.patrius.projections.IProjection
applyInverseTo, applyInverseTo, applyTo, applyTo, canMap, getLineProperty, getMaximumEastingValue, getMaximumLatitude, isConformal, isEquivalent
 

Constructor Detail

AbstractProjection

public AbstractProjection(GeodeticPoint pivotIn,
                          ProjectionEllipsoid shape)
Constructor.

Parameters:
pivotIn - pivot point used for projection.
shape - reference shape used for projection.
Method Detail

getReference

public final ProjectionEllipsoid getReference()
Get the system of reference used.

Specified by:
getReference in interface IProjection
Returns:
System of reference.

getPivotPoint

public final GeodeticPoint getPivotPoint()
Get the projection pivot point.

Returns:
the projection pivot point

getDistortionFactor

public abstract double getDistortionFactor(double latitude)
Returns the scale factor at a specific latitude. The result is the fraction Mercator distance / real distance.

Parameters:
latitude - latitude
Returns:
the distortion factor

discretize

public final List<Vector2D> discretize(Vector2D p1,
                                       Vector2D p2,
                                       double maxLenght,
                                       boolean p2Included)
Generate additional vertices between two points. Can be use after a projection. In this case, p1 and p2 are projected points.

Parameters:
p1 - Projected point 1
p2 - Projected point 2
maxLenght - distance consistent with the projection scale. For a projection, this distance is correct only around pivot point
p2Included - p2 is included only if true
Returns:
A list of discretized Vector2D. P1 is always included. p2 is included as last point, only if p2Included is true. For a projection, the distance will be constant between 2 points, but can be variable after the inverse projection. The distance is exact only near the pivot point of the projection

discretizeAndApplyTo

public final List<Vector2D> discretizeAndApplyTo(List<GeodeticPoint> list,
                                                 EnumLineProperty ltype,
                                                 double maxLength)
                                          throws OrekitException
Discretizes a polygon conforming to a line property directive, and a maximum length of discretization. If this length <= 0, no discretization will be done, only projection. If the line property of the given projection is not conform to the line property directive, the intermediate points will be computed by an other way, before being projected.

Parameters:
list - of points defining the polygon
ltype - line type
maxLength - This distance is used when a discretization occurs, i.e : when the line property is not coherent with the projection (EnumLineProperty). This parameter represent a distance expressed in meters. This will be the maximal distance between two points of the projected polygon. If you set the parameter to a value <=0, no discretization will be done.
Returns:
List of projected points
Throws:
OrekitException - if complex polygon discretization fails

discretizeCircleAndApplyTo

public final List<Vector2D> discretizeCircleAndApplyTo(List<GeodeticPoint> list,
                                                       double maxLength)
                                                throws OrekitException
Discretize following great circle lines between vertices of polygon and project obtained points.

Parameters:
list - geodetic points list
maxLength - This distance is used when a discretization occurs : i.e : when the line property is not coherent with the projection ( EnumLineProperty). This parameter represent a distance expressed in meters. This will be the maximal distance between two points of the projected polygon. If you set the parameter to a value <=0 no discretization will be done.
Returns:
List of Vector2D (latitude/longitude).
Throws:
OrekitException - thrown if one projection could not be computed
See Also:
EnumLineProperty.GREAT_CIRCLE, EnumLineProperty.STRAIGHT

discretizeRhumbAndApplyTo

public final List<Vector2D> discretizeRhumbAndApplyTo(List<GeodeticPoint> list,
                                                      double maxLength)
                                               throws OrekitException
Project a rhumb line polygon, with the given projection.

If the projection type of line is rhumb, points will be directly projected and then discretized.

Else the discretization will be done by using ProjectionEllipsoid methods to compute points along a loxodrom, and projection will be done afterwards.

Parameters:
list - list of geodetic vectors
maxLength - This distance is used when a discretization occurs : i.e when the line property is not coherent with the projection ( EnumLineProperty). This parameter represent a distance expressed in meters. This will be the maximal distance between two points of the projected polygon. If you set the parameter to a value <=0 , no dicretization will be done.
Returns:
List of Vector2D as projected polygon (lat/lon).
Throws:
OrekitException - thrown if complex polygon discretization fails

applyToAndDiscretize

public final List<Vector2D> applyToAndDiscretize(GeodeticPoint from,
                                                 GeodeticPoint to,
                                                 double maxLength,
                                                 boolean lastIncluded)
                                          throws OrekitException
Project two points, then discretize 2D the line. A discontinuity is considered if the difference between the two X projected values is > at half of the X projection world at the end of the projection world.

Parameters:
from - the initial geodetic point
to - the final geodetic point
maxLength - maximal length for a leg, after discretization. If maxlength <=0, no discretization is done.
lastIncluded - the last point (to) is included if true
Returns:
the list of projected points
Throws:
OrekitException - thrown if projection of start or end point could not be computed

applyTo

public final List<Vector2D> applyTo(List<GeodeticPoint> list)
                             throws OrekitException
Project a list of GeodeticPoints with a given projection. A check and correction are done on each point if latitude > the maximum value of the projection.

Parameters:
list - list of geodetic points
Returns:
list of projected points
Throws:
OrekitException - thrown if one projection could not be computed

applyInverseTo

public final List<GeodeticPoint> applyInverseTo(List<Vector2D> list)
                                         throws OrekitException
Inverse Projects a list of Vector2D (projected points) with a given projection.

Parameters:
list - list of projected points
Returns:
list of geodetic points
Throws:
OrekitException - thrown if one inverse projection could not be computed

applyInverseTo

public final List<GeodeticPoint> applyInverseTo(double[] x,
                                                double[] y)
                                         throws OrekitException
Inversion transformation of arrays of x and y projected coordinates.

Parameters:
x - x coordinates of projected points
y - y coordinates of projected points
Returns:
list of geodetic points obtained by inverse projection
Throws:
OrekitException - thrown if arrays have not the same length


Copyright © 2017 CNES. All Rights Reserved.