Class TLcdRPCProjection

java.lang.Object
com.luciad.projection.ALcdProjection
com.luciad.projection.TLcdRPCProjection
All Implemented Interfaces:
ILcdProjection, ILcdPropertyChangeSource, Serializable, Cloneable

public class TLcdRPCProjection extends ALcdProjection
A projection that maps image coordinates to ground coordinates based on Rational Polynomial Coefficients. The polynomials define the normalized row and column values as a function of normalized geodetic latitude, longitude, and height.

The coefficients are typically read from an an NITF RPC00B extension or from an RPC text file from GeoEye or DigitalGlobe.

Sample Code

Reading a complete model reference containing an RPC projection, from an RPC text file:


 ILcdModelReferenceDecoder decoder = new TLcdRPCModelReferenceDecoder();

 ILcdModelReference reference = decoder.decode("image_rpc.txt");
 
Since:
9.1
See Also:
  • Constructor Details

    • TLcdRPCProjection

      public TLcdRPCProjection()
      Constructs a new RPC projection, without specifying input parameters. After creating a projection using this constructor, the projection should still be initialized using the loadProperties method. When not using the loadProperties method, one of the other constructors should be used instead.
    • TLcdRPCProjection

      public TLcdRPCProjection(double aLineOffset, double aSampleOffset, double aLatitudeOffset, double aLongitudeOffset, double aHeightOffset, double aLineScale, double aSampleScale, double aLatitudeScale, double aLongitudeScale, double aHeightScale, double[] aLineNumeratorCoefficients, double[] aLineDenominatorCoefficients, double[] aSampleNumeratorCoefficients, double[] aSampleDenominatorCoefficients)
      Constructs a projection corresponding to the given input parameters. See The RPC00B elment of the NITF format for a detailed description of the arguments.
      Parameters:
      aLineOffset - the offset of the world row coordinate
      aSampleOffset - the offset of the world column coordinate
      aLatitudeOffset - the latitude offset
      aLongitudeOffset - the longitude offset
      aHeightOffset - the height offset
      aLineScale - the world row coordinate scaling factor
      aSampleScale - the world column coordinate scaling factor
      aLatitudeScale - the latitude scaling factor
      aLongitudeScale - the longitude scaling factor
      aHeightScale - the height scaling factor
      aLineNumeratorCoefficients - the numerator coefficients of the row rational function
      aLineDenominatorCoefficients - the denominator coefficients of the row rational function
      aSampleNumeratorCoefficients - the numerator coefficients of the column rational function
      aSampleDenominatorCoefficients - the denominator coefficients of the column rational function
    • TLcdRPCProjection

      public TLcdRPCProjection(double aLineOffset, double aSampleOffset, double aLatitudeOffset, double aLongitudeOffset, double aHeightOffset, double aLineScale, double aSampleScale, double aLatitudeScale, double aLongitudeScale, double aHeightScale, double[] aLineNumeratorCoefficients, double[] aLineDenominatorCoefficients, double[] aSampleNumeratorCoefficients, double[] aSampleDenominatorCoefficients, int aRasterHeight)
      Constructs a projection corresponding to the given RPC input parameters and an image height. The y pixel coordinates are reversed to match the coordinate system of an image. This is useful when working with image coordinates that have the upper-left corner at location (0,0) and the y axis pointing downwards. For a detailed description of the other parameters, see The RPC00B elment of the NITF format.
      Parameters:
      aLineOffset - the offset of the world row coordinate
      aSampleOffset - the offset of the world column coordinate
      aLatitudeOffset - the latitude offset
      aLongitudeOffset - the longitude offset
      aHeightOffset - the height offset
      aLineScale - the world row coordinate scaling factor
      aSampleScale - the world column coordinate scaling factor
      aLatitudeScale - the latitude scaling factor
      aLongitudeScale - the longitude scaling factor
      aHeightScale - the height scaling factor
      aLineNumeratorCoefficients - the numerator coefficients of the row rational function
      aLineDenominatorCoefficients - the denominator coefficients of the row rational function
      aSampleNumeratorCoefficients - the numerator coefficients of the column rational function
      aSampleDenominatorCoefficients - the denominator coefficients of the column rational function
      aRasterHeight - the height of the raster using this projection. The y coordinates will be subtracted from this value before (world2lonlatOnSphereSFCT) or after (lonlatheight2worldOnSphereSFCT) performing the transformation.
  • Method Details

    • getLineOffset

      public double getLineOffset()
      Returns the offset of the world row coordinate.
      Returns:
      the offset of the world row coordinate.
    • getSampleOffset

      public double getSampleOffset()
      Returns the offset of the world column coordinate.
      Returns:
      the offset of the world column coordinate.
    • getGeodeticLatitudeOffset

      public double getGeodeticLatitudeOffset()
      Returns the latitude offset.
      Returns:
      the latitude offset.
    • getGeodeticLongitudeOffset

      public double getGeodeticLongitudeOffset()
      Returns the longitude offset.
      Returns:
      the longitude offset.
    • getGeodeticHeightOffset

      public double getGeodeticHeightOffset()
      Returns the height offset.
      Returns:
      the height offset.
    • getLineScale

      public double getLineScale()
      Returns the world row coordinate scaling factor.
      Returns:
      the world row coordinate scaling factor.
    • getSampleScale

      public double getSampleScale()
      Returns the world column coordinate scaling factor.
      Returns:
      the world column coordinate scaling factor.
    • getGeodeticLatitudeScale

      public double getGeodeticLatitudeScale()
      Returns the latitude scaling factor.
      Returns:
      the latitude scaling factor.
    • getGeodeticLongitudeScale

      public double getGeodeticLongitudeScale()
      Returns the longitude scaling factor.
      Returns:
      the longitude scaling factor.
    • getGeodeticHeightScale

      public double getGeodeticHeightScale()
      Returns the height scaling factor.
      Returns:
      the height scaling factor.
    • getLineNumeratorCoefficients

      public double[] getLineNumeratorCoefficients()
      Returns the numerator coefficients of the row rational function. The returned array should not be changed.
      Returns:
      the numerator coefficients of the row rational function.
    • getLineDenominatorCoefficients

      public double[] getLineDenominatorCoefficients()
      Returns the denominator coefficients of the row rational function. The returned array should not be changed.
      Returns:
      the denominator coefficients of the row rational function.
    • getSampleNumeratorCoefficients

      public double[] getSampleNumeratorCoefficients()
      Returns the numerator coefficients of the column rational function. The returned array should not be changed.
      Returns:
      the numerator coefficients of the column rational function.
    • getSampleDenominatorCoefficients

      public double[] getSampleDenominatorCoefficients()
      Returns the denominator coefficients of the column rational function. The returned array should not be changed.
      Returns:
      the denominator coefficients of the column rational function.
    • loadProperties

      public void loadProperties(String aPrefix, Properties aProperties)
      Description copied from interface: ILcdProjection
      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

      public void writePropertiesSFCT(String aPrefix, Properties aPropertiesSFCT)
      Description copied from interface: ILcdProjection
      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

      public boolean isAllInBounds()
      Description copied from interface: ILcdProjection
      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

      public boolean isContinuous()
      Description copied from interface: ILcdProjection
      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

      public ILcdPoint getOrigin()
      Description copied from interface: ILcdProjection
      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

      public void lonlatheight2worldOnSphereSFCT(ILcdPoint aLLHP, double aRadius, ILcd2DEditablePoint aXYPointSFCT) throws TLcdOutOfBoundsException
      Description copied from interface: ILcdProjection
      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.
    • world2lonlatOnSphereSFCT

      public void world2lonlatOnSphereSFCT(ILcdPoint aXYPoint, double aRadius, ILcd2DEditablePoint aLLPointSFCT) throws TLcdOutOfBoundsException
      Description copied from interface: ILcdProjection
      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.
    • inLonLatBounds

      public boolean inLonLatBounds(ILcdPoint aLLHP)
      Description copied from interface: ILcdProjection
      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

      public boolean inWorldBoundsOnSphere(ILcdPoint aXYPoint, double aRadius)
      Description copied from interface: ILcdProjection
      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.
    • world2DEditableBoundsOnSphereSFCT

      public void world2DEditableBoundsOnSphereSFCT(double aRadius, ILcd2DEditableBounds aWorldBounds)
      Description copied from interface: ILcdProjection
      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.
    • equals

      public boolean equals(Object aO)
      Description copied from interface: ILcdProjection
      Checks if this ILcdProjection equals some other Object.
      Specified by:
      equals in interface ILcdProjection
      Overrides:
      equals in class Object
      Parameters:
      aO - 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.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Description copied from interface: ILcdProjection
      String representation of this ILcdProjection.
      Specified by:
      toString in interface ILcdProjection
      Overrides:
      toString in class Object
      Returns:
      String representation of this ILcdProjection.