org.esa.beam.framework.datamodel
Class TiePointGeoCoding

java.lang.Object
  extended by org.esa.beam.framework.datamodel.AbstractGeoCoding
      extended by org.esa.beam.framework.datamodel.TiePointGeoCoding
All Implemented Interfaces:
GeoCoding

public class TiePointGeoCoding
extends AbstractGeoCoding

A geo-coding based on two tie-point grids. One grid stores the latitude tie-points, the other stores the longitude tie-points.


Nested Class Summary
static class TiePointGeoCoding.Approximation
           
 
Constructor Summary
TiePointGeoCoding(TiePointGrid latGrid, TiePointGrid lonGrid)
          Constructs geo-coding based on two given tie-point grids providing coordinates on the WGS-84 datum.
TiePointGeoCoding(TiePointGrid latGrid, TiePointGrid lonGrid, Datum datum)
          Constructs geo-coding based on two given tie-point grids.
 
Method Summary
 boolean canGetGeoPos()
          Checks whether this geo-coding can determine the geodetic position from a pixel position.
 boolean canGetPixelPos()
          Checks whether 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)
           
 TiePointGeoCoding.Approximation getApproximation(int index)
          Gets the approximations for the given index.
 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.
 TiePointGrid getLatGrid()
           
 TiePointGrid getLonGrid()
           
 int getNumApproximations()
          Gets the number of approximations used for the transformation map (lat,lon) --> image (x,y).
 PixelPos getPixelPos(GeoPos geoPos, PixelPos pixelPos)
          Returns the pixel co-ordinates as x/y for a given geographical position given as lat/lon.
 int hashCode()
           
 boolean isCrossingMeridianAt180()
          Gets the flag indicating that the geographic boundary of the tie-points in this geo-coding intersects the 180 degree meridian.
static float normalizeLat(float lat)
          Gets the normalized latitude value.
 float normalizeLon(float lon)
          Gets the normalized longitude value.
 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

TiePointGeoCoding

public TiePointGeoCoding(TiePointGrid latGrid,
                         TiePointGrid lonGrid)
Constructs geo-coding based on two given tie-point grids providing coordinates on the WGS-84 datum.

Parameters:
latGrid - the latitude grid
lonGrid - the longitude grid

TiePointGeoCoding

public TiePointGeoCoding(TiePointGrid latGrid,
                         TiePointGrid lonGrid,
                         Datum datum)
Constructs geo-coding based on two given tie-point grids.

Parameters:
latGrid - the latitude grid
lonGrid - the longitude grid
datum - the geodetic datum
Method Detail

getDatum

public Datum getDatum()
Gets the datum, the reference point or surface against which GeoPos measurements are made.

Returns:
the datum

isCrossingMeridianAt180

public boolean isCrossingMeridianAt180()
Gets the flag indicating that the geographic boundary of the tie-points in this geo-coding intersects the 180 degree meridian.

Returns:
true if so

getNumApproximations

public int getNumApproximations()
Gets the number of approximations used for the transformation map (lat,lon) --> image (x,y).

Returns:
the number of approximations, zero if no approximations could be computed

getApproximation

public TiePointGeoCoding.Approximation getApproximation(int index)
Gets the approximations for the given index.

Parameters:
index - the index, must be between 0 and getNumApproximations() - 1
Returns:
the approximation, never null

canGetGeoPos

public boolean canGetGeoPos()
Checks whether this geo-coding can determine the geodetic position from a pixel position.

Returns:
true, if so

canGetPixelPos

public boolean canGetPixelPos()
Checks whether this geo-coding can determine the pixel position from a geodetic position.

Returns:
true, if so

getLatGrid

public TiePointGrid getLatGrid()
Returns:
the latitude grid, never null.

getLonGrid

public TiePointGrid getLonGrid()
Returns:
the longitude grid, never null.

getGeoPos

public GeoPos getGeoPos(PixelPos pixelPos,
                        GeoPos geoPos)
Returns the latitude and longitude value for a given pixel co-ordinate.

Parameters:
pixelPos - the pixel's co-ordinates given as x,y
geoPos - 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.
Returns:
the geographical position as lat/lon.

getPixelPos

public PixelPos getPixelPos(GeoPos geoPos,
                            PixelPos pixelPos)
Returns the pixel co-ordinates as x/y for a given geographical position given as lat/lon.

Parameters:
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.
Returns:
the pixel co-ordinates as x/y

normalizeLat

public static float normalizeLat(float lat)
Gets the normalized latitude value. The method returns Float.NaN if the given latitude value is out of bounds.

Parameters:
lat - the raw latitude value in the range -90 to +90 degrees
Returns:
the normalized latitude value, Float.NaN else

normalizeLon

public final float normalizeLon(float lon)
Gets the normalized longitude value. The method returns Float.NaN if the given longitude value is out of bounds or if it's normalized value is not in the value range of this geo-coding's normalized longitude grid..

Parameters:
lon - the raw longitude value in the range -180 to +180 degrees
Returns:
the normalized longitude value, Float.NaN else

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

dispose

public void dispose()
Description copied from interface: GeoCoding
Releases all of the resources used by this object instance and all of its owned children. Its primary use is to allow the garbage collector to perform a vanilla job.

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.


transferGeoCoding

public boolean transferGeoCoding(Scene srcScene,
                                 Scene destScene,
                                 ProductSubsetDef subsetDef)
Transfers the geo-coding of the srcScene to the destScene with respect to the given subsetDef.

Specified by:
transferGeoCoding in class AbstractGeoCoding
Parameters:
srcScene - the source scene
destScene - the destination scene
subsetDef - the definition of the subset, may be null
Returns:
true, if the geo-coding could be transferred.


Copyright © 2002-2013 Brockmann Consult GmbH. All Rights Reserved.