Class Localization

java.lang.Object
org.apache.sis.storage.geotiff.Localization

final class Localization extends Object
The conversion or transformation from pixel coordinates to model coordinates. The target CRS may be the image CRS if the image is "georeferenceable" instead of georeferenced. This code is provided in a separated class for making easier to move it to some shared location if another data store needs similar functionality in the future.
Since:
0.8
Version:
1.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final double
    The desired precision of coordinate transformations in units of pixels.
    (package private) static final int
    Number of floating point values in each (I,J,K,X,Y,Z) record.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Do not allow instantiation of this class.
  • Method Summary

    Modifier and Type
    Method
    Description
    private static org.opengis.referencing.operation.MathTransform
    localizationGrid(Vector modelTiePoints, Map<org.opengis.geometry.Envelope,org.opengis.referencing.operation.MathTransform> addTo)
    Builds a localization grid from the given GeoTIFF tie points.
    (package private) static org.opengis.referencing.operation.MathTransform
    nonLinear(Vector modelTiePoints)
    Creates a new localization grid from the information found by ImageFileDirectory.
    private static double
    threshold(Vector values, Set<Double> uniques)
    Finds the value at which the increment in localization grid seems to change.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • RECORD_LENGTH

      static final int RECORD_LENGTH
      Number of floating point values in each (I,J,K,X,Y,Z) record.
      See Also:
    • PRECISION

      private static final double PRECISION
      The desired precision of coordinate transformations in units of pixels. This is an arbitrary value that may be adjusted in any future SIS version.
      See Also:
  • Constructor Details

    • Localization

      private Localization()
      Do not allow instantiation of this class.
  • Method Details

    • nonLinear

      static org.opengis.referencing.operation.MathTransform nonLinear(Vector modelTiePoints) throws org.opengis.util.FactoryException, org.opengis.referencing.operation.TransformException
      Creates a new localization grid from the information found by ImageFileDirectory. Current implementation creates two-dimensional transforms only.
      Parameters:
      modelTiePoints - the tie points to use for computing gridToCRS.
      Returns:
      the grid geometry created from above properties. Never null.
      Throws:
      org.opengis.util.FactoryException
      org.opengis.referencing.operation.TransformException
    • localizationGrid

      private static org.opengis.referencing.operation.MathTransform localizationGrid(Vector modelTiePoints, Map<org.opengis.geometry.Envelope,org.opengis.referencing.operation.MathTransform> addTo) throws org.opengis.util.FactoryException, org.opengis.referencing.operation.TransformException
      Builds a localization grid from the given GeoTIFF tie points. This method may invoke itself recursively.
      Parameters:
      modelTiePoints - the model tie points read from GeoTIFF file.
      addTo - if non-null, add the transform result to this map.
      Throws:
      org.opengis.util.FactoryException
      org.opengis.referencing.operation.TransformException
    • threshold

      private static double threshold(Vector values, Set<Double> uniques)
      Finds the value at which the increment in localization grid seems to change. This is used when not all tie points in a GeoTIFF images are distributed on a regular grid (e.g. Sentinel 1 image). This method tells where to split in two grids.
      Parameters:
      values - the x or y vector of tie points pixel coordinates.
      uniques - an initially empty set to be used for this method internal working.
      Returns:
      value after which a different step is used, or NaN if none. The value returned by this method should be included in the first grid.