Package noaa.coastwatch.render
Class PathTransformer
java.lang.Object
noaa.coastwatch.render.PathTransformer
The
PathTransformer
class converts line segments of
earth location data to projected image data, taking account
of discontinuities and boundary cuts in the line segments.- Since:
- 3.5.1
- Author:
- Peter Hollemans
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
setDiagnosticMode
(boolean flag) Sets the diagnostic mode.transformPath
(List<EarthLocation> locList, EarthImageTransform imageTrans, boolean isPolygon, boolean checkDiscontinuous) Transforms the specified list of locations to a path in the image space.
-
Constructor Details
-
PathTransformer
public PathTransformer()
-
-
Method Details
-
setDiagnosticMode
public static void setDiagnosticMode(boolean flag) Sets the diagnostic mode. With diagnostic mode on, an extra step is performed when transforming the path to check for inconsistencies in earth transforms that return non-null from theEarthTransform.getBoundaryHandler()
method and the actual points returned to make sure that a discontinuity didn't occur. If the extra test reveals a discontinuity, an error is logged with the locations of the issue.- Parameters:
flag
- the diagnostic mode flag, true to perform the diagnostic. By default, diagnostics are off.
-
transformPath
public GeneralPath transformPath(List<EarthLocation> locList, EarthImageTransform imageTrans, boolean isPolygon, boolean checkDiscontinuous) Transforms the specified list of locations to a path in the image space.- Parameters:
locList
- the list of locations to transform. The locations are assumed to be joined by line segments.imageTrans
- the transform for converting earth locations to image points.isPolygon
- true if the location list forms a polygon and the result should be a polygon, or false if not.checkDiscontinuous
- true to check if a line between location pairs is discontinuous in the image space, or false to not. The check is done by calculating the resolution of the image space, so is slower than not checking.- Returns:
- the path in the image space that follows the list of locations, or null if the list represents a polygon and the polygon could not be transformed due to discontinuities.
-