Package noaa.coastwatch.render
Class EarthImageTransform
java.lang.Object
noaa.coastwatch.render.EarthImageTransform
The earth image transform class translates between 2D geographic
coordinates in latitude, longitude and image coordinates in x, y.
- Since:
- 3.1.1
- Author:
- Peter Hollemans
-
Constructor Summary
ConstructorDescriptionEarthImageTransform
(Dimension imageDims, EarthLocation center, double[] scales, EarthTransform earthTrans) Deprecated.EarthImageTransform
(Dimension imageDims, EarthLocation center, double scale, EarthTransform earthTrans) Constructs a new earth image transform from the specified image dimensions and geographic center.EarthImageTransform
(EarthTransform earthTrans, ImageTransform imageTrans) Constructs an earth image transform with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionGets the earth transform.Gets the image transform.double
getResolution
(Point2D point) Calculates an approximate resolution in km/pixel.boolean
isDiscontinuous
(EarthLocation e1, EarthLocation e2, Point2D p1, Point2D p2) Determines if a segment running from one earth location to another is discontinuous in the image space.Converts arbitrary precision image coordinates to geographic coordinates.Converts integer image coordinates to geographic coordinates.transform
(EarthLocation geo) Converts geographic coordinates to image coordinates.
-
Constructor Details
-
EarthImageTransform
Constructs an earth image transform with the specified parameters.- Parameters:
earthTrans
- the earth transform.imageTrans
- the image transform.
-
EarthImageTransform
@Deprecated public EarthImageTransform(Dimension imageDims, EarthLocation center, double[] scales, EarthTransform earthTrans) throws NoninvertibleTransformException Deprecated.As of 3.3.1, replaced byEarthImageTransform(Dimension,EarthLocation,double,EarthTransform)
.Constructs a new earth image transform from the specified image dimensions and geographic center.- Parameters:
imageDims
- the image dimensions.center
- the center earth location.scales
- the image to data scaling factors as [row, column].earthTrans
- the earth transform.- Throws:
NoninvertibleTransformException
- if the image to data transform is not invertible.
-
EarthImageTransform
public EarthImageTransform(Dimension imageDims, EarthLocation center, double scale, EarthTransform earthTrans) throws NoninvertibleTransformException Constructs a new earth image transform from the specified image dimensions and geographic center.- Parameters:
imageDims
- the image dimensions.center
- the center earth location.scale
- the image to data scaling factor.earthTrans
- the earth transform.- Throws:
NoninvertibleTransformException
- if the image to data transform is not invertible.
-
-
Method Details
-
getEarthTransform
Gets the earth transform. -
getImageTransform
Gets the image transform. -
transform
Converts geographic coordinates to image coordinates.- Parameters:
geo
- the geographic location.- Returns:
- the image coordinates, or null if the geographic point could not be transformed.
- See Also:
-
transform
Converts arbitrary precision image coordinates to geographic coordinates.- Parameters:
point
- the image coordinates.- Returns:
- the geographic location.
- See Also:
-
transform
Converts integer image coordinates to geographic coordinates.- Parameters:
point
- the image coordinates.- Returns:
- the geographic location.
- See Also:
-
getResolution
Calculates an approximate resolution in km/pixel.- Parameters:
point
- the image point.- Returns:
- the resolution in km/pixel at the image point.
-
isDiscontinuous
Determines if a segment running from one earth location to another is discontinuous in the image space. The calculation uses a heuristic, so in some extreme cases it may not return the correct answer.- Parameters:
e1
- the first earth location.e2
- the second earth location.p1
- the first image point (or null to calculate).p2
- the second image point (or null to calculate).- Returns:
- true if the segment is discontinuous, or false if not or if the earth locations could not be resolved to image points.
-
EarthImageTransform(Dimension,EarthLocation,double,EarthTransform)
.