Package org.apache.sis.storage.geotiff
Class Localization
java.lang.Object
org.apache.sis.storage.geotiff.Localization
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
FieldsModifier and TypeFieldDescriptionprivate 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 -
Method Summary
Modifier and TypeMethodDescriptionprivate 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
Creates a new localization grid from the information found byImageFileDirectory
.private static double
Finds the value at which the increment in localization grid seems to change.
-
Field Details
-
RECORD_LENGTH
static final int RECORD_LENGTHNumber of floating point values in each (I,J,K,X,Y,Z) record.- See Also:
-
PRECISION
private static final double PRECISIONThe 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 byImageFileDirectory
. Current implementation creates two-dimensional transforms only.- Parameters:
modelTiePoints
- the tie points to use for computinggridToCRS
.- 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.TransformExceptionBuilds 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
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.
-