From: <svn...@os...> - 2012-03-04 09:06:36
|
Author: jive Date: 2012-03-04 01:06:29 -0800 (Sun, 04 Mar 2012) New Revision: 38603 Added: trunk/docs/src/main/java/org/geotools/process/ trunk/docs/src/main/java/org/geotools/process/FeatureProcessExamples.java Modified: trunk/docs/user/library/opengis/filter.rst trunk/docs/user/unsupported/process/process-feature.rst Log: code example for TransformProcess Signed-off-by: Jody Garnett <jod...@gm...> Added: trunk/docs/src/main/java/org/geotools/process/FeatureProcessExamples.java =================================================================== --- trunk/docs/src/main/java/org/geotools/process/FeatureProcessExamples.java (rev 0) +++ trunk/docs/src/main/java/org/geotools/process/FeatureProcessExamples.java 2012-03-04 09:06:29 UTC (rev 38603) @@ -0,0 +1,31 @@ +/* + * GeoTools - The Open Source Java GIS Toolkit + * http://geotools.org + * + * (C) 2012, Open Source Geospatial Foundation (OSGeo) + * + * This file is hereby placed into the Public Domain. This means anyone is + * free to do whatever they wish with this file. Use it well and enjoy! + */ +package org.geotools.process; + +import org.geotools.data.simple.SimpleFeatureCollection; +import org.geotools.feature.NameImpl; +import org.geotools.process.feature.gs.TransformProcess; +import org.geotools.util.NullProgressListener; + +public class FeatureProcessExamples { + +public void exampleTransformProcess(SimpleFeatureCollection featureCollection){ + // transform start + String transform = + "the_geom=the_geom\n"+ + "name=name\n"+ + "area=area( the_geom )"; + + TransformProcess process = new TransformProcess(); + + SimpleFeatureCollection features = process.execute( featureCollection, transform ); + // transform end +} +} Property changes on: trunk/docs/src/main/java/org/geotools/process/FeatureProcessExamples.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Id Added: svn:eol-style + native Modified: trunk/docs/user/library/opengis/filter.rst =================================================================== --- trunk/docs/user/library/opengis/filter.rst 2012-03-04 04:06:19 UTC (rev 38602) +++ trunk/docs/user/library/opengis/filter.rst 2012-03-04 09:06:29 UTC (rev 38603) @@ -27,7 +27,7 @@ * Here is an example of using filter and expression together:: - final FilterFactory ff = CommonFactoryFinder.getFilterFactory( null ); + final FilterFactory ff = CommonFactoryFinder.getFilterFactory(); Filter filter = ff.propertyLessThan( ff.property( "AGE"), ff.literal( 12 ) ); SimpleFeatureCollection features = featureSource.getFeatures( filter ); Modified: trunk/docs/user/unsupported/process/process-feature.rst =================================================================== --- trunk/docs/user/unsupported/process/process-feature.rst 2012-03-04 04:06:19 UTC (rev 38602) +++ trunk/docs/user/unsupported/process/process-feature.rst 2012-03-04 09:06:29 UTC (rev 38603) @@ -15,13 +15,14 @@ Transform ^^^^^^^^^ -Transform a feature collection using a series of expressions. +Transform a feature collection using a series of expressions to define each attribute. -The definition of the output feature type can be provided as a Definition data structure or using a simple string format:: +The definition of the output feature type can be provided as a Definition data structure or using a simple string format: - the_geom=the_geom - name=name - area=area( the_geom ) +.. literalinclude:: /../src/main/java/org/geotools/process/FeatureProcessExamples.java + :language: java + :start-after: // transform start + :end-before: // transform end This is a very flexible process which can be used to: |