Interface ILcdProjection

All Superinterfaces:
ILcdPropertyChangeSource, Serializable
All Known Subinterfaces:
ILcdAzimuthal, ILcdConic, ILcdCylindrical, ILcdGeneralPerspective, ILcdObliqueCylindrical, ILcdPerspective, ILcdRectifiedProjection, ILcdTransverseCylindrical
All Known Implementing Classes:
ALcdAzimuthal, ALcdConic, ALcdCylindrical, ALcdGeneralPerspective, ALcdObliqueCylindrical, ALcdPerspective, ALcdProjection, ALcdTransverseCylindrical, TLcdAlbersEqualAreaConic, TLcdAzimuthalEquidistant, TLcdCassini, TLcdCassiniSoldner, TLcdDutchStereographic, TLcdEckertIV, TLcdEckertVI, TLcdEllipsoidalEquidistantCylindrical, TLcdEllipsoidalLambertAzimuthalEqualArea, TLcdEquidistantCylindrical, TLcdGeneralPerspective, TLcdGeodetic, TLcdGnomonic, TLcdKrovak, TLcdLambertAzimuthalEqualArea, TLcdLambertConformal, TLcdMercator, TLcdMillerCylindrical, TLcdMollweide, TLcdObliqueMercator, TLcdOrthographic, TLcdOrthorectifiedProjection, TLcdPerspectiveProjection, TLcdPolarStereographic, TLcdPolyconic, TLcdPseudoMercator, TLcdRectifiedPolynomialProjection, TLcdRectifiedProjectiveProjection, TLcdRectifiedRationalProjection, TLcdRPCProjection, TLcdSimpleRectangular, TLcdStereographic, TLcdSwissObliqueMercator, TLcdTransverseMercator, TLcdTransverseMercatorSPCS, TLcdVerticalPerspective

public interface ILcdProjection extends Serializable, ILcdPropertyChangeSource
An ILcdProjection is a map projection. ILcdProjection objects transform geodetic coordinates (longitude-latitude-height) to world coordinates (x-y) and vice versa. The inverse transformation transforms a (x,y) point to a (lon,lat,height) point by taking the height of the input/output parameter (lon,lat,height).

The origin of the ILcdProjection is a lat-lon point and corresponds to the (0,0) origin of the cartesian coordinate system of the projection.

ILcdProjection Structure

An ILcdProjection has zero or more java.beans.PropertyChangeListeners associated to it. The ILcdProjection sends a java.beans.PropertyChangeEvent whenever the state of the ILcdProjection changes. (Listener pattern)

