public String getVersion(Name name) { DescribeProcess info = getProcessDescription(name); if (info != null) { return info.version(); } else { return null; } }
@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 = "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); }
@DescribeProcess( title = "Area", description = "Returns the area of a geometry, in the units of the geometry. Assumes a Cartesian plane, so this process is only recommended for non-geographic CRSes." ) @DescribeResult(description = "Area of the input geometry") public static double area( @DescribeParameter(name = "geom", description = "Input geometry") Geometry geom) { return geom.getArea(); }
@DescribeProcess( title = "Centroid", description = "Returns the geometric centroid of a geometry. Output is a single point. The centroid point may be located outside the geometry." ) @DescribeResult(description = "Centroid of the input geometry") public static Geometry centroid( @DescribeParameter(name = "geom", description = "Input geometry") Geometry geom) { return geom.getCentroid(); }
@DescribeProcess( title = "Closed Test", description = "Tests if the initial vertex equals the final vertex in a linear geometry. Points and polygons always return True." ) @DescribeResult(description = "True if the input is closed") public static boolean isClosed( @DescribeParameter(name = "geom", description = "Input geometry") LineString line) { return line.isClosed(); }
@DescribeProcess( title = "End Point", description = "Returns a point geometry equal to the final vertex of a LineString." ) @DescribeResult(description = "Final vertex as point geometry") public static Point endPoint( @DescribeParameter(name = "geom", description = "Input line") LineString line) { return line.getEndPoint(); }
@DescribeProcess( title = "Interior Ring Count", description = "Returns the total number of interior rings in a polygonal geometry. Points and lines return 0." ) @DescribeResult(description = "Total number of interior rings") public static int numInteriorRing( @DescribeParameter(name = "geom", description = "Input geometry") Polygon polygon) { return polygon.getNumInteriorRing(); }
@DescribeProcess( title = "Empty Test", description = "Tests if a geometry contains no vertices." ) @DescribeResult(description = "True if the input is empty") public static boolean isEmpty( @DescribeParameter(name = "geom", description = "Input geometry") Geometry geom) { return geom.isEmpty(); }
@DescribeProcess( title = "Geometry Type", description = "Returns the name of a geometry's type. Values are one of POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION." ) @DescribeResult(description = "The name of the geometry type") public static String geometryType( @DescribeParameter(name = "geom", description = "Input geometry") Geometry geom) { return geom.getGeometryType(); }
@DescribeProcess( title = "Interior Point", description = "Returns a point that lies inside a geometry if possible, or that lies on its boundary." ) @DescribeResult(description = "Interior point") public static Geometry interiorPoint( @DescribeParameter(name = "geom", description = "Input geometry") Geometry geom) { return geom.getInteriorPoint(); }
@DescribeProcess( title = "Dimension", description = "Returns the largest dimension of a geometry or geometry collection: 0 for point, 1 for line, 2 for polygon." ) @DescribeResult(description = "Dimension of the input geometry") public static int dimension( @DescribeParameter(name = "geom", description = "Input geometry") Geometry geom) { return geom.getDimension(); }
@DescribeProcess( title = "Convex Hull", description = "Returns the smallest convex polygon that contains the entire input geometry." ) @DescribeResult(description = "Convex hull of input geometry") public static Geometry convexHull( @DescribeParameter(name = "geom", description = "Input geometry") Geometry geom) { return geom.convexHull(); }
@DescribeProcess( title = "Length", description = "Returns the total length of all line segments in a geometry. Measurement is given in the source units, so geographic coordinates are not recommended." ) @DescribeResult(description = "Total perimeter of the geometry") public static double length( @DescribeParameter(name = "geom", description = "Input geometry") Geometry geom) { return geom.getLength(); }
@DescribeProcess( title = "Boundary", description = "Returns a geometry boundary. For polygons, returns a linear ring or multi-linestring equal to the boundary of the polygon(s). For linestrings, returns a multipoint equal to the endpoints of the linestring. For points, returns an empty geometry collection." ) @DescribeResult(description = "Boundary of the input geometry") public static Geometry boundary( @DescribeParameter(name = "geom", description = "Input geometry") Geometry geom) { return geom.getBoundary(); }