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-dimensionalHorizontalGridthat uses aProjectionto 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 newCdmTransformedGridfrom a definedProjectionImpland a pair of axes
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(HorizontalPosition position)booleanequals(Object obj)GridCoordinates2DfindIndexOf(HorizontalPosition position)Finds the index of the specified position within this domainBoundingBoxgetBoundingBox()Returns the bounding box of the domain in the domain's own coordinate reference system.Array2D<GridCell2D>getDomainObjects()Returns anArrayof domain objects that comprise this domain.org.opengis.metadata.extent.GeographicBoundingBoxgetGeographicBoundingBox()Returns the bounding box of the domain in WGS84 latitude-longitude coordinates.intgetXSize()intgetYSize()inthashCode()longsize()Returns the size of this domain.doubletransformNativeHeadingToWgs84(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 newCdmTransformedGridfrom a definedProjectionImpland a pair of axes- Parameters:
proj- TheProjectionImplwhich defines the transforms to and from lat-lonxAxis- The xReferenceableAxisof the non-lat-lon gridyAxis- The yReferenceableAxisof the non-lat-lon grid
-
CdmTransformedGrid
public CdmTransformedGrid(ucar.nc2.dt.GridCoordSystem coordSys)
- Parameters:
coordSys- ThisGridCoordSystemmust 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:HorizontalDomainReturns 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 aBoundingBoxin a different CRS. Consequently thisBoundingBoxis not guaranteed to be a tight bound around the domain.
-
getGeographicBoundingBox
public org.opengis.metadata.extent.GeographicBoundingBox getGeographicBoundingBox()
Description copied from interface:HorizontalDomainReturns the bounding box of the domain in WGS84 latitude-longitude coordinates.
-
size
public long size()
Description copied from interface:HorizontalGridReturns the size of this domain. Equivalent togetXSize() * getYSize()
-
getDomainObjects
public Array2D<GridCell2D> getDomainObjects()
Description copied from interface:DiscreteDomainReturns anArrayof domain objects that comprise this domain.
-
findIndexOf
public GridCoordinates2D findIndexOf(HorizontalPosition position)
Description copied from interface:HorizontalGridFinds the index of the specified position within this domain- Parameters:
position- The position to find the index of- Returns:
- A
GridCoordinates2Dobject representing the index of the position within the domain, ornullif the position is outside the domain.
-
transformNativeHeadingToWgs84
public double transformNativeHeadingToWgs84(double xComp, double yComp, double lon, double lat)Description copied from class:AbstractTransformedGridTransforms a heading in native grid co-ordinates (degrees clockwise from positive y-direction) into a heading in WGS84 (degrees clockwise from north).- Specified by:
transformNativeHeadingToWgs84in 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:
hashCodein interfaceHorizontalGrid- Overrides:
hashCodein classObject
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfaceHorizontalGrid- Overrides:
equalsin classObject
-
-