Package org.geotools.process.raster
Class PolygonExtractionProcess
- Object
-
- PolygonExtractionProcess
-
- All Implemented Interfaces:
RasterProcess
public class PolygonExtractionProcess extends Object implements RasterProcess
A process for raster to vector conversion. Regions of uniform value in an input GridCoverage2D are converted into Polygons by tracing the cell boundaries. Results are returned as a SimpleFeatureCollection in which each feature corresponds to a raster region with the boundaryPolygon
as its default geometry ("the_geom") and the value of the raster region cells as an attribute ("value").Optionally, a list of classification ranges (Range objects) can be provided to pre-classify the input coverage values into intervals. Vectorizing can also be restricted to a sub-area of the coverage and/or a subset of raster values (by defining values to treat as no-data).
- Since:
- 8.0
- Author:
- Simone Giannecchini, GeoSolutions
-
-
Constructor Summary
Constructors Constructor Description PolygonExtractionProcess()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleFeatureCollection
execute(GridCoverage2D coverage, Integer band, Boolean insideEdges, Geometry roi, Collection<Number> noDataValues, List<Range> classificationRanges, ProgressListener progressListener)
Executes the raster to vector process.
-
-
-
Method Detail
-
execute
public SimpleFeatureCollection execute(GridCoverage2D coverage, Integer band, Boolean insideEdges, Geometry roi, Collection<Number> noDataValues, List<Range> classificationRanges, ProgressListener progressListener) throws ProcessException
Executes the raster to vector process.- Parameters:
coverage
- the input grid coverageband
- the coverage band to process; defaults to 0 ifnull
insideEdges
- whether boundaries between raster regions with data values (ie. not NODATA) should be returned; defaults totrue
ifnull
roi
- optional polygonalGeometry
to define a sub-area within which vectorizing will be donenoDataValues
- optional list of values to treat as NODATA; regions with these values will not be represented in the returned features; ifnull
, 0 is used as the single NODATA value; ignored ifclassificationRanges
is providedclassificationRanges
- optional list ofRange
objects to pre-classify the input coverage prior to vectorizing; values not included in the list will be treated as NODATA; values in the firstRange
are classified to 1, those in the secondRange
to 2 etc.progressListener
- an optional listener- Returns:
- a feature collection where each feature has a
Polygon
("the_geom") and an attribute "value" with value of the corresponding region in eithercoverage
or the classified coverage (whenclassificationRanges
is used) - Throws:
ProcessException
-
-