|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.esa.beam.framework.datamodel.AbstractGeoCoding
org.esa.beam.framework.datamodel.PixelGeoCoding
public class PixelGeoCoding
The PixelGeoCoding is an implementation of a GeoCoding which uses
dedicated latitude and longitude bands in order to provide geographical positions
for each pixel. Unlike the TiePointGeoCoding
tie-point grids,
the PixelGeoCoding class uses bands.
This class is especially useful for high accuracy geo-coding, e.g. if geographical positions are computed for each pixel by an upstream orthorectification.
While the implementation of the getGeoPos(PixelPos, GeoPos) is straight forward,
the getPixelPos(GeoPos, PixelPos) uses two different search algorithms in order to
find the corresponding geo-position for a given pixel:
Use instances of this class with care: The constructor fully loads the data given by the latitudes and longitudes bands and the valid mask (if any) into memory.
Note (rq-20110526): A better implementation of the find pixel method could be something like:
| Constructor Summary | |
|---|---|
PixelGeoCoding(Band latBand,
Band lonBand,
String validMask,
int searchRadius)
Constructs a new pixel-based geo-coding. |
|
PixelGeoCoding(Band latBand,
Band lonBand,
String validMask,
int searchRadius,
com.bc.ceres.core.ProgressMonitor pm)
Constructs a new pixel-based geo-coding. |
|
| Method Summary | |
|---|---|
boolean |
canGetGeoPos()
Checks whether or not this geo-coding can determine the geodetic position from a pixel position. |
boolean |
canGetPixelPos()
Checks whether or not this geo-coding can determine the pixel position from a geodetic position. |
void |
dispose()
Releases all of the resources used by this object instance and all of its owned children. |
boolean |
equals(Object o)
|
protected void |
fillInvalidGaps(IndexValidator validator,
float[] latElems,
float[] lonElems,
com.bc.ceres.core.ProgressMonitor pm)
Fills the gaps in the given latitude and longitude data buffers. |
Datum |
getDatum()
Gets the datum, the reference point or surface against which GeoPos measurements are made. |
GeoPos |
getGeoPos(PixelPos pixelPos,
GeoPos geoPos)
Returns the latitude and longitude value for a given pixel co-ordinate. |
Band |
getLatBand()
|
Band |
getLonBand()
|
PixelPos |
getPixelPos(GeoPos geoPos,
PixelPos pixelPos)
Returns the pixel co-ordinates as x/y for a given geographical position given as lat/lon. |
GeoCoding |
getPixelPosEstimator()
Gets the underlying geo-coding used as pixel position estimator. |
void |
getPixelPosUsingEstimator(GeoPos geoPos,
PixelPos pixelPos)
Returns the pixel co-ordinates as x/y for a given geographical position given as lat/lon. |
void |
getPixelPosUsingQuadTreeSearch(GeoPos geoPos,
PixelPos pixelPos)
Returns the pixel co-ordinates as x/y for a given geographical position given as lat/lon. |
static long |
getRequiredMemory(Product product,
boolean usesValidMask)
Computes an estimation of the memory required to create an instance of this class for the given product. |
int |
getSearchRadius()
Gets the search radius used by this geo-coding. |
String |
getValidMask()
|
int |
hashCode()
|
boolean |
isCrossingMeridianAt180()
Checks whether or not the longitudes of this geo-coding cross the +/- 180 degree meridian. |
boolean |
transferGeoCoding(Scene srcScene,
Scene destScene,
ProductSubsetDef subsetDef)
Transfers the geo-coding of the srcScene to the destScene with respect to the given
subsetDef. |
| Methods inherited from class org.esa.beam.framework.datamodel.AbstractGeoCoding |
|---|
createImageCRS, getGeoCRS, getImageCRS, getImageToMapTransform, getMapCRS, setGeoCRS, setImageCRS, setMapCRS |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PixelGeoCoding(Band latBand,
Band lonBand,
String validMask,
int searchRadius)
getPixelPos(GeoPos, PixelPos) or getGeoPos(PixelPos, GeoPos).
latBand - the band providing the latitudeslonBand - the band providing the longitudesvalidMask - the valid mask expression used to identify valid lat/lon pairs, e.g. "NOT l1_flags.DUPLICATED".
Can be null if a valid mask is not used.searchRadius - the search radius in pixels, shall depend on the actual spatial scene resolution,
e.g. for 300 meter pixels a search radius of 5 is a good choice. This parameter is ignored
if the source product is not geo-coded.
public PixelGeoCoding(Band latBand,
Band lonBand,
String validMask,
int searchRadius,
com.bc.ceres.core.ProgressMonitor pm)
throws IOException
Use with care: This constructor fully loads the data given by the latitudes and longitudes bands and the valid mask (if any) into memory.
latBand - the band providing the latitudeslonBand - the band providing the longitudesvalidMask - the valid mask expression used to identify valid lat/lon pairs, e.g. "NOT l1_flags.DUPLICATED".
Can be null if a valid mask is not used.searchRadius - the search radius in pixels, shall depend on the actual spatial scene resolution,
e.g. for 300 meter pixels a search radius of 5 is a good choice. This parameter is ignored
if the source product is not geo-coded.pm - a monitor to inform the user about progress
IOException - if an I/O error occurs while additional data is loaded from the source product| Method Detail |
|---|
protected void fillInvalidGaps(IndexValidator validator,
float[] latElems,
float[] lonElems,
com.bc.ceres.core.ProgressMonitor pm)
Fills the gaps in the given latitude and longitude data buffers.
The method shall fill in reasonable a latitude and longitude value at all positions where
validator.validateIndex(pixelIndex) returns false.
The default implementation uses the underlying estimator (if any)
to find default values for the gaps.
validator - the pixel validator, never nulllatElems - the latitude data buffer in row-major orderlonElems - the longitude data buffer in row-major orderpm - a monitor to inform the user about progress
public static long getRequiredMemory(Product product,
boolean usesValidMask)
public Band getLatBand()
public Band getLonBand()
public String getValidMask()
public GeoCoding getPixelPosEstimator()
public int getSearchRadius()
public boolean isCrossingMeridianAt180()
true, if sopublic boolean canGetPixelPos()
true, if sopublic boolean canGetGeoPos()
true, if so
public PixelPos getPixelPos(GeoPos geoPos,
PixelPos pixelPos)
geoPos - the geographical position as lat/lon.pixelPos - an instance of Point to be used as retun value. If this parameter is
null, the method creates a new instance which it then returns.
public void getPixelPosUsingEstimator(GeoPos geoPos,
PixelPos pixelPos)
geoPos - the geographical position as lat/lon.pixelPos - the return value.
public void getPixelPosUsingQuadTreeSearch(GeoPos geoPos,
PixelPos pixelPos)
geoPos - the geographical position as lat/lon.pixelPos - the retun value
public GeoPos getGeoPos(PixelPos pixelPos,
GeoPos geoPos)
pixelPos - the pixel's co-ordinates given as x,ygeoPos - an instance of GeoPos to be used as retun value. If this parameter is
null, the method creates a new instance which it then returns.
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic void dispose()
This method should be called only if it is for sure that this object instance will never be used again. The
results of referencing an instance of this class after a call to dispose() are undefined.
public boolean transferGeoCoding(Scene srcScene,
Scene destScene,
ProductSubsetDef subsetDef)
srcScene to the destScene with respect to the given
subsetDef.
transferGeoCoding in class AbstractGeoCodingsrcScene - the source scenedestScene - the destination scenesubsetDef - the definition of the subset, may be null
public Datum getDatum()
GeoPos measurements are made.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||