Permalink
Browse files

Some refactorying to make raster and vector process factories extensi…

…ble.

Deprecated GSProcess interface in favor of VectorProcess and RasterProcess
interfaces/extension points loaded via spi.
  • Loading branch information...
1 parent d544b50 commit 240ec22f9d9973b694fcf58490a29dbe62772b80 jdeolive committed Aug 30, 2012
Showing with 319 additions and 120 deletions.
  1. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/AggregateProcess.java
  2. +1 −2 ...s/unsupported/process-feature/src/main/java/org/geotools/process/vector/BarnesSurfaceProcess.java
  3. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/BoundsProcess.java
  4. +1 −2 ...nsupported/process-feature/src/main/java/org/geotools/process/vector/BufferFeatureCollection.java
  5. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/CentroidProcess.java
  6. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/ClipProcess.java
  7. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/CollectGeometries.java
  8. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/CountProcess.java
  9. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/FeatureProcess.java
  10. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/GridProcess.java
  11. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/HeatmapProcess.java
  12. +1 −2 ...pported/process-feature/src/main/java/org/geotools/process/vector/InclusionFeatureCollection.java
  13. +1 −2 ...rted/process-feature/src/main/java/org/geotools/process/vector/IntersectionFeatureCollection.java
  14. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/LRSGeocodeProcess.java
  15. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/LRSMeasureProcess.java
  16. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/LRSSegmentProcess.java
  17. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/NearestProcess.java
  18. +2 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/PointBuffers.java
  19. +1 −2 ...es/unsupported/process-feature/src/main/java/org/geotools/process/vector/PointStackerProcess.java
  20. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/QueryProcess.java
  21. +1 −2 ...unsupported/process-feature/src/main/java/org/geotools/process/vector/RectangularClipProcess.java
  22. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/ReprojectProcess.java
  23. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/SimplifyProcess.java
  24. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/SnapProcess.java
  25. +1 −1 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/TransformProcess.java
  26. +1 −2 ...unsupported/process-feature/src/main/java/org/geotools/process/vector/UnionFeatureCollection.java
  27. +1 −2 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/UniqueProcess.java
  28. +28 −0 modules/unsupported/process-feature/src/main/java/org/geotools/process/vector/VectorProcess.java
  29. +19 −30 ...s/unsupported/process-feature/src/main/java/org/geotools/process/vector/VectorProcessFactory.java
  30. +2 −2 .../unsupported/process-feature/src/main/java/org/geotools/process/vector/VectorToRasterProcess.java
  31. +1 −2 .../unsupported/process-feature/src/main/java/org/geotools/process/vector/VectorZonalStatistics.java
  32. +29 −0 ...ed/process-feature/src/main/resources/META-INF/services/org.geotools.process.vector.VectorProcess
  33. +61 −0 ...supported/process-feature/src/test/java/org/geotools/process/vector/VectorProcessFactoryTest.java
  34. +1 −2 ...les/unsupported/process-raster/src/main/java/org/geotools/process/raster/AddCoveragesProcess.java
  35. +1 −2 modules/unsupported/process-raster/src/main/java/org/geotools/process/raster/AreaGridProcess.java
  36. +1 −2 modules/unsupported/process-raster/src/main/java/org/geotools/process/raster/ContourProcess.java
  37. +1 −1 modules/unsupported/process-raster/src/main/java/org/geotools/process/raster/CropCoverage.java
  38. +1 −2 ...nsupported/process-raster/src/main/java/org/geotools/process/raster/MultiplyCoveragesProcess.java
  39. +1 −2 ...nsupported/process-raster/src/main/java/org/geotools/process/raster/PolygonExtractionProcess.java
  40. +1 −2 modules/unsupported/process-raster/src/main/java/org/geotools/process/raster/RangeLookupProcess.java
  41. +1 −2 ...rted/process-raster/src/main/java/org/geotools/process/raster/RasterAsPointCollectionProcess.java
  42. +28 −0 modules/unsupported/process-raster/src/main/java/org/geotools/process/raster/RasterProcess.java
  43. +14 −12 ...es/unsupported/process-raster/src/main/java/org/geotools/process/raster/RasterProcessFactory.java
  44. +1 −2 ...s/unsupported/process-raster/src/main/java/org/geotools/process/raster/RasterZonalStatistics.java
  45. +1 −2 modules/unsupported/process-raster/src/main/java/org/geotools/process/raster/ScaleCoverage.java
  46. +1 −2 modules/unsupported/process-raster/src/main/java/org/geotools/process/raster/StyleCoverage.java
  47. +11 −0 ...ted/process-raster/src/main/resources/META-INF/services/org.geotools.process.raster.RasterProcess
  48. +61 −0 ...nsupported/process-raster/src/test/java/org/geotools/process/raster/RasterProcessFactoryTest.java
  49. +25 −0 ...s/unsupported/process/src/main/java/org/geotools/process/factory/AnnotatedBeanProcessFactory.java
  50. +1 −0 modules/unsupported/process/src/main/java/org/geotools/process/gs/GSProcess.java
@@ -39,7 +39,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.util.NullProgressListener;
import org.opengis.feature.Feature;
import org.opengis.feature.type.AttributeDescriptor;
@@ -53,7 +52,7 @@
* @source $URL$
*/
@DescribeProcess(title = "Aggregate", description = "Computes one or more aggregation functions on a feature attribute. Functions include Count, Average, Max, Median, Min, StdDev, and Sum.")
-public class AggregateProcess implements GSProcess {
+public class AggregateProcess implements VectorProcess {
// the functions this process can handle
public enum AggregationFunction {
Count, Average, Max, Median, Min, StdDev, Sum;
@@ -38,7 +38,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.referencing.CRS;
import org.opengis.coverage.grid.GridCoverage;
import org.opengis.coverage.grid.GridGeometry;
@@ -138,7 +137,7 @@
*/
@DescribeProcess(title = "BarnesSurface", description = "Uses Barnes Analysis to compute an interpolated surface over a set of irregular data points.")
-public class BarnesSurfaceProcess implements GSProcess {
+public class BarnesSurfaceProcess implements VectorProcess {
// no process state is defined, since RenderingTransformation processes must be stateless
@@ -22,7 +22,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
/**
* Simple process with a {@link ReferencedEnvelope} as the output
@@ -32,7 +31,7 @@
* @source $URL$
*/
@DescribeProcess(title = "Bounds", description = "Computes the bounding box of the input features.")
-public class BoundsProcess implements GSProcess {
+public class BoundsProcess implements VectorProcess {
@DescribeResult(name = "bounds", description = "Bounding box of input features")
public ReferencedEnvelope execute(
@@ -23,7 +23,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.process.gs.WrappingIterator;
import org.geotools.data.simple.SimpleFeatureCollection;
import org.geotools.data.simple.SimpleFeatureIterator;
@@ -52,7 +51,7 @@
* @source $URL$
*/
@DescribeProcess(title = "Buffer", description = "Buffers features by a distance value supplied either as a parameter or by a feature attribute. Calculates buffers based on Cartesian distances.")
-public class BufferFeatureCollection implements GSProcess {
+public class BufferFeatureCollection implements VectorProcess {
@DescribeResult(description = "Buffered feature collection")
public SimpleFeatureCollection execute(
@DescribeParameter(name = "features", description = "Input feature collection") SimpleFeatureCollection features,
@@ -29,7 +29,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;
import org.opengis.feature.type.AttributeDescriptor;
@@ -48,7 +47,7 @@
* @source $URL: http://svn.osgeo.org/geotools/trunk/modules/unsupported/process-feature/src/main/java/org/geotools/process/feature/gs/CentroidProcess.java $
*/
@DescribeProcess(title = "Centroid", description = "Computes the geometric centroids of features")
-public class CentroidProcess implements GSProcess {
+public class CentroidProcess implements VectorProcess {
@DescribeResult(name = "result", description = "Centroids of input features")
public SimpleFeatureCollection execute(
@@ -25,7 +25,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.process.gs.WrappingIterator;
import org.geotools.data.simple.SimpleFeatureCollection;
@@ -63,7 +62,7 @@
* @source $URL$
*/
@DescribeProcess(title = "Clip", description = "Clips (crops) features to a given geometry")
-public class ClipProcess implements GSProcess {
+public class ClipProcess implements VectorProcess {
@DescribeResult(name = "result", description = "Clipped feature collection")
public SimpleFeatureCollection execute(
@@ -25,7 +25,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.opengis.util.ProgressListener;
import com.vividsolutions.jts.geom.Geometry;
@@ -40,7 +39,7 @@
* @source $URL$
*/
@DescribeProcess(title = "Collect Geometries", description = "Collects the deafult geometries of the input features and combines them into a single geometry collection")
-public class CollectGeometries implements GSProcess {
+public class CollectGeometries implements VectorProcess {
@DescribeResult(name = "result", description = "Geometry collection of all input geometries")
public GeometryCollection execute(
@@ -20,7 +20,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.data.simple.SimpleFeatureCollection;
/**
@@ -31,7 +30,7 @@
* @source $URL$
*/
@DescribeProcess(title = "Count Features", description = "Computes the number of features in a feature collection.")
-public class CountProcess implements GSProcess {
+public class CountProcess implements VectorProcess {
/** The functions this process can handle */
public enum AggregationFunction {
Average, Max, Median, Min, StdDev, Sum;
@@ -7,7 +7,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.referencing.CRS;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;
@@ -21,7 +20,7 @@
*
* @source $URL$
*/
-public class FeatureProcess implements GSProcess {
+public class FeatureProcess implements VectorProcess {
@DescribeResult(name = "result", description = "Output feature collection")
public SimpleFeatureCollection execute(
@@ -34,7 +34,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.opengis.feature.simple.SimpleFeatureType;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
@@ -48,7 +47,7 @@
* @source $URL$
*/
@DescribeProcess(title = "Grid", description = "Generates a georeferenced regular grid of cells. Output contains the attributes: cell - the cell polygon; id - a unique identifier; centerX and centerY - the ordinates of the cell center.")
-public class GridProcess implements GSProcess {
+public class GridProcess implements VectorProcess {
enum GridMode {
Rectangular, HexagonFlat, HexagonAngled
@@ -35,7 +35,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.referencing.CRS;
import org.opengis.coverage.grid.GridCoverage;
import org.opengis.coverage.grid.GridGeometry;
@@ -118,7 +117,7 @@
*
*/
@DescribeProcess(title = "Heatmap", description = "Computes a heatmap surface over a set of data points and outputs as a single-band raster.")
-public class HeatmapProcess implements GSProcess {
+public class HeatmapProcess implements VectorProcess {
@DescribeResult(name = "result", description = "Output raster")
public GridCoverage2D execute(
@@ -23,7 +23,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.process.gs.WrappingIterator;
import org.geotools.data.simple.SimpleFeatureCollection;
import org.geotools.data.simple.SimpleFeatureIterator;
@@ -46,7 +45,7 @@
* @author Pietro Arena - Sinergis
*/
@DescribeProcess(title = "Inclusion of Feature Collections", description = "Returns a feature collection consisting of the features from the first collection which are spatially contained in at least one feature of the second collection.")
-public class InclusionFeatureCollection implements GSProcess {
+public class InclusionFeatureCollection implements VectorProcess {
@DescribeResult(description = "Output feature collection")
public SimpleFeatureCollection execute(
@DescribeParameter(name = "first", description = "First feature collection") SimpleFeatureCollection firstFeatures,
@@ -34,7 +34,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.process.gs.WrappingIterator;
import org.geotools.referencing.CRS;
import org.opengis.feature.simple.SimpleFeature;
@@ -68,7 +67,7 @@
* @author Luca Paolino - GeoSolutions
*/
@DescribeProcess(title = "Intersection of Feature Collections", description = "Spatial intersection of two feature collections, incuding combining attributes from both.")
-public class IntersectionFeatureCollection implements GSProcess {
+public class IntersectionFeatureCollection implements VectorProcess {
private static final Logger logger = Logger
.getLogger("org.geotools.process.feature.gs.IntersectionFeatureCollection");
public static enum IntersectionMode {
@@ -28,7 +28,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.util.logging.Logging;
import org.opengis.feature.Feature;
import org.opengis.feature.simple.SimpleFeature;
@@ -49,7 +48,7 @@
*
* @source $URL: http://svn.osgeo.org/geotools/trunk/modules/unsupported/process-feature/src/main/java/org/geotools/process/feature/gs/NearestProcess.java $
*/
-public class LRSGeocodeProcess implements GSProcess {
+public class LRSGeocodeProcess implements VectorProcess {
private static final Logger LOGGER = Logging.getLogger(LRSGeocodeProcess.class);
private final GeometryFactory geometryFactory = new GeometryFactory();
@@ -33,7 +33,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.referencing.CRS;
import org.geotools.referencing.crs.DefaultGeographicCRS;
import org.geotools.util.logging.Logging;
@@ -60,7 +59,7 @@
*
* @source $URL: http://svn.osgeo.org/geotools/trunk/modules/unsupported/process-feature/src/main/java/org/geotools/process/feature/gs/NearestProcess.java $
*/
-public class LRSMeasureProcess implements GSProcess {
+public class LRSMeasureProcess implements VectorProcess {
private static final Logger LOGGER = Logging.getLogger(LRSMeasureProcess.class);
private final GeometryFactory geometryFactory = new GeometryFactory();
@@ -27,7 +27,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.util.logging.Logging;
import org.opengis.feature.Feature;
import org.opengis.feature.simple.SimpleFeature;
@@ -47,7 +46,7 @@
*
* @source $URL: http://svn.osgeo.org/geotools/trunk/modules/unsupported/process-feature/src/main/java/org/geotools/process/feature/gs/NearestProcess.java $
*/
-public class LRSSegmentProcess implements GSProcess {
+public class LRSSegmentProcess implements VectorProcess {
private static final Logger LOGGER = Logging.getLogger(LRSSegmentProcess.class);
private final GeometryFactory geometryFactory = new GeometryFactory();
@@ -33,7 +33,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.referencing.CRS;
import org.geotools.referencing.crs.DefaultGeographicCRS;
import org.geotools.util.logging.Logging;
@@ -59,7 +58,7 @@
*
* @source $URL$
*/
-public class NearestProcess implements GSProcess {
+public class NearestProcess implements VectorProcess {
private static final Logger LOGGER = Logging.getLogger(NearestProcess.class);
private GeometryFactory geometryFactory = new GeometryFactory();
@@ -31,7 +31,7 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
+
import org.geotools.referencing.CRS;
import org.geotools.referencing.GeodeticCalculator;
import org.opengis.feature.simple.SimpleFeatureType;
@@ -52,7 +52,7 @@
* be a point layer, the reference layer must be a polygonal one"
*/
@DescribeProcess(title = "Point Buffers", description = "Returns a collection of circular buffer polygons with specified radii centered on a given point")
-public class PointBuffers implements GSProcess {
+public class PointBuffers implements VectorProcess {
@DescribeResult(name = "buffers", description = "Features for the circular buffer polygons around the point, with attributes geom and radius")
public SimpleFeatureCollection execute(
@@ -33,7 +33,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.referencing.CRS;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;
@@ -78,7 +77,7 @@
*
*/
@DescribeProcess(title = "Point Stacker", description = "Aggregates a collection of points over a grid into one point per grid cell.")
-public class PointStackerProcess implements GSProcess {
+public class PointStackerProcess implements VectorProcess {
public static final String ATTR_GEOM = "geom";
public static final String ATTR_COUNT = "count";
@@ -22,7 +22,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.data.simple.SimpleFeatureCollection;
import org.geotools.data.store.ReTypingFeatureCollection;
import org.geotools.feature.collection.FilteringSimpleFeatureCollection;
@@ -37,7 +36,7 @@
*
* @source $URL$
*/
-public class QueryProcess implements GSProcess {
+public class QueryProcess implements VectorProcess {
@DescribeResult(name = "result", description = "The filtered feature collection")
public SimpleFeatureCollection execute(
@DescribeParameter(name = "features", description = "Input feature collection") SimpleFeatureCollection features,
@@ -24,7 +24,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
/**
* A process clipping the geometries in the input feature collection to a specified rectangle
@@ -35,7 +34,7 @@
* @source $URL$
*/
@DescribeProcess(title = "Rectangular Clip", description = "Clips (crops) features to the specified rectangular extent")
-public class RectangularClipProcess implements GSProcess {
+public class RectangularClipProcess implements VectorProcess {
@DescribeResult(name = "result", description = "Clipped feature collection")
public SimpleFeatureCollection execute(
@@ -20,7 +20,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.data.crs.ForceCoordinateSystemFeatureResults;
import org.geotools.data.simple.SimpleFeatureCollection;
import org.geotools.data.store.ReprojectingFeatureCollection;
@@ -35,7 +34,7 @@
* @source $URL$
*/
@DescribeProcess(title = "Reproject Features", description = "Reprojects features into a supplied coordinate reference system. Can also force a feature collection to have a given CRS.")
-public class ReprojectProcess implements GSProcess {
+public class ReprojectProcess implements VectorProcess {
@DescribeResult(name = "result", description = "Input feature collection")
public SimpleFeatureCollection execute(
@@ -28,7 +28,6 @@
import org.geotools.process.factory.DescribeParameter;
import org.geotools.process.factory.DescribeProcess;
import org.geotools.process.factory.DescribeResult;
-import org.geotools.process.gs.GSProcess;
import org.geotools.process.gs.WrappingIterator;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;
@@ -47,7 +46,7 @@
* @source $URL$
*/
@DescribeProcess(title = "Simplify", description = "Simplifies feature geometry by reducing vertices using Douglas-Peucker simplification.")
-public class SimplifyProcess implements GSProcess {
+public class SimplifyProcess implements VectorProcess {
@DescribeResult(name = "result", description = "The simplified feature collection")
public SimpleFeatureCollection execute(
Oops, something went wrong.

0 comments on commit 240ec22

Please sign in to comment.