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
fPropertyChangeDispatcher
Fields inherited from interface com.luciad.projection.ILcdProjection
EPSILON
-
Constructor Summary
ConstructorDescriptionConstructs 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 TypeMethodDescriptionboolean
Checks if thisILcdProjection
equals some other Object.double
Returns the height offset.double
Returns the height scaling factor.double
Returns the latitude offset.double
Returns the latitude scaling factor.double
Returns the longitude offset.double
Returns the longitude scaling factor.double[]
Returns the denominator coefficients of the row rational function.double[]
Returns the numerator coefficients of the row rational function.double
Returns the offset of the world row coordinate.double
Returns the world row coordinate scaling factor.Origin of the projection is theILcd2DEditablePoint
that 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.double
Returns the offset of the world column coordinate.double
Returns the world column coordinate scaling factor.int
hashCode()
boolean
inLonLatBounds
(ILcdPoint aLLHP) Checks if anILcdPoint
is inside the valid area of geodetic coordinates of the projection.boolean
inWorldBoundsOnSphere
(ILcdPoint aXYPoint, double aRadius) Checks if aILcdPoint
is inside the valid cartesian area of the projection.boolean
If all geodetic coordinates (l ,j ) are projected (visible) by anILcdProjection
and all (x,y ) coordinates are bounded this istrue
.boolean
AnILcdProjection
is continuous if there are no interruptions in the world coordinates.void
loadProperties
(String aPrefix, Properties aProperties) The properties of anILcdProjection
determine the projection parameters that determine the plane, cylinder or cone on which the projection is done.void
lonlatheight2worldOnSphereSFCT
(ILcdPoint aLLHP, double aRadius, ILcd2DEditablePoint aXYPointSFCT) Transforms anILcd2DEditablePoint
on a sphere into the cartesian coordinate system of the projection.toString()
String representation of thisILcdProjection
.void
world2DEditableBoundsOnSphereSFCT
(double aRadius, ILcd2DEditableBounds aWorldBounds) Sets theILcd2DEditableBounds
object to the bounds of the projection in world coordinates.void
world2lonlatOnSphereSFCT
(ILcdPoint aXYPoint, double aRadius, ILcd2DEditablePoint aLLPointSFCT) Transforms anILcdPoint
from the cartesian coordinate system of the projection into anILcd2DEditablePoint
onto a sphere.void
writePropertiesSFCT
(String aPrefix, Properties aPropertiesSFCT) The properties of anILcdProjection
determine 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 theloadProperties
method. When not using theloadProperties
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 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:ILcdProjection
The properties of anILcdProjection
determine the projection parameters that determine the plane, cylinder or cone on which the projection is done. The properties of anILcdProjection
are of course dependent on the projection. A common property for allILcdprojection
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
Description copied from interface:ILcdProjection
The properties of anILcdProjection
determine the projection parameters that determine the plane, cylinder or cone on which the projection is done. The properties of anILcdProjection
are of course dependent on the projection. A common property for allILcdprojection
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 anILcdProjection
and all (x,y ) coordinates are bounded this istrue
. AllILcdProjection
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
AnILcdProjection
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
Description copied from interface:ILcdProjection
Origin of the projection is theILcd2DEditablePoint
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 anILcd2DEditablePoint
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 theILcdPoint
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 anILcdPoint
from the cartesian coordinate system of the projection into anILcd2DEditablePoint
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 theILcdPoint
aXYPoint
is not within the valid area of the projection (visible area), then this exception is thrown.
-
inLonLatBounds
Description copied from interface:ILcdProjection
Checks if anILcdPoint
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
Description copied from interface:ILcdProjection
Checks if aILcdPoint
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
Description copied from interface:ILcdProjection
Sets theILcd2DEditableBounds
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
Description copied from interface:ILcdProjection
Checks if thisILcdProjection
equals some other Object.- Specified by:
equals
in interfaceILcdProjection
- Overrides:
equals
in classObject
- 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() -
toString
Description copied from interface:ILcdProjection
String representation of thisILcdProjection
.- Specified by:
toString
in interfaceILcdProjection
- Overrides:
toString
in classObject
- Returns:
- String representation of this
ILcdProjection
.
-