ILcdProjection Listener

  • Field Details

    • EPSILON

      static final double EPSILON
      The constant EPSILON is used for two purposes.
      1. It serves as a safety measure for numerical rounding and approximation errors. When the grid is painted with a certain projection it asks for the boundaries of the projection used. However, some of these boundaries are determined from the projection formulas for the sphere while in general the projection formulas of the ellipsoid are used. This can introduce some approximation errors that may lead to out of bounds exceptions. When this happens the grid line would not be painted. Even if one is able to calculate the exact boundaries of the projection this out of bounds exception might occur. Rounding errors might cause exact boundary points to be considered out of bounds.
      2. The ILcdProjection provides the grid painter with information about the boundary longitudes for a certain latitude. If the whole interval [-180,180] is visible, there will be unwanted lines drawn. This is due to the fact that the longitude -180 is exactly the same as the longitude 180 whereas this same point is visible twice (at two sides of the projection plane). We prevent drawing a line from one side of the screen to the other side of the screen by narrowing the longitude interval.
      See Also:
  • Method Details

    • loadProperties

      void loadProperties(String aPrefix, Properties aProperties)
      The properties of an ILcdProjection determine the projection parameters that determine the plane, cylinder or cone on which the projection is done. The properties of an ILcdProjection are of course dependent on the projection. A common property for all ILcdprojection objects is the origin of the projection. Other, more specific, properties are standard parallels, azimuthal direction, perspective distance, ... .
      Parameters:
      aPrefix - prefix for property names.
      aProperties - Properties object containing the serialized projection.
    • writePropertiesSFCT

      void writePropertiesSFCT(String aPrefix, Properties aPropertiesSFCT)
      The properties of an ILcdProjection determine the projection parameters that determine the plane, cylinder or cone on which the projection is done. The properties of an ILcdProjection are of course dependent on the projection. A common property for all ILcdprojection objects is the origin of the projection. Other, more specific, properties are standard parallels, azimuthal direction, perspective distance, ... .
      Parameters:
      aPrefix - prefix for property names.
      aPropertiesSFCT - Properties object in which to store the serialized projection properties as side effect.
    • isAllInBounds

      boolean isAllInBounds()
      If all geodetic coordinates (l ,j ) are projected (visible) by an ILcdProjection and all (x,y ) coordinates are bounded this is true. All ILcdProjection objects have bounded (x,y ) coordinates because the projection is cut off if necessary.
      Returns:
      true if all LonLatPoints are within the bounds of the projection, false otherwise.
    • isContinuous

      boolean isContinuous()
      An ILcdProjection is continuous if there are no interruptions in the world coordinates. Most projections are continuous.
      Returns:
      true if the projection is continuous, false otherwise.
    • getOrigin

      ILcdPoint getOrigin()
      Origin of the projection is the ILcd2DEditablePoint that corresponds with origin (0, 0) of the cartesian coordinate system of the projection.
      Returns:
      the origin of the projection.
    • lonlatheight2worldOnSphereSFCT

      void lonlatheight2worldOnSphereSFCT(ILcdPoint aLLHP, double aRadius, ILcd2DEditablePoint aXYPointSFCT) throws TLcdOutOfBoundsException
      Transforms an ILcd2DEditablePoint on a sphere into the cartesian coordinate system of the projection.
      Parameters:
      aLLHP - point to be projected.
      aRadius - radius of the sphere (meters).
      aXYPointSFCT - projected point as side effect.
      Throws:
      TLcdOutOfBoundsException - If the ILcdPoint aLLHP is not within the valid area of the projection (visible area), then this exception is thrown.
    • lonlatheight2worldOnEllipsoidSFCT

      void lonlatheight2worldOnEllipsoidSFCT(ILcdPoint aLLHP, ILcdEllipsoid aEllipsoid, ILcd2DEditablePoint aXYPointSFCT) throws TLcdOutOfBoundsException
      Transforms an ILcdPoint on an ILcdEllipsoid into the cartesian coordinate system of the projection.
      Parameters:
      aLLHP - point to be projected.
      aEllipsoid - ellipsoid on which the point is defined.
      aXYPointSFCT - projected point as side effect.
      Throws:
      TLcdOutOfBoundsException - If the ILcdPoint aLLHP is not within the valid area of the projection (visible area), then this exception is thrown.
    • world2lonlatOnSphereSFCT

      void world2lonlatOnSphereSFCT(ILcdPoint aXYPoint, double aRadius, ILcd2DEditablePoint aLLPointSFCT) throws TLcdOutOfBoundsException
      Transforms an ILcdPoint from the cartesian coordinate system of the projection into an ILcd2DEditablePoint onto a sphere.
      Parameters:
      aXYPoint - projected point for which the corresponding geodetic point is sought.
      aRadius - radius of the sphere (meters).
      aLLPointSFCT - resulting geodetic coordinate as side effect.
      Throws:
      TLcdOutOfBoundsException - If the ILcdPoint aXYPoint is not within the valid area of the projection (visible area), then this exception is thrown.
    • world2lonlatOnEllipsoidSFCT

      void world2lonlatOnEllipsoidSFCT(ILcdPoint aXYPoint, ILcdEllipsoid aEllipsoid, ILcd2DEditablePoint aLLPointSFCT) throws TLcdOutOfBoundsException
      Transforms an ILcdPoint from the cartesian coordinate system of the projection into an ILcd2DEditablePoint onto an ILcdEllipsoid.
      Parameters:
      aXYPoint - projected point for which the corresponding geodetic point is sought.
      aEllipsoid - ellipsoid on which the geodetic coordinate is defined.
      aLLPointSFCT - resulting geodetic coordinate as side effect.
      Throws:
      TLcdOutOfBoundsException - If the ILcdPoint aXYPoint is not within the valid area of the projection (visible area), then this exception is thrown.
    • inLonLatBounds

      boolean inLonLatBounds(ILcdPoint aLLHP)
      Checks if an ILcdPoint is inside the valid area of geodetic coordinates of the projection. The valid area is determined by the LonLatPoints that are visible and for which the corresponding cartesian coordinate is within the boundaries.
      Parameters:
      aLLHP - ILcdPoint to be checked upon.
      Returns:
      true if valid, false if invalid.
    • inWorldBoundsOnSphere

      boolean inWorldBoundsOnSphere(ILcdPoint aXYPoint, double aRadius)
      Checks if a ILcdPoint is inside the valid cartesian area of the projection. The valid cartesian area is determined naturally by the projection bounds or by an artificial introduced boundary limit because some cartesian points are at infinity. The shape of the valid cartesian area is in many cases rectangular or circular although it might be more complex.
      Parameters:
      aXYPoint - point to be checked upon.
      aRadius - radius of the sphere.
      Returns:
      true if valid, false if invalid.
    • inWorldBoundsOnEllipsoid

      boolean inWorldBoundsOnEllipsoid(ILcdPoint aXYPoint, ILcdEllipsoid aEllipsoid)
      Checks if a ILcdPoint is inside the valid cartesian area of the projection.
      Parameters:
      aXYPoint - point to be checked upon.
      aEllipsoid - ellipsoid on which the geodetic coordinate is defined.
      Returns:
      true if valid, false if invalid.
      See Also:
    • world2DEditableBoundsOnSphereSFCT

      void world2DEditableBoundsOnSphereSFCT(double aRadius, ILcd2DEditableBounds aWorldBounds)
      Sets the ILcd2DEditableBounds object to the bounds of the projection in world coordinates.
      Parameters:
      aRadius - radius of the sphere.
      aWorldBounds - the bounds of the projection in world coordinates as side effect.
    • world2DEditableBoundsOnEllipsoidSFCT

      void world2DEditableBoundsOnEllipsoidSFCT(ILcdEllipsoid aEllipsoid, ILcd2DEditableBounds aWorldBounds)
      Sets the ILcd2DEditableBounds object to the bounds of the projection in world coordinates.
      Parameters:
      aEllipsoid - ellipsoid considered.
      aWorldBounds - the bounds of the projection in world coordinates as side effect.
    • boundaryLons

      double[][] boundaryLons(double aLatitude)
      Calculates an array of longitude pairs for a given latitude that are at the boundary of the valid area of the transformation of the projection.
      Parameters:
      aLatitude - latitude in decimal degrees and -90.0 <= aLat<= 90.0.
      Returns:
      the array of pairs of longitudes[0] and longitudes[1], where the closed interval longitudes[0] -> longitudes[1] is in visible area and -180.0 <= lon[i] <= 180.0.
    • boundaryLats

      double[][] boundaryLats(double aLongitude)
      Calculates an array of latitude pairs for a given longitude that are at the boundary of the valid area of the transformation of the projection.
      Parameters:
      aLongitude - longitude in decimal degrees -180.0 <= lon <= 180.0 .
      Returns:
      the array of pairs of latitudes lats[0] and lats[1], where the closed interval lats[0] -> lats[1] is in visible area and -90.0 <= lats[i] <= 90.0 .
    • toString

      String toString()
      String representation of this ILcdProjection.
      Overrides:
      toString in class Object
      Returns:
      String representation of this ILcdProjection.
    • clone

      Object clone()
      Makes a deep clone of this ILcdProjection.
      Returns:
      deep clone of this ILcdProjection.
    • equals

      boolean equals(Object aProjection)
      Checks if this ILcdProjection equals some other Object.
      Overrides:
      equals in class Object
      Parameters:
      aProjection - Object to compare with.
      Returns:
      true if the Object is an instance of the same ILcdProjection class and having the same projection properties, false otherwise.