Package uk.ac.rdg.resc.edal.grid.cdm
Class CdmTransformedGrid
- java.lang.Object
-
- uk.ac.rdg.resc.edal.grid.AbstractTransformedGrid
-
- uk.ac.rdg.resc.edal.grid.cdm.CdmTransformedGrid
-
- All Implemented Interfaces:
Serializable
,DiscreteDomain<HorizontalPosition,GridCell2D>
,DiscreteHorizontalDomain<GridCell2D>
,Domain<HorizontalPosition>
,HorizontalDomain
,HorizontalGrid
public class CdmTransformedGrid extends AbstractTransformedGrid
A two-dimensionalHorizontalGrid
that uses aProjection
to convert from lat-lon coordinates to grid coordinates.- Author:
- Jon Blower, Guy Griffiths
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CdmTransformedGrid(ucar.nc2.dt.GridCoordSystem coordSys)
CdmTransformedGrid(ucar.unidata.geoloc.ProjectionImpl proj, ReferenceableAxis<Double> xAxis, ReferenceableAxis<Double> yAxis)
Create a newCdmTransformedGrid
from a definedProjectionImpl
and a pair of axes
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(HorizontalPosition position)
boolean
equals(Object obj)
GridCoordinates2D
findIndexOf(HorizontalPosition position)
Finds the index of the specified position within this domainBoundingBox
getBoundingBox()
Returns the bounding box of the domain in the domain's own coordinate reference system.Array2D<GridCell2D>
getDomainObjects()
Returns anArray
of domain objects that comprise this domain.org.opengis.metadata.extent.GeographicBoundingBox
getGeographicBoundingBox()
Returns the bounding box of the domain in WGS84 latitude-longitude coordinates.int
getXSize()
int
getYSize()
int
hashCode()
long
size()
Returns the size of this domain.double
transformNativeHeadingToWgs84(double xComp, double yComp, double lon, double lat)
Transforms a heading in native grid co-ordinates (degrees clockwise from positive y-direction) into a heading in WGS84 (degrees clockwise from north).-
Methods inherited from class uk.ac.rdg.resc.edal.grid.AbstractTransformedGrid
getCoordinateReferenceSystem
-
-
-
-
Constructor Detail
-
CdmTransformedGrid
public CdmTransformedGrid(ucar.unidata.geoloc.ProjectionImpl proj, ReferenceableAxis<Double> xAxis, ReferenceableAxis<Double> yAxis)
Create a newCdmTransformedGrid
from a definedProjectionImpl
and a pair of axes- Parameters:
proj
- TheProjectionImpl
which defines the transforms to and from lat-lonxAxis
- The xReferenceableAxis
of the non-lat-lon gridyAxis
- The yReferenceableAxis
of the non-lat-lon grid
-
CdmTransformedGrid
public CdmTransformedGrid(ucar.nc2.dt.GridCoordSystem coordSys)
- Parameters:
coordSys
- ThisGridCoordSystem
must have one-dimensional x and y coordinate axes
-
-
Method Detail
-
contains
public boolean contains(HorizontalPosition position)
- Returns:
- true if the given position is contained within this domain.
-
getBoundingBox
public BoundingBox getBoundingBox()
Description copied from interface:HorizontalDomain
Returns the bounding box of the domain in the domain's own coordinate reference system. For domains which do not have a native co-ordinate reference system this may return aBoundingBox
in a different CRS. Consequently thisBoundingBox
is not guaranteed to be a tight bound around the domain.
-
getGeographicBoundingBox
public org.opengis.metadata.extent.GeographicBoundingBox getGeographicBoundingBox()
Description copied from interface:HorizontalDomain
Returns the bounding box of the domain in WGS84 latitude-longitude coordinates.
-
size
public long size()
Description copied from interface:HorizontalGrid
Returns the size of this domain. Equivalent togetXSize() * getYSize()
-
getDomainObjects
public Array2D<GridCell2D> getDomainObjects()
Description copied from interface:DiscreteDomain
Returns anArray
of domain objects that comprise this domain.
-
findIndexOf
public GridCoordinates2D findIndexOf(HorizontalPosition position)
Description copied from interface:HorizontalGrid
Finds the index of the specified position within this domain- Parameters:
position
- The position to find the index of- Returns:
- A
GridCoordinates2D
object representing the index of the position within the domain, ornull
if the position is outside the domain.
-
transformNativeHeadingToWgs84
public double transformNativeHeadingToWgs84(double xComp, double yComp, double lon, double lat)
Description copied from class:AbstractTransformedGrid
Transforms a heading in native grid co-ordinates (degrees clockwise from positive y-direction) into a heading in WGS84 (degrees clockwise from north).- Specified by:
transformNativeHeadingToWgs84
in classAbstractTransformedGrid
- Parameters:
xComp
- The x-component of the headingyComp
- The y-component of the headinglon
- The longitude of the given componentslat
- The latitude of the given components- Returns:
- The transformed heading
-
getXSize
public int getXSize()
- Returns:
- The size of the x-axis
-
getYSize
public int getYSize()
- Returns:
- The size of the y-axis
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceHorizontalGrid
- Overrides:
hashCode
in classObject
-
equals
public boolean equals(Object obj)
- Specified by:
equals
in interfaceHorizontalGrid
- Overrides:
equals
in classObject
-
-