Package noaa.coastwatch.util.trans
Class DataProjection
java.lang.Object
noaa.coastwatch.util.MetadataContainer
noaa.coastwatch.util.trans.EarthTransform
noaa.coastwatch.util.trans.EarthTransform2D
noaa.coastwatch.util.trans.DataProjection
- All Implemented Interfaces:
Cloneable
The
DataProjection
class implements earth transform
calculations for data coordinates with explicit latitude and
longitude data. The only possible operation is translation from
data coordinates to geographic coordinates -- the reverse is not
implemented.- Since:
- 3.1.0
- Author:
- Peter Hollemans
-
Field Summary
Fields inherited from class noaa.coastwatch.util.trans.EarthTransform
boundaryHandler, dims
-
Constructor Summary
ConstructorDescriptionDataProjection
(DataVariable lat, DataVariable lon) Constructs a data projection from the specified latitude and longitude data. -
Method Summary
Modifier and TypeMethodDescriptionclosest
(EarthLocation targetEarthLoc, DataLocation targetDataLoc) Gets the closest integer data location to a specified geographic location.closestBySearch
(EarthLocation targetEarthLoc, DataLocation targetDataLoc) Searches for the closest integer data location to a specified geographic location by computing the distance to each earth location in the data and finding the minimum.describe()
Gets a string describing the earth transform type.boolean
Compares the specified object with this data projection for equality.getLat()
Gets the latitude variable used in this projection.getLon()
Gets the longitude variable used in this projection.boolean
Determines if this transform is invertible.static double
Gets the median value in a list of double values.void
Tests theclosest(noaa.coastwatch.util.EarthLocation, noaa.coastwatch.util.DataLocation)
method on this transform.protected void
transformImpl
(DataLocation dataLoc, EarthLocation earthLoc) Implements the data to geographic transform.protected void
transformImpl
(EarthLocation earthLoc, DataLocation dataLoc) Implements the geographic to data transform.Methods inherited from class noaa.coastwatch.util.trans.EarthTransform2D
get2DVersion, getBoundingBox, getWorldAxes, isOrientable, main, setPointTransform, transformToPoint
Methods inherited from class noaa.coastwatch.util.trans.EarthTransform
clone, distance, getBoundaryHandler, getDatum, getDimensions, getResolution, getSpheroid, getSpheroid, getSubset, transform, transform, transform, transform
Methods inherited from class noaa.coastwatch.util.MetadataContainer
getMetadataMap
-
Field Details
-
DESCRIPTION
Projection description string.- See Also:
-
-
Constructor Details
-
DataProjection
Constructs a data projection from the specified latitude and longitude data.- Parameters:
lat
- a data variable containing latitude data.lon
- a data variable containing longitude data.
-
-
Method Details
-
getLat
Gets the latitude variable used in this projection. -
getLon
Gets the longitude variable used in this projection. -
describe
Description copied from class:EarthTransform
Gets a string describing the earth transform type.- Specified by:
describe
in classEarthTransform
-
transformImpl
Description copied from class:EarthTransform
Implements the data to geographic transform.- Specified by:
transformImpl
in classEarthTransform
- See Also:
-
transformImpl
Description copied from class:EarthTransform
Implements the geographic to data transform.- Specified by:
transformImpl
in classEarthTransform
- See Also:
-
median
Gets the median value in a list of double values. A side effect is that the parameter list is sorted.- Parameters:
values
- the list of values to return the median.- Returns:
- the median value or Double.NaN if the list length is zero.
- Since:
- 3.8.1
-
closest
Description copied from class:EarthTransform
Gets the closest integer data location to a specified geographic location.- Overrides:
closest
in classEarthTransform
- Parameters:
targetEarthLoc
- the target earth location to locate the closest valid data location.targetDataLoc
- the data location or null. If null, an object is created and returned. If non-null, the object is simply modified.- Returns:
- the data location. The data location may be marked invalid if no closest data location can be found within the data location bounds of this transform.
-
closestBySearch
Searches for the closest integer data location to a specified geographic location by computing the distance to each earth location in the data and finding the minimum. This routine is meant to be used for testing and comparison purposes only.- Parameters:
targetEarthLoc
- the target earth location to locate the closest valid data location.targetDataLoc
- the data location or null. If null, an object is created and returned. If non-null, the object is simply modified.- Returns:
- the data location.
- Since:
- 3.8.1
- See Also:
-
testClosest
public void testClosest()Tests theclosest(noaa.coastwatch.util.EarthLocation, noaa.coastwatch.util.DataLocation)
method on this transform. -
isInvertible
public boolean isInvertible()Description copied from class:EarthTransform
Determines if this transform is invertible. All transforms should translate from data location to geographic location. But to be invertible, the transform must also translate from geographic location back to data location. This method returns true unless overridden by the child class.- Overrides:
isInvertible
in classEarthTransform
- Returns:
- true if this transform is invertible or false if not.
-
equals
Compares the specified object with this data projection for equality. The latitudes and longitudes of the two data projections are compared value by value.
-