org.esa.beam.framework.datamodel
Class GcpGeoCoding

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

public class GcpGeoCoding
extends AbstractGeoCoding

Ground control point (GCP) geo-coding.

Version:
$Revision$ $Date$
Author:
Ralf Quast

Nested Class Summary
static class GcpGeoCoding.Method
          Class representing the approximation methods used for the GCP geo-coding.
 
Constructor Summary
GcpGeoCoding(GcpGeoCoding.Method method, double[] x, double[] y, double[] lons, double[] lats, int sceneWidth, int sceneHeight, Datum datum)
          Constructs a new instance of this class.
GcpGeoCoding(GcpGeoCoding.Method method, Placemark[] gcps, int sceneWidth, int sceneHeight, Datum datum)
          Constructs a new instance of this class.
 
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)
           
 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.
 GcpGeoCoding.Method getMethod()
          Returns the approximation method used for this geo-coding.
 GeoCoding getOriginalGeoCoding()
           
 PixelPos getPixelPos(GeoPos geoPos, PixelPos pixelPos)
          Returns the pixel co-ordinates as x/y for a given geographical position given as lat/lon.
 double getRmseLat()
          Returns the root mean square error (RMSE) of the latitude approximation.
 double getRmseLon()
          Returns the root mean square error (RMSE) of the longitude approximation.
 int hashCode()
           
 boolean isCrossingMeridianAt180()
          Checks whether or not the longitudes of this geo-coding cross the +/- 180 degree meridian.
 void setGcps(Placemark[] gcps)
           
 void setOriginalGeoCoding(GeoCoding geoCoding)
           
 boolean transferGeoCoding(Scene sourceScene, Scene targetScene, 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

GcpGeoCoding

public GcpGeoCoding(GcpGeoCoding.Method method,
                    Placemark[] gcps,
                    int sceneWidth,
                    int sceneHeight,
                    Datum datum)
Constructs a new instance of this class.

Parameters:
method - the approximation method.
gcps - the ground control points.
sceneWidth - the scene width.
sceneHeight - the scene height.
datum - the datum.

GcpGeoCoding

public GcpGeoCoding(GcpGeoCoding.Method method,
                    double[] x,
                    double[] y,
                    double[] lons,
                    double[] lats,
                    int sceneWidth,
                    int sceneHeight,
                    Datum datum)
Constructs a new instance of this class.

Parameters:
method - the approximation method.
x - the x coordinates.
y - the y coordinates.
lons - the longitudes.
lats - the latitudes.
sceneWidth - the scene width.
sceneHeight - the scene height.
datum - the datum.
Method Detail

transferGeoCoding

public boolean transferGeoCoding(Scene sourceScene,
                                 Scene targetScene,
                                 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:
sourceScene - the source scene
targetScene - the destination scene
subsetDef - the definition of the subset, may be null
Returns:
true, if the geo-coding could be transferred.

isCrossingMeridianAt180

public boolean isCrossingMeridianAt180()
Checks whether or not the longitudes of this geo-coding cross the +/- 180 degree meridian.

Returns:
true, if so

canGetPixelPos

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

Returns:
true, if so

canGetGeoPos

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

Returns:
true, if so

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 in the coodinate system determined by GeoCoding.getDatum()
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

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 in the coodinate system determined by GeoCoding.getDatum()

getDatum

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

Returns:
the datum

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

dispose

public void dispose()
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.


getRmseLon

public double getRmseLon()
Returns the root mean square error (RMSE) of the longitude approximation.

Returns:
the longitude RMSE.

getRmseLat

public double getRmseLat()
Returns the root mean square error (RMSE) of the latitude approximation.

Returns:
the latitude RMSE.

getMethod

public GcpGeoCoding.Method getMethod()
Returns the approximation method used for this geo-coding.

Returns:
the approximation method.

setOriginalGeoCoding

public void setOriginalGeoCoding(GeoCoding geoCoding)

getOriginalGeoCoding

public GeoCoding getOriginalGeoCoding()

setGcps

public void setGcps(Placemark[] gcps)


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