Class CrsGeoCoding

java.lang.Object
org.esa.snap.core.datamodel.AbstractGeoCoding
org.esa.snap.core.datamodel.CrsGeoCoding
All Implemented Interfaces:
GeoCoding

public class CrsGeoCoding extends AbstractGeoCoding
A geo-coding that is based on a well-known coordinate reference system (CRS) and affine transformation used to locate a product's scene image within the CRS.
Since:
BEAM 4.7
  • Constructor Summary

    Constructors
    Constructor
    Description
    CrsGeoCoding(org.opengis.referencing.crs.CoordinateReferenceSystem mapCRS, int imageWidth, int imageHeight, double easting, double northing, double pixelSizeX, double pixelSizeY)
    Constructs a new instance of this class from a map CRS, image dimension, and image-to-map transformation parameters.
    CrsGeoCoding(org.opengis.referencing.crs.CoordinateReferenceSystem mapCRS, int imageWidth, int imageHeight, double easting, double northing, double pixelSizeX, double pixelSizeY, double referencePixelX, double referencePixelY)
    Constructs a new instance of this class from a map CRS, image dimension, and image-to-map transformation parameters.
    CrsGeoCoding(org.opengis.referencing.crs.CoordinateReferenceSystem mapCRS, Rectangle imageBounds, AffineTransform imageToMap)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks whether or not this geo-coding can determine the geodetic position from a pixel position.
    boolean
    Checks whether or not this geo-coding can determine the pixel position from a geodetic position.
    void
    Releases all of the resources used by this object instance and all of its owned children.
    Gets the datum, the reference point or surface against which GeoPos measurements are made.
    getGeoPos(PixelPos pixelPos, GeoPos geoPos)
    Returns the latitude and longitude value for a given pixel co-ordinate.
    org.opengis.referencing.operation.MathTransform
     
    getPixelPos(GeoPos geoPos, PixelPos pixelPos)
    Returns the pixel co-ordinates as x/y for a given geographical position given as lat/lon.
    final void
    getPixels(int x1, int y1, int w, int h, double[] latPixels, double[] lonPixels)
     
    final void
    getPixels(int x1, int y1, int w, int h, float[] latPixels, float[] lonPixels)
     
    boolean
    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.snap.core.datamodel.AbstractGeoCoding

    canClone, clone, createImageCRS, getGeoCRS, getImageCRS, getMapCRS, setGeoCRS, setImageCRS, setMapCRS

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CrsGeoCoding

      public CrsGeoCoding(org.opengis.referencing.crs.CoordinateReferenceSystem mapCRS, int imageWidth, int imageHeight, double easting, double northing, double pixelSizeX, double pixelSizeY) throws org.opengis.referencing.FactoryException, org.opengis.referencing.operation.TransformException
      Constructs a new instance of this class from a map CRS, image dimension, and image-to-map transformation parameters. The reference pixel is set to the BEAM default value, namely the center of the upper left image pixel (i.e. referencePixelX = referencePixelY = 0.5).
      Parameters:
      mapCRS - the map CRS.
      imageWidth - the width of the image.
      imageHeight - the height of the image.
      easting - the easting of the reference pixel position.
      northing - the northing of the reference pixel position.
      pixelSizeX - the size of a pixel along the x-axis in map units.
      pixelSizeY - the size of a pixel along the y-axis in map units (negative, if positive image Y-axis points up).
      Throws:
      org.opengis.referencing.FactoryException - when an error occurred.
      org.opengis.referencing.operation.TransformException - when an error occurred.
    • CrsGeoCoding

      public CrsGeoCoding(org.opengis.referencing.crs.CoordinateReferenceSystem mapCRS, int imageWidth, int imageHeight, double easting, double northing, double pixelSizeX, double pixelSizeY, double referencePixelX, double referencePixelY) throws org.opengis.referencing.FactoryException, org.opengis.referencing.operation.TransformException
      Constructs a new instance of this class from a map CRS, image dimension, and image-to-map transformation parameters.
      Parameters:
      mapCRS - the map CRS.
      imageWidth - the width of the image.
      imageHeight - the height of the image.
      easting - the easting of the reference pixel position.
      northing - the northing of the reference pixel position.
      pixelSizeX - the size of a pixel along the x-axis in map units.
      pixelSizeY - the size of a pixel along the y-axis in map units (negative, if positive image Y-axis points up).
      referencePixelX - the x-position of the reference pixel.
      referencePixelY - the y-position of the reference pixel.
      Throws:
      org.opengis.referencing.FactoryException - when an error occurred.
      org.opengis.referencing.operation.TransformException - when an error occurred.
    • CrsGeoCoding

      public CrsGeoCoding(org.opengis.referencing.crs.CoordinateReferenceSystem mapCRS, Rectangle imageBounds, AffineTransform imageToMap) throws org.opengis.referencing.FactoryException, org.opengis.referencing.operation.TransformException
      Throws:
      org.opengis.referencing.FactoryException
      org.opengis.referencing.operation.TransformException
  • Method Details

    • getImageToMapTransform

      public org.opengis.referencing.operation.MathTransform getImageToMapTransform()
      Specified by:
      getImageToMapTransform in interface GeoCoding
      Overrides:
      getImageToMapTransform in class AbstractGeoCoding
      Returns:
      The math transformation used to convert image coordinates to map coordinates.
    • transferGeoCoding

      public boolean transferGeoCoding(Scene srcScene, Scene destScene, ProductSubsetDef subsetDef)
      Description copied from class: AbstractGeoCoding
      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.
    • canGetGeoPos

      public boolean canGetGeoPos()
      Description copied from interface: GeoCoding
      Checks whether or not this geo-coding can determine the geodetic position from a pixel position.
      Returns:
      true, if so
    • canGetPixelPos

      public boolean canGetPixelPos()
      Description copied from interface: GeoCoding
      Checks whether or not this geo-coding can determine the pixel position from a geodetic position.
      Returns:
      true, if so
    • 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.

    • getDatum

      public Datum getDatum()
      Description copied from interface: GeoCoding
      Gets the datum, the reference point or surface against which GeoPos measurements are made.
      Returns:
      the datum
    • getGeoPos

      public GeoPos getGeoPos(PixelPos pixelPos, GeoPos geoPos)
      Description copied from interface: GeoCoding
      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 return 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 coordinate system determined by GeoCoding.getGeoCRS()
    • getPixelPos

      public PixelPos getPixelPos(GeoPos geoPos, PixelPos pixelPos)
      Description copied from interface: GeoCoding
      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 coordinate system determined by GeoCoding.getGeoCRS()
      pixelPos - an instance of Point to be used as return value. If this parameter is null, the method creates a new instance which it then returns.
      Returns:
      the pixel co-ordinates as x/y
    • getPixels

      public final void getPixels(int x1, int y1, int w, int h, float[] latPixels, float[] lonPixels)
    • getPixels

      public final void getPixels(int x1, int y1, int w, int h, double[] latPixels, double[] lonPixels)
    • isCrossingMeridianAt180

      public boolean isCrossingMeridianAt180()
      Description copied from interface: GeoCoding
      Checks whether or not the longitudes of this geo-coding cross the +/- 180 degree meridian.
      Returns:
      true, if so
    • toString

      public String toString()
      Overrides:
      toString in class Object