@DescribeResult(description = "Output feature collection") public SimpleFeatureCollection execute( @DescribeParameter(name = "first", description = "First feature collection") SimpleFeatureCollection firstFeatures, @DescribeParameter(name = "second", description = "Second feature collection") SimpleFeatureCollection secondFeatures) { return new IncludedFeatureCollection(firstFeatures, secondFeatures); }
if (collection) { if (info != null) { type = info.collectionType(); if (type == null) { type = Object.class; min = info.min() > -1 ? info.min() : 0; max = info.max() > -1 ? info.max() : Integer.MAX_VALUE; } else { type = Object.class; min = info.min() > -1 ? info.min() : 0; max = info.max() > -1 ? info.max() : Integer.MAX_VALUE; } else { min = 0; } else { if (info != null) { if (info.min() > 1) { throw new IllegalArgumentException( "The non collection parameter at index " min = info.min() > -1 ? info.min() : 1; if (info.max() > 1) { throw new IllegalArgumentException( "The non collection parameter at index " max = info.max() > -1 ? info.max() : 1;
if (collection) { if (info != null) { type = info.collectionType(); if (type == null) { type = Object.class; min = info.min() > -1 ? info.min() : 0; max = info.max() > -1 ? info.max() : Integer.MAX_VALUE; } else { type = Object.class; min = info.min() > -1 ? info.min() : 0; max = info.max() > -1 ? info.max() : Integer.MAX_VALUE; } else { min = 0; } else { if (info != null) { if (info.min() > 1) { throw new IllegalArgumentException("The non collection parameter at index " + i + " cannot have a min multiplicity > 1"); min = info.min() > -1 ? info.min() : 1; if (info.max() > 1) { throw new IllegalArgumentException("The non collection parameter at index " + i + " cannot have a max multiplicity > 1"); max = info.max() > -1 ? info.max() : 1;
@DescribeProcess( title = "Relate Test", description = "Tests if the spatial relationship between two geometries matches the given DE-9IM intersection matrix pattern. The pattern is given in the form [II][IB][IE][BI][BB][BE][EI][EB][EE] where I=interior, B=boundary, and E=exterior. Pattern symbols can be 2, 1, 0, F or *." ) @DescribeResult(description = "True if the inputs have the given relationship") public static boolean relatePattern( @DescribeParameter(name = "a", description = "First input geometry") Geometry a, @DescribeParameter(name = "b", description = "First input geometry") Geometry b, @DescribeParameter(name = "Relate pattern", description = "Intersection matrix pattern") String pattern) { return a.relate(b, pattern); }
@DescribeResult(name = "result", description = "Transformed feature collection") public SimpleFeatureCollection executeList( @DescribeParameter(name = "features", description = "Input feature collection") SimpleFeatureCollection features, @DescribeParameter( name = "transform", description = "List of Definitions for the output feature attributes" ) List<Definition> transform) throws ProcessException { if (transform == null) { return features; // no change } return new ReshapeFeatureCollection(features, transform); }
@DescribeProcess( title = "Exactly Equal Test with Tolerance", description = "Tests if two geometries are identical on a vertex-by-vertex basis, up to a vertex distance tolerance." ) @DescribeResult(description = "True if the geometries are vertex-identical within tolerance") public static boolean equalsExactTolerance( @DescribeParameter(name = "a", description = "First input geometry") Geometry a, @DescribeParameter(name = "b", description = "Second input geometry") Geometry b, @DescribeParameter( name = "tolerance", description = "Tolerance distance for vertex equality test" ) double tolerance) { return a.equalsExact(b, tolerance); }
@DescribeProcess( title = "Within Distance Test", description = "Tests if the minimum distance between two geometries is less than a tolerance value." ) @DescribeResult(description = "True if the inputs are within the specified distance") public static boolean isWithinDistance( @DescribeParameter(name = "a", description = "First input geometry") Geometry a, @DescribeParameter(name = "b", description = "Second input geometry") Geometry b, @DescribeParameter( name = "distance", description = "Distance tolerance, in units of the input geometry" ) double distance) { return a.isWithinDistance(b, distance); }
@DescribeParameter( name = "data", description = "Input raster to compute statistics for" @DescribeParameter( name = "band", description = "Source band used to compute statistics (default is 0)", @DescribeParameter( name = "zones", description = "Zone polygon features for which to compute statistics" @DescribeParameter( name = "classification", description =
@DescribeProcess( title = "Intersection", description = "Returns a geometry representing the points that two geometries have in common. The result may be a heterogeneous geometry collection. If no intersection, returns an empty geometry." ) @DescribeResult(description = "Intersection of geometries") public static Geometry intersection( @DescribeParameter(name = "a", description = "First input geometry") Geometry a, @DescribeParameter(name = "b", description = "Second input geometry") Geometry b) { return a.intersection(b); }
@DescribeProcess( title = "Difference", description = "Returns a geometry representing the points that are contained in a geometry but not contained in a second geometry. The result may be a heterogeneous geometry collection." ) @DescribeResult(description = "Geometry representing the difference of the input geometries") public static Geometry difference( @DescribeParameter(name = "a", description = "First input geometry") Geometry a, @DescribeParameter(name = "b", description = "Second input geometry") Geometry b) { return a.difference(b); }
@DescribeProcess( title = "Polygon label process", description = "Calculate the Pole of accessibility, the most distant interior point in a polygon." ) @DescribeResult(description = "Pole of accessibility") public static Geometry PolyLabeller( @DescribeParameter(name = "polygon", description = "Input polygon") Geometry polygon, @DescribeParameter(name = "precision", description = "Tolerance") double tolerance) { return PolyLabeller.getPolylabel(polygon, tolerance); } }
@DescribeProcess(title = "Intersects Test", description = "Tests if two geometries intersect.") @DescribeResult(description = "True if the inputs intersect") public static boolean intersects( @DescribeParameter(name = "a", description = "First input geometry") Geometry a, @DescribeParameter(name = "b", description = "Second input geometry") Geometry b) { return a.intersects(b); }
@DescribeProcess( title = "Touches Test", description = "Tests if two geometries have at least one boundary point in common, but share no interior points." ) @DescribeResult(description = "True if the inputs touch") public static boolean touches( @DescribeParameter(name = "a", description = "First input geometry") Geometry a, @DescribeParameter(name = "b", description = "Second input geometry") Geometry b) { return a.touches(b); }
@DescribeProcess( title = "Distance", description = "Returns the minimum distance between two geometries. Measurement is given in the input units, so geographic coordinates are not recommended." ) @DescribeResult(description = "Distance between the two input geometries") public static double distance( @DescribeParameter(name = "a", description = "First input geometry") Geometry a, @DescribeParameter(name = "b", description = "Second input geometry") Geometry b) { return a.distance(b); }
@DescribeProcess( title = "Disjoint Test", description = "Tests if two geometries do not have any points in common." ) @DescribeResult(description = "True if the inputs are disjoint") public static boolean disjoint( @DescribeParameter(name = "a", description = "First input geometry") Geometry a, @DescribeParameter(name = "b", description = "Second input geometry") Geometry b) { return a.disjoint(b); }
@DescribeProcess( title = "Overlaps Test", description = "Tests if two geometries share some but not all interior points. Points or lines will always return False." ) @DescribeResult(description = "True if the inputs overlap") public static boolean overlaps( @DescribeParameter(name = "a", description = "First input geometry") Geometry a, @DescribeParameter(name = "b", description = "Second input geometry") Geometry b) { return a.overlaps(b); }
@DescribeResult(name = "result", description = "The simplified feature collection") public SimpleFeatureCollection execute( @DescribeParameter(name = "features", description = "Input feature collection") SimpleFeatureCollection features, @DescribeParameter(name = "distance", description = "Simplification distance tolerance") double distance, @DescribeParameter( name = "preserveTopology", description = "If True, ensures that simplified features are topologically valid", defaultValue = "false" ) boolean preserveTopology) throws ProcessException { if (distance < 0) { throw new ProcessException("Invalid distance, it should be a positive number"); } return new SimplifyingFeatureCollection(features, distance, preserveTopology); }
@DescribeProcess( title = "Exactly Equal Test", description = "Tests if two geometries are identical on a vertex-by-vertex basis." ) @DescribeResult(description = "True if the geometries are vertex-identical") public static boolean equalsExact( @DescribeParameter(name = "a", description = "First input geometry") Geometry a, @DescribeParameter(name = "b", description = "Second input geometry") Geometry b) { return a.equalsExact(b); }
@DescribeProcess( title = "Crosses Test", description = "Tests if two geometries have some, but not all, interior points in common." ) @DescribeResult(description = "True if the inputs cross") public static boolean crosses( @DescribeParameter(name = "a", description = "First input geometry") Geometry a, @DescribeParameter(name = "b", description = "Second input geometry") Geometry b) { return a.crosses(b); }
@DescribeProcess( title = "Within Test", description = "Tests if the first geometry is contained in the second geometry." ) @DescribeResult(description = "True if the first input is within the second input") public static boolean within( @DescribeParameter(name = "a", description = "First input geometry") Geometry a, @DescribeParameter(name = "b", description = "Second input geometry") Geometry b) { return a.within(b); }