Package org.geotools.process.raster
Class ContourProcess
- Object
-
- 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 Summary
Constructors Constructor Description ContourProcess()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleFeatureCollection
execute(GridCoverage2D gc2d, Integer band, double[] levels, Double interval, Boolean simplify, Boolean smooth, Geometry roi, ProgressListener progressListener)
static SimpleFeatureCollection
process(GridCoverage2D gc2d, Integer band, double[] levels, Double interval, Boolean simplify, Boolean smooth, Geometry roi, ProgressListener progressListener)
Perform the contouring on the input GridCoverage2D and returns the results as a feature collection.
-
-
-
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 thelevels
argument, or by specifying the interval between contour values via theinterval
argument. In the interval case, the resulting contour values will be integer multiples of the specified interval. If bothlevels
andinterval
are supplied theinterval
argument is ignored.- Parameters:
gc2d
- the input grid coverageband
- the coverage band to process; defaults to 0 ifnull
levels
- the values for which contours should be generatedinterval
- the interval between contour values (iflevels
is not provided)simplify
- whether to simplify contour lines by removing co-linear vertices; default is to simplifysmooth
- whether to apply Bezier smooth to the contours; default is no smoothingroi
- an optional polygonalGeometry
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
-
execute
public SimpleFeatureCollection execute(GridCoverage2D gc2d, Integer band, double[] levels, Double interval, Boolean simplify, Boolean smooth, Geometry roi, ProgressListener progressListener) throws ProcessException
- Throws:
ProcessException
-
-