Class PolygonExtractionProcess

  • All Implemented Interfaces:

    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 boundary Polygon 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).

    Simone Giannecchini, GeoSolutions
    • Constructor Detail

      • PolygonExtractionProcess

        public PolygonExtractionProcess()
    • 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.
        coverage - the input grid coverage
        band - the coverage band to process; defaults to 0 if null
        insideEdges - whether boundaries between raster regions with data values (ie. not NODATA) should be returned; defaults to true if null
        roi - optional polygonal Geometry to define a sub-area within which vectorizing will be done
        noDataValues - optional list of values to treat as NODATA; regions with these values will not be represented in the returned features; if null, 0 is used as the single NODATA value; ignored if classificationRanges is provided
        classificationRanges - optional list of Range objects to pre-classify the input coverage prior to vectorizing; values not included in the list will be treated as NODATA; values in the first Range are classified to 1, those in the second Range to 2 etc.
        progressListener - an optional listener
        a feature collection where each feature has a Polygon ("the_geom") and an attribute "value" with value of the corresponding region in either coverage or the classified coverage (when classificationRanges is used)