Class PolygonFeatureSource

All Implemented Interfaces:
Iterable<Feature>, FeatureSource
Direct Known Subclasses:
BinnedGSHHSReader

public abstract class PolygonFeatureSource extends LineFeatureSource
The PolygonFeatureSource extends the LineFeatureSource class to render filled polygons as well as lines. Polygon features are maintained in a separate list, so that line features and polygon features may be rendered independently.
Since:
3.1.4
Author:
Peter Hollemans
  • Field Details

    • polygonList

      protected List<PolygonFeature> polygonList
      The currently selected list of polygon features.
  • Constructor Details

    • PolygonFeatureSource

      protected PolygonFeatureSource()
      Creates a new source with an empty list of polygons.
  • Method Details

    • renderPolygons

      public void renderPolygons(Graphics2D g, EarthImageTransform trans)
      Renders the selected polygon data to a graphics context. This method differs from the LineFeatureSource.render(java.awt.Graphics2D, noaa.coastwatch.render.EarthImageTransform) method in three ways:
      1. Groups of polygons are rendered as a batch using a non-zero winding rule (see the PathIterator class for details). This is done so that hierarchical levels of polygons (polygons contained within other polygons) whose winding orders are different are rendered correctly.
      2. Groups of polygons that should be rendered as a batch are separated by a polygon of length zero.
      3. Polygons that are detected to be discontinuous are not rendered, and all polygons in their group are also ignored. This helps to avoid strange polygon rendering results.
      Parameters:
      g - the graphics context for drawing.
      trans - the earth image transform for converting earth locations to image points.
    • renderOutlines

      public void renderOutlines(Graphics2D g, EarthImageTransform trans)
      Renders the selected polygon data to a graphics context as just the polygon outlines.
      Parameters:
      g - the graphics context for drawing.
      trans - the earth image transform for converting earth locations to image points.