org.geotools.process.feature
Class BufferFeatureCollectionProcess

java.lang.Object
  extended by org.geotools.process.impl.AbstractProcess
      extended by org.geotools.process.feature.AbstractFeatureCollectionProcess
          extended by org.geotools.process.feature.FeatureToFeatureProcess
              extended by org.geotools.process.feature.BufferFeatureCollectionProcess
All Implemented Interfaces:
Process

public class BufferFeatureCollectionProcess
extends FeatureToFeatureProcess

Process which buffers an entire feature collection.

Since:
2.6
Author:
Justin Deoliveira, OpenGEO

Field Summary
 
Fields inherited from class org.geotools.process.impl.AbstractProcess
factory
 
Constructor Summary
BufferFeatureCollectionProcess(BufferFeatureCollectionFactory factory)
          Constructor
 
Method Summary
protected  void processFeature(org.opengis.feature.simple.SimpleFeature feature, java.util.Map<java.lang.String,java.lang.Object> input)
          Performs an operation on a single feature in the collection.
 
Methods inherited from class org.geotools.process.feature.FeatureToFeatureProcess
execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferFeatureCollectionProcess

public BufferFeatureCollectionProcess(BufferFeatureCollectionFactory factory)
Constructor

Parameters:
factory -
Method Detail

processFeature

protected void processFeature(org.opengis.feature.simple.SimpleFeature feature,
                              java.util.Map<java.lang.String,java.lang.Object> input)
                       throws java.lang.Exception
Description copied from class: AbstractFeatureCollectionProcess
Performs an operation on a single feature in the collection.

This method should do some work based on the feature and then set any attributes on the feature as necessary. Example of a simple buffering operation:

 protected void processFeature(SimpleFeature feature, Map input) throws Exception {
    Double buffer = (Double) input.get( BufferFeatureCollectionFactory.BUFFER.key );

    Geometry g = (Geometry) feature.getDefaultGeometry();
    g = g.buffer( buffer );

    feature.setDefaultGeometry( g );
 }
 

Specified by:
processFeature in class AbstractFeatureCollectionProcess
Parameters:
feature - the feature being processed
input - a Map of input parameters
Throws:
java.lang.Exception


Copyright © 1996-2010 Geotools. All Rights Reserved.