Package org.apache.sis.coverage.grid
Class FractionalGridCoordinates.Position
java.lang.Object
org.apache.sis.coverage.grid.FractionalGridCoordinates
org.apache.sis.coverage.grid.FractionalGridCoordinates.Position
- All Implemented Interfaces:
Serializable,org.opengis.geometry.coordinate.Position,org.opengis.geometry.DirectPosition
- Enclosing class:
- FractionalGridCoordinates
static final class FractionalGridCoordinates.Position
extends FractionalGridCoordinates
implements org.opengis.geometry.DirectPosition
A grid coordinates viewed as a
DirectPosition. This class is used only for coordinate transformation.
We do not want to make this class public in order to avoid the abuse of DirectPosition as a storage
of grid coordinates.
Note this this class does not comply with the contract documented in DirectPosition.equals(Object)
and DirectPosition.hashCode() javadoc. This is another reason for not making this class public.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.coverage.grid.FractionalGridCoordinates
FractionalGridCoordinates.Position -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longFor cross-version compatibility.Fields inherited from class org.apache.sis.coverage.grid.FractionalGridCoordinates
coordinates -
Constructor Summary
ConstructorsConstructorDescriptionPosition(int dimension) Creates a new position of the given number of dimensions.Creates a new position initialized to a copy of the given coordinates. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]Returns all coordinate values.org.opengis.referencing.crs.CoordinateReferenceSystemGrid coordinates have no coordinate reference system.org.opengis.geometry.DirectPositionReturns the direct position, which is this object itself.doublegetOrdinate(int dimension) Returns the coordinate value at the given dimension.voidsetOrdinate(int dimension, double value) Sets the coordinate value at the given dimension.org.opengis.geometry.DirectPositiontoPosition(org.opengis.referencing.operation.MathTransform gridToCRS) Returns the grid coordinates converted to a geospatial position using the given transform.Methods inherited from class org.apache.sis.coverage.grid.FractionalGridCoordinates
equals, getCoordinateFractional, getCoordinateValue, getCoordinateValues, getDimension, hashCode, pointOutsideCoverage, setCoordinateValue, toExtent, toExtent, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opengis.geometry.DirectPosition
equals, getDimension, hashCode
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
-
Constructor Details
-
Position
Position(int dimension) Creates a new position of the given number of dimensions. -
Position
Position(FractionalGridCoordinates other) Creates a new position initialized to a copy of the given coordinates.
-
-
Method Details
-
getDirectPosition
public org.opengis.geometry.DirectPosition getDirectPosition()Returns the direct position, which is this object itself.- Specified by:
getDirectPositionin interfaceorg.opengis.geometry.coordinate.Position
-
getCoordinateReferenceSystem
public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()Grid coordinates have no coordinate reference system.- Specified by:
getCoordinateReferenceSystemin interfaceorg.opengis.geometry.DirectPosition
-
getCoordinate
public double[] getCoordinate()Returns all coordinate values.- Specified by:
getCoordinatein interfaceorg.opengis.geometry.DirectPosition
-
getOrdinate
public double getOrdinate(int dimension) Returns the coordinate value at the given dimension.- Specified by:
getOrdinatein interfaceorg.opengis.geometry.DirectPosition
-
setOrdinate
public void setOrdinate(int dimension, double value) Sets the coordinate value at the given dimension.- Specified by:
setOrdinatein interfaceorg.opengis.geometry.DirectPosition
-
toPosition
public org.opengis.geometry.DirectPosition toPosition(org.opengis.referencing.operation.MathTransform gridToCRS) throws org.opengis.referencing.operation.TransformException Returns the grid coordinates converted to a geospatial position using the given transform.- Overrides:
toPositionin classFractionalGridCoordinates- Parameters:
gridToCRS- the transform to apply on grid coordinates.- Returns:
- the grid coordinates converted using the given transform.
- Throws:
org.opengis.referencing.operation.TransformException- if the grid coordinates cannot be converted bygridToCRS.- See Also:
-