Package org.geotools.process.raster
Class ContourProcess
Object
ContourProcess
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionexecute(GridCoverage2D gc2d, Integer band, double[] levels, Double interval, Boolean simplify, Boolean smooth, Geometry roi, ProgressListener progressListener) invertGridGeometry(Query targetQuery, GridGeometry gg) static SimpleFeatureCollectionprocess(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.
-
Constructor Details
-
ContourProcess
public ContourProcess()
-
-
Method Details
-
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 thelevelsargument, or by specifying the interval between contour values via theintervalargument. In the interval case, the resulting contour values will be integer multiples of the specified interval. If bothlevelsandintervalare supplied theintervalargument is ignored.- Parameters:
gc2d- the input grid coverageband- the coverage band to process; defaults to 0 ifnulllevels- the values for which contours should be generatedinterval- the interval between contour values (iflevelsis 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 polygonalGeometryto 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
-
invertGridGeometry
-