Package org.apache.sis.portrayal
Class CanvasExtent
java.lang.Object
org.apache.sis.coverage.grid.GridExtent
org.apache.sis.portrayal.CanvasExtent
- All Implemented Interfaces:
Serializable
,LenientComparable
A
GridExtent
which remembers the Canvas.getPointOfInterest(boolean)
coordinates.
This class also contains static help functions for the construction of GridGeometry
.- Since:
- 1.1
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final double[]
The grid coordinates of a representative point.private static final long
For cross-version compatibility. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
CanvasExtent
(org.opengis.metadata.spatial.DimensionNameType[] axisTypes, long[] lower, long[] upper, double[] pointOfInterest) Creates a new grid extent. -
Method Summary
Modifier and TypeMethodDescription(package private) static GridExtent
create
(GeneralEnvelope bounds, org.opengis.geometry.DirectPosition poi, org.opengis.metadata.spatial.DimensionNameType[] axisTypes, int agmDim) Creates a new grid extent from the given display bounds.(package private) static LinearTransform
createGridToCRS
(org.opengis.referencing.operation.Matrix displayToObjective, org.opengis.geometry.DirectPosition pointOfInterest, long supplementalDimensions) Creates the "grid to CRS" transform of a grid geometry as the inverse of the "objective to display" transform augmented with supplemental dimensions.(package private) static long
findSupplementalDimensions
(org.opengis.referencing.crs.CoordinateReferenceSystem crs, org.opengis.referencing.operation.Matrix derivative, List<org.opengis.referencing.crs.CoordinateReferenceSystem> addTo) Finds the dimensions in the given CRS that are not included in the objective CRS.double[]
getPointOfInterest
(org.opengis.referencing.datum.PixelInCell anchor) Returns the grid coordinates of a representative point.(package private) static org.opengis.metadata.spatial.DimensionNameType[]
suggestAxisTypes
(org.opengis.referencing.crs.CoordinateReferenceSystem crs, int displayDimension) Suggests axis types for supplemental dimensions not managed by theCanvas
.Methods inherited from class org.apache.sis.coverage.grid.GridExtent
contains, equals, equals, expand, getAxisType, getDimension, getHigh, getLow, getMedian, getPointOfInterest, getSize, getSize, getSliceCoordinates, getSubspaceDimensions, hashCode, insertDimension, intersect, reduceDimension, resize, selectDimensions, startsAtZero, subsample, toEnvelope, toString, translate, union, upsample, withRange
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
pointOfInterest
private final double[] pointOfInterestThe grid coordinates of a representative point. TheCanvasExtent
point of interest is theCanvas
point of interest converted to (typically) pixel coordinates.- See Also:
-
-
Constructor Details
-
CanvasExtent
private CanvasExtent(org.opengis.metadata.spatial.DimensionNameType[] axisTypes, long[] lower, long[] upper, double[] pointOfInterest) Creates a new grid extent.- Parameters:
axisTypes
- the type of each grid axis, ornull
if unspecified.lower
- the valid minimum grid coordinates (inclusive).upper
- the valid maximum grid coordinates (exclusive).pointOfInterest
- the grid coordinates of a representative point.
-
-
Method Details
-
getPointOfInterest
public double[] getPointOfInterest(org.opengis.referencing.datum.PixelInCell anchor) Returns the grid coordinates of a representative point. This is the canvas point of interest converted to (typically) pixel coordinates.- Overrides:
getPointOfInterest
in classGridExtent
- Parameters:
anchor
- the convention to be used for conversion to "real world" coordinates.- Returns:
- the grid coordinates of a representative point.
- See Also:
-
create
static GridExtent create(GeneralEnvelope bounds, org.opengis.geometry.DirectPosition poi, org.opengis.metadata.spatial.DimensionNameType[] axisTypes, int agmDim) Creates a new grid extent from the given display bounds. All supplemental dimensions will have the [0 … 0] grid range. If a point of interest is available, its coordinates will be remembered.- Parameters:
bounds
- bounds of the display device, typically in pixel units.poi
- point of interest in pixel units, ornull
if unknown.axisTypes
- name of display axes, ornull
if unknown.agmDim
- augmented number of dimensions (i.e. including supplemental dimensions).- Returns:
- grid extent computed from the given display bounds.
-
findSupplementalDimensions
static long findSupplementalDimensions(org.opengis.referencing.crs.CoordinateReferenceSystem crs, org.opengis.referencing.operation.Matrix derivative, List<org.opengis.referencing.crs.CoordinateReferenceSystem> addTo) Finds the dimensions in the given CRS that are not included in the objective CRS. Those dimensions are discovered by inspection of the derivative of the transform from the given CRS to the objective CRS. In addition, this method also adds the CRS component of those supplemental dimensions in the given list. If a component cannot be separated from the CRS, then current implementation excludes it from the set of supplemental dimensions.- Parameters:
crs
- the coordinate reference system of the Point Of Interest (POI).derivative
- derivative of the transform from Point Of Interest (POI) to objective CRS.addTo
- the list where to add the CRS component for supplemental dimensions.- Returns:
- a bitmask of supplemental dimensions.
- See Also:
-
createGridToCRS
static LinearTransform createGridToCRS(org.opengis.referencing.operation.Matrix displayToObjective, org.opengis.geometry.DirectPosition pointOfInterest, long supplementalDimensions) Creates the "grid to CRS" transform of a grid geometry as the inverse of the "objective to display" transform augmented with supplemental dimensions.- Parameters:
displayToObjective
- inverse ofCanvas.getObjectiveToDisplay()
.pointOfInterest
- value ofCanvas.getPointOfInterest(boolean)
.supplementalDimensions
- value offindSupplementalDimensions(CoordinateReferenceSystem, Matrix, List)
.- Returns:
- the "grid to CRS" transform of a grid geometry for a
Canvas
.
-
suggestAxisTypes
static org.opengis.metadata.spatial.DimensionNameType[] suggestAxisTypes(org.opengis.referencing.crs.CoordinateReferenceSystem crs, int displayDimension) Suggests axis types for supplemental dimensions not managed by theCanvas
. Those types are only a help for debugging purpose, by providing more information to the developers. They should not be used for any "real" work.- Parameters:
crs
- the coordinate reference system to use for inferring axis types.displayDimension
- number of dimensions managed by theCanvas
.- Returns:
- suggested axis types. Never null, but contains null elements.
- See Also:
-