public final class FeatureUtilities extends Object
GridCoverage
and Feature
.
Those methods are not really rigorous; must of them should be seen as temporary implementations.Modifier and Type | Field and Description |
---|---|
static FilterFactory2 |
DEFAULT_FILTER_FACTORY |
static PropertyName |
GRID_PROPERTY_NAME |
static PropertyName |
PARAMS_PROPERTY_NAME |
Modifier and Type | Method and Description |
---|---|
static double |
area(Point2D[] polyPoints)
Function to calculate the area of a polygon, according to the algorithm defined at
http://local.wasp.uwa.edu.au/~pbourke/geometry/polyarea/
|
static Polygon |
convertPolygon(Polygon roiInput,
MathTransform worldToGridTransform)
Converts a JTS
Polygon , which represents a ROI, int an AWT Polygon
by means of the provided MathTransform . |
static Polygon |
convertPolygonToPointArray(Polygon roiInput,
MathTransform worldToGridTransform,
List<Point2D> points)
Converts a JTS
Polygon , which represents a ROI, int an AWT Polygon
by means of the provided MathTransform . |
static Polygon |
getPolygon(GeneralEnvelope env,
GeometryFactory gf)
Convert the crop envelope into a polygon and the use the world-to-grid transform to get a ROI
for the source coverage.
|
static Polygon |
getPolygon(Rectangle2D rect,
int srid)
Returns the polygon surrounding the specified rectangle.
|
static boolean |
isWrappedCoverage(SimpleFeatureType featureType)
Checks if the feature type specified is a GridCoverage wrapper
|
static boolean |
isWrappedCoverageReader(SimpleFeatureType featureType)
Checks if the feature type specified is a GridCoverage2DReader wrapper
|
static SimpleFeatureCollection |
wrapGridCoverage(GridCoverage2D coverage)
Wraps a grid coverage into a Feature.
|
static SimpleFeatureCollection |
wrapGridCoverageReader(GridCoverage2DReader gridCoverageReader,
GeneralParameterValue[] params)
Wraps a grid coverage into a Feature.
|
public static final FilterFactory2 DEFAULT_FILTER_FACTORY
public static final PropertyName GRID_PROPERTY_NAME
public static final PropertyName PARAMS_PROPERTY_NAME
public static Polygon getPolygon(Rectangle2D rect, int srid)
public static SimpleFeatureCollection wrapGridCoverage(GridCoverage2D coverage) throws TransformException, SchemaException
coverage
- the grid coverage.TransformException
SchemaException
public static boolean isWrappedCoverage(SimpleFeatureType featureType)
featureType
- public static SimpleFeatureCollection wrapGridCoverageReader(GridCoverage2DReader gridCoverageReader, GeneralParameterValue[] params) throws TransformException, FactoryRegistryException, SchemaException
reader
- the grid coverage reader.TransformException
FactoryRegistryException
SchemaException
public static boolean isWrappedCoverageReader(SimpleFeatureType featureType)
featureType
- public static Polygon convertPolygon(Polygon roiInput, MathTransform worldToGridTransform) throws TransformException
Polygon
, which represents a ROI, int an AWT Polygon
by means of the provided MathTransform
.roiInput
- the input ROI as a JTS Polygon
.worldToGridTransform
- the MathTransform
to apply to the input ROI.Polygon
.TransformException
- in case the provided MathTransform
chokes.public static Polygon convertPolygonToPointArray(Polygon roiInput, MathTransform worldToGridTransform, List<Point2D> points) throws TransformException
Polygon
, which represents a ROI, int an AWT Polygon
by means of the provided MathTransform
.
It also stores the points for this polygon into the provided List
.
roiInput
- the input ROI as a JTS Polygon
.worldToGridTransform
- the MathTransform
to apply to the input ROI.points
- a List
that should hold the transformed points.Polygon
.TransformException
- in case the provided MathTransform
chokes.public static Polygon getPolygon(GeneralEnvelope env, GeometryFactory gf) throws IllegalStateException, MismatchedDimensionException
public static double area(Point2D[] polyPoints)
polyPoints
- array of points in the polygonCopyright © 1996–2019 Geotools. All rights reserved.