Class ContourProcess

  • All Implemented Interfaces:
    RasterProcess

    public class ContourProcess
    extends Object
    implements RasterProcess
    A process to extract contours based on values in a specified band of the input GridCoverage2D. This is a geo-spatial wrapper around the JAITools "Contour" operation (see ContourDescriptor for details of the underlying algorithm).

    You can specify the specific values for which contours will be generated, or alternatively the interval between contour values.

    Contours are returned as a feature collection, where each feature has, as its default geometry, a LineString for the contour ("the_geom"), and the contour value as the Double attribute "value".

    Since:
    8.0
    Author:
    Simone Giannecchini, GeoSolutions
    • Constructor Detail

      • ContourProcess

        public ContourProcess()
    • Method Detail

      • process

        public static SimpleFeatureCollection process​(GridCoverage2D gc2d,
                                                      Integer band,
                                                      double[] levels,
                                                      Double interval,
                                                      Boolean simplify,
                                                      Boolean smooth,
                                                      Geometry roi,
                                                      ProgressListener progressListener)
                                               throws ProcessException
        Perform the contouring on the input GridCoverage2D and returns the results as a feature collection. You can control which contours are generated either by providing a list of values via the levels argument, or by specifying the interval between contour values via the interval argument. In the interval case, the resulting contour values will be integer multiples of the specified interval. If both levels and interval are supplied the interval argument is ignored.
        Parameters:
        gc2d - the input grid coverage
        band - the coverage band to process; defaults to 0 if null
        levels - the values for which contours should be generated
        interval - the interval between contour values (if levels is not provided)
        simplify - whether to simplify contour lines by removing co-linear vertices; default is to simplify
        smooth - whether to apply Bezier smooth to the contours; default is no smoothing
        roi - an optional polygonal Geometry to define the region of interest within which contours will be generated
        Returns:
        the contours a feature collection where each feature contains a contour as a LineString and the contour value as a Double
        Throws:
        ProcessException