Package uk.ac.rdg.resc.edal.grid
Class LookUpTableGrid
- java.lang.Object
-
- uk.ac.rdg.resc.edal.grid.AbstractTransformedGrid
-
- uk.ac.rdg.resc.edal.grid.AbstractCurvilinearGrid
-
- uk.ac.rdg.resc.edal.grid.LookUpTableGrid
-
- All Implemented Interfaces:
Serializable
,DiscreteDomain<HorizontalPosition,GridCell2D>
,DiscreteHorizontalDomain<GridCell2D>
,Domain<HorizontalPosition>
,HorizontalDomain
,HorizontalGrid
public final class LookUpTableGrid extends AbstractCurvilinearGrid
A HorizontalGrid that is created from a "curvilinear" coordinate system, i.e. one in which the latitude/longitude coordinates of each grid point are specified using two-dimensional coordinate axes, which explicitly give the lat/lon of each point in the horizontal plane. In these coordinate systems, finding the nearest grid point to a given lat/lon point is complex. Therefore we pre-calculate a"look-up table"
of the nearest i-j indices to a set of lat-lon points. Coordinate conversions using such a look-up table are not precise but may suffice for many applications.- Author:
- Guy Griffiths, Jon Blower
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class uk.ac.rdg.resc.edal.grid.AbstractCurvilinearGrid
curvCoords
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
clearCache()
boolean
equals(Object obj)
GridCoordinates2D
findIndexOf(HorizontalPosition position)
Finds the index of the specified position within this domainstatic LookUpTableGrid
generate(Array2D<Number> lonVals, Array2D<Number> latVals)
The passed-in coordSys must have 2D horizontal coordinate axes.int
hashCode()
-
Methods inherited from class uk.ac.rdg.resc.edal.grid.AbstractCurvilinearGrid
contains, getBoundingBox, getDomainObjects, getGeographicBoundingBox, getXSize, getYSize, size, transformNativeHeadingToWgs84
-
Methods inherited from class uk.ac.rdg.resc.edal.grid.AbstractTransformedGrid
getCoordinateReferenceSystem
-
-
-
-
Method Detail
-
generate
public static LookUpTableGrid generate(Array2D<Number> lonVals, Array2D<Number> latVals)
The passed-in coordSys must have 2D horizontal coordinate axes.
-
clearCache
public static void clearCache()
-
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.
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceHorizontalGrid
- Overrides:
hashCode
in classAbstractCurvilinearGrid
-
equals
public boolean equals(Object obj)
- Specified by:
equals
in interfaceHorizontalGrid
- Overrides:
equals
in classAbstractCurvilinearGrid
-
-