Class LineFeature

java.lang.Object
noaa.coastwatch.render.feature.AbstractFeature
noaa.coastwatch.render.feature.LineFeature
All Implemented Interfaces:
Iterable<EarthLocation>, Feature
Direct Known Subclasses:
PolygonFeature

public class LineFeature extends AbstractFeature
The LineFeature class holds a list of earth location data. Various methods are provided for converting from lines of earth location data to projected image data.
Since:
3.1.1
Author:
Peter Hollemans
  • Field Details

    • lastPath

      protected GeneralPath lastPath
      The last transformed path.
    • lastTrans

      protected EarthImageTransform lastTrans
      The last earth image transform.
    • lastDiscontinuous

      protected boolean lastDiscontinuous
      The last discontinuous status.
    • fastMode

      protected static boolean fastMode
      The fast mode flag.
  • Constructor Details

    • LineFeature

      public LineFeature()
      Creates a new empty line feature with no attributes.
    • LineFeature

      public LineFeature(Object[] attributeArray)
      Creates a new empty line feature with attributes.
      Parameters:
      attributeArray - the array of feature attributes.
  • Method Details

    • isDiscontinuous

      public boolean isDiscontinuous()
      Returns:
      the discontinuous flag, true if this line feature was discontinuous during the last transformation from the set of EarthLocation points to a GeneralPath or false if not. When fast rendering mode is on (see setFastMode(boolean)), this method will always return false. If this line feature has never been transformed, this method will return false.
    • getFastMode

      public static boolean getFastMode()
      Gets the fast rendering mode flag.
      Returns:
      the fast mode flag, true if currently performing fast rendering or false if not.
      See Also:
    • setFastMode

      public static void setFastMode(boolean flag)
      Sets the fast rendering mode flag. Under fast rendering mode, the line feature is not checked for discontinuities. By default, fast rendering mode is off.
      Parameters:
      flag - the fast mode, true for fast rendering or false for not.
      See Also:
    • filter

      @Deprecated public List filter(EarthArea area)
      Deprecated.
      This method was used by GSHHSReader but is no longer needed.
      Filters this feature based on an earth area. If the line segments leave and re-enter the specified earth area, they are split into multiple features. The resulting features are returned.
      Parameters:
      area - the earth area to use for filtering earth locations.
      Returns:
      the list of features resulting from the filter operation.
    • transform

      public GeneralPath transform(EarthImageTransform imageTrans)
      Transforms this line feature to a path. The EarthImageTransform is used to eliminate any line segments which do not transform to valid image points.
      Parameters:
      imageTrans - the transform for converting earth locations to image points.
      Returns:
      the path that follows this feature's points in the transformed space.
    • getPath

      public GeneralPath getPath(EarthImageTransform trans)
      Gets the general path for this feature under the specified transform.
      Parameters:
      trans - the earth image transform for converting Earth locations to image points.
      Returns:
      the general path corresponding to this feature.
    • render

      public void render(Graphics2D g, EarthImageTransform trans)
      Renders this feature to a graphics context.
      Parameters:
      g - the graphics context for drawing.
      trans - the earth image transform for converting Earth locations to image points.