org.geotools.process.raster
Class RasterToVectorFactory

java.lang.Object
  extended by org.geotools.process.impl.SingleProcessFactory
      extended by org.geotools.process.raster.RasterToVectorFactory
All Implemented Interfaces:
Factory, OptionalFactory, ProcessFactory

public class RasterToVectorFactory
extends SingleProcessFactory

Process for converting a raster regions to vector polygons.

The algorithm used is adapted from the GRASS raster to vector C code. It moves a 2x2 kernel over the input raster. The data in the kernel are matched to a table of the 12 possible configurations indicating which horizontal and/or vertical pixel boundaries need to be traced.

Since:
2.6
Author:
Michael Bedward, Jody Garnett

Field Summary
static Parameter<java.lang.Integer> BAND
          Index of the band with data to vectorize
static Parameter<org.opengis.geometry.Envelope> BOUNDS
          Bounds (in world coordinates) ot the area to vectorize; if null or absent the bounds of the coverage are used
static Parameter<java.lang.Boolean> INSIDE_EDGES
          Whether inside edges (those separating regions with non-outside values) should be vectorized.
static Parameter<java.util.Collection> OUTSIDE
          The code(s) representing NODATA or outside the regions to be vectorized.
static Parameter<GridCoverage2D> RASTER
          Grid coverage to vectorize
static Parameter<FeatureCollection> RESULT_FEATURES
          Parameter to retrieve the vectorized features from the results map returned by RasterToVectorProcess.execute(java.util.Map, org.opengis.util.ProgressListener)
 
Constructor Summary
RasterToVectorFactory()
           
 
Method Summary
 RasterToVectorProcess create()
          Return a new instance of a RasterToVectorProcess
 org.opengis.util.InternationalString getDescription()
          Get the description of this process
 java.util.Map<java.lang.String,Parameter<?>> getParameterInfo()
          Get a map of input parameters required by the RasterToVectorProcess.execute(java.util.Map, org.opengis.util.ProgressListener) method
 java.util.Map<java.lang.String,Parameter<?>> getResultInfo(java.util.Map<java.lang.String,java.lang.Object> parameters)
          Get information about the results that are returned as Map by the RasterToVectorProcess.execute(java.util.Map, org.opengis.util.ProgressListener) method
static org.opengis.feature.simple.SimpleFeatureType getSchema(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
          Return the feature type of the vectorized polygons.
 org.opengis.util.InternationalString getTitle()
          Get the process title
 java.lang.String getVersion()
          Get the version of this process
 boolean supportsProgress()
          Check if this process supports a progress listener
 
Methods inherited from class org.geotools.process.impl.SingleProcessFactory
create, getDescription, getImplementationHints, getNames, getParameterInfo, getResultInfo, getTitle, getVersion, isAvailable, supportsProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RASTER

public static final Parameter<GridCoverage2D> RASTER
Grid coverage to vectorize


BAND

public static final Parameter<java.lang.Integer> BAND
Index of the band with data to vectorize


BOUNDS

public static final Parameter<org.opengis.geometry.Envelope> BOUNDS
Bounds (in world coordinates) ot the area to vectorize; if null or absent the bounds of the coverage are used


OUTSIDE

public static final Parameter<java.util.Collection> OUTSIDE
The code(s) representing NODATA or outside the regions to be vectorized.


INSIDE_EDGES

public static final Parameter<java.lang.Boolean> INSIDE_EDGES
Whether inside edges (those separating regions with non-outside values) should be vectorized. If Boolean.TRUE (the default), inside edges are vectorized. If Boolean.FALSE only edges between outside and non-outside values are vectorized.


RESULT_FEATURES

public static final Parameter<FeatureCollection> RESULT_FEATURES
Parameter to retrieve the vectorized features from the results map returned by RasterToVectorProcess.execute(java.util.Map, org.opengis.util.ProgressListener)

Constructor Detail

RasterToVectorFactory

public RasterToVectorFactory()
Method Detail

create

public RasterToVectorProcess create()
Return a new instance of a RasterToVectorProcess

Specified by:
create in class SingleProcessFactory

getDescription

public org.opengis.util.InternationalString getDescription()
Get the description of this process

Specified by:
getDescription in class SingleProcessFactory
Returns:
the string: Raster region to vector polygon conversion

getParameterInfo

public java.util.Map<java.lang.String,Parameter<?>> getParameterInfo()
Get a map of input parameters required by the RasterToVectorProcess.execute(java.util.Map, org.opengis.util.ProgressListener) method

Specified by:
getParameterInfo in class SingleProcessFactory
Returns:
a Map of input parameters

getResultInfo

public java.util.Map<java.lang.String,Parameter<?>> getResultInfo(java.util.Map<java.lang.String,java.lang.Object> parameters)
                                                           throws java.lang.IllegalArgumentException
Get information about the results that are returned as Map by the RasterToVectorProcess.execute(java.util.Map, org.opengis.util.ProgressListener) method

Specified by:
getResultInfo in class SingleProcessFactory
Parameters:
parameters - ignored at present so may be null
Returns:
a Map of output parameters
Throws:
java.lang.IllegalArgumentException

getTitle

public org.opengis.util.InternationalString getTitle()
Get the process title

Specified by:
getTitle in interface ProcessFactory
Overrides:
getTitle in class SingleProcessFactory
Returns:
title

getVersion

public java.lang.String getVersion()
Get the version of this process

Specified by:
getVersion in class SingleProcessFactory
Returns:
version as a string

supportsProgress

public boolean supportsProgress()
Check if this process supports a progress listener

Specified by:
supportsProgress in class SingleProcessFactory
Returns:
always returns true

getSchema

public static org.opengis.feature.simple.SimpleFeatureType getSchema(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Return the feature type of the vectorized polygons. Note: We can generate a schema; but we need to know the CoordinateReferenceSystem.

Parameters:
crs - a coorindate reference system for the features
Returns:
a new SimpleFeatureType with name: r2vPolygons and two attributes: shape (Polygon) and gridvalue (Double)


Copyright © 1996-2010 Geotools. All Rights Reserved.