Package com.luciad.projection
Class TLcdRPCProjection
java.lang.Object
com.luciad.projection.ALcdProjection
com.luciad.projection.TLcdRPCProjection
- All Implemented Interfaces:
ILcdProjection,ILcdPropertyChangeSource,Serializable,Cloneable
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:
-
Field Summary
Fields inherited from class com.luciad.projection.ALcdProjection
fPropertyChangeDispatcherFields inherited from interface com.luciad.projection.ILcdProjection
EPSILON -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new RPC projection, without specifying input parameters.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.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. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if thisILcdProjectionequals some other Object.doubleReturns the height offset.doubleReturns the height scaling factor.doubleReturns the latitude offset.doubleReturns the latitude scaling factor.doubleReturns the longitude offset.doubleReturns the longitude scaling factor.double[]Returns the denominator coefficients of the row rational function.double[]Returns the numerator coefficients of the row rational function.doubleReturns the offset of the world row coordinate.doubleReturns the world row coordinate scaling factor.Origin of the projection is theILcd2DEditablePointthat corresponds with origin (0, 0) of the cartesian coordinate system of the projection.double[]Returns the denominator coefficients of the column rational function.double[]Returns the numerator coefficients of the column rational function.doubleReturns the offset of the world column coordinate.doubleReturns the world column coordinate scaling factor.inthashCode()booleaninLonLatBounds(ILcdPoint aLLHP) Checks if anILcdPointis inside the valid area of geodetic coordinates of the projection.booleaninWorldBoundsOnSphere(ILcdPoint aXYPoint, double aRadius) Checks if aILcdPointis inside the valid cartesian area of the projection.booleanIf all geodetic coordinates (l ,j ) are projected (visible) by anILcdProjectionand all (x,y ) coordinates are bounded this istrue.booleanAnILcdProjectionis continuous if there are no interruptions in the world coordinates.voidloadProperties(String aPrefix, Properties aProperties) The properties of anILcdProjectiondetermine the projection parameters that determine the plane, cylinder or cone on which the projection is done.voidlonlatheight2worldOnSphereSFCT(ILcdPoint aLLHP, double aRadius, ILcd2DEditablePoint aXYPointSFCT) Transforms anILcd2DEditablePointon a sphere into the cartesian coordinate system of the projection.toString()String representation of thisILcdProjection.voidworld2DEditableBoundsOnSphereSFCT(double aRadius, ILcd2DEditableBounds aWorldBounds) Sets theILcd2DEditableBoundsobject to the bounds of the projection in world coordinates.voidworld2lonlatOnSphereSFCT(ILcdPoint aXYPoint, double aRadius, ILcd2DEditablePoint aLLPointSFCT) Transforms anILcdPointfrom the cartesian coordinate system of the projection into anILcd2DEditablePointonto a sphere.voidwritePropertiesSFCT(String aPrefix, Properties aPropertiesSFCT) The properties of anILcdProjectiondetermine the projection parameters that determine the plane, cylinder or cone on which the projection is done.Methods inherited from class com.luciad.projection.ALcdProjection
addPropertyChangeListener, boundaryLats, boundaryLons, clone, firePropertyChangeEvent, inWorldBoundsOnEllipsoid, lonlatheight2worldOnEllipsoidSFCT, removePropertyChangeListener, world2DEditableBoundsOnEllipsoidSFCT, world2lonlatOnEllipsoidSFCT
-
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 theloadPropertiesmethod. When not using theloadPropertiesmethod, 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 coordinateaSampleOffset- the offset of the world column coordinateaLatitudeOffset- the latitude offsetaLongitudeOffset- the longitude offsetaHeightOffset- the height offsetaLineScale- the world row coordinate scaling factoraSampleScale- the world column coordinate scaling factoraLatitudeScale- the latitude scaling factoraLongitudeScale- the longitude scaling factoraHeightScale- the height scaling factoraLineNumeratorCoefficients- the numerator coefficients of the row rational functionaLineDenominatorCoefficients- the denominator coefficients of the row rational functionaSampleNumeratorCoefficients- the numerator coefficients of the column rational functionaSampleDenominatorCoefficients- 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 coordinateaSampleOffset- the offset of the world column coordinateaLatitudeOffset- the latitude offsetaLongitudeOffset- the longitude offsetaHeightOffset- the height offsetaLineScale- the world row coordinate scaling factoraSampleScale- the world column coordinate scaling factoraLatitudeScale- the latitude scaling factoraLongitudeScale- the longitude scaling factoraHeightScale- the height scaling factoraLineNumeratorCoefficients- the numerator coefficients of the row rational functionaLineDenominatorCoefficients- the denominator coefficients of the row rational functionaSampleNumeratorCoefficients- the numerator coefficients of the column rational functionaSampleDenominatorCoefficients- the denominator coefficients of the column rational functionaRasterHeight- 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
Description copied from interface:ILcdProjectionThe properties of anILcdProjectiondetermine the projection parameters that determine the plane, cylinder or cone on which the projection is done. The properties of anILcdProjectionare of course dependent on the projection. A common property for allILcdprojectionobjects 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
Description copied from interface:ILcdProjectionThe properties of anILcdProjectiondetermine the projection parameters that determine the plane, cylinder or cone on which the projection is done. The properties of anILcdProjectionare of course dependent on the projection. A common property for allILcdprojectionobjects 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:ILcdProjectionIf all geodetic coordinates (l ,j ) are projected (visible) by anILcdProjectionand all (x,y ) coordinates are bounded this istrue. AllILcdProjectionobjects have bounded (x,y ) coordinates because the projection is cut off if necessary.- Returns:
trueif all LonLatPoints are within the bounds of the projection,falseotherwise.
-
isContinuous
public boolean isContinuous()Description copied from interface:ILcdProjectionAnILcdProjectionis continuous if there are no interruptions in the world coordinates. Most projections are continuous.- Returns:
trueif the projection is continuous,falseotherwise.
-
getOrigin
Description copied from interface:ILcdProjectionOrigin of the projection is theILcd2DEditablePointthat 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:ILcdProjectionTransforms anILcd2DEditablePointon 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 theILcdPointaLLHPis 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:ILcdProjectionTransforms anILcdPointfrom the cartesian coordinate system of the projection into anILcd2DEditablePointonto 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 theILcdPointaXYPointis not within the valid area of the projection (visible area), then this exception is thrown.
-
inLonLatBounds
Description copied from interface:ILcdProjectionChecks if anILcdPointis 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-ILcdPointto be checked upon.- Returns:
trueif valid,falseif invalid.
-
inWorldBoundsOnSphere
Description copied from interface:ILcdProjectionChecks if aILcdPointis 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:
trueif valid,falseif invalid.
-
world2DEditableBoundsOnSphereSFCT
Description copied from interface:ILcdProjectionSets theILcd2DEditableBoundsobject 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
Description copied from interface:ILcdProjectionChecks if thisILcdProjectionequals some other Object.- Specified by:
equalsin interfaceILcdProjection- Overrides:
equalsin classObject- Parameters:
aO- Object to compare with.- Returns:
- true if the Object is an instance of the same
ILcdProjectionclass and having the same projection properties, false otherwise.
-
hashCode
public int hashCode() -
toString
Description copied from interface:ILcdProjectionString representation of thisILcdProjection.- Specified by:
toStringin interfaceILcdProjection- Overrides:
toStringin classObject- Returns:
- String representation of this
ILcdProjection.
-