Package org.geotools.process.raster
Class CoverageUtilities
- Object
-
- CoverageUtilities
-
public class CoverageUtilities extends Object
A set of utilities methods for the Grid Coverage package. Those methods are not really rigorous; must of them should be seen as temporary implementations.- Author:
- Simone Giannecchini, GeoSolutions
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Number
convert(Number val, Class<? extends Number> type)
static SimpleFeatureType
createFeatureType(GridCoverage2D gc2d, Class<? extends Geometry> geometryClass)
Creates aSimpleFeatureType
that exposes a coverage as a collections of feature points, mapping the centre of each pixel as a point plus all the bands as attributes.static RangeLookupTable
getRangeLookupTable(List<Range> classificationRanges, int[] outputPixelValues, Number noDataValue)
static RangeLookupTable
getRangeLookupTable(List<Range> classificationRanges, int[] outputPixelValues, Number noDataValue, Class<? extends Number> clazz)
static RangeLookupTable
getRangeLookupTable(List<Range> classificationRanges, Number noDataValue)
static RangeLookupTable
getRangeLookupTable(List<Range> classificationRanges, Number noDataValue, Class clazz)
static RangeLookupTable
getRangeLookupTableJAIEXT(List<Range> classificationRanges, int[] outputPixelValues, Number noDataValue, int transferType)
static HashMap<String,Double>
getRegionParamsFromGridCoverage(GridCoverage2D gridCoverage)
Get the parameters of the region covered by thecoverage
.static ROI
prepareROI(Geometry roi, AffineTransform mt2d)
Utility method for transforming a geometry ROI into the raster space, using the provided affine transformation.
-
-
-
Field Detail
-
NORTH
public static final String NORTH
- See Also:
- Constant Field Values
-
SOUTH
public static final String SOUTH
- See Also:
- Constant Field Values
-
WEST
public static final String WEST
- See Also:
- Constant Field Values
-
EAST
public static final String EAST
- See Also:
- Constant Field Values
-
XRES
public static final String XRES
- See Also:
- Constant Field Values
-
YRES
public static final String YRES
- See Also:
- Constant Field Values
-
ROWS
public static final String ROWS
- See Also:
- Constant Field Values
-
COLS
public static final String COLS
- See Also:
- Constant Field Values
-
MINY
public static final String MINY
- See Also:
- Constant Field Values
-
MINX
public static final String MINX
- See Also:
- Constant Field Values
-
-
Method Detail
-
prepareROI
public static ROI prepareROI(Geometry roi, AffineTransform mt2d) throws ProcessException
Utility method for transforming a geometry ROI into the raster space, using the provided affine transformation.- Parameters:
roi
- aGeometry
in model space.mt2d
- anAffineTransform
that maps from raster to model space. This is already referred to the pixel corner.- Returns:
- a
ROI
suitable for using with JAI. - Throws:
ProcessException
- in case there are problems with ivnerting the providedAffineTransform
. Very unlikely to happen.
-
createFeatureType
public static SimpleFeatureType createFeatureType(GridCoverage2D gc2d, Class<? extends Geometry> geometryClass)
Creates aSimpleFeatureType
that exposes a coverage as a collections of feature points, mapping the centre of each pixel as a point plus all the bands as attributes.The FID is the long that combines x+y*width.
- Parameters:
gc2d
- theGridCoverage2D
to wrap.geometryClass
- the class for the geometry.- Returns:
- a
SimpleFeatureType
ornull
in case we are unable to wrap the coverage
-
getRangeLookupTable
public static RangeLookupTable getRangeLookupTable(List<Range> classificationRanges, Number noDataValue)
-
getRangeLookupTable
public static RangeLookupTable getRangeLookupTable(List<Range> classificationRanges, Number noDataValue, Class clazz)
-
getRangeLookupTable
public static RangeLookupTable getRangeLookupTable(List<Range> classificationRanges, int[] outputPixelValues, Number noDataValue)
-
getRangeLookupTable
public static RangeLookupTable getRangeLookupTable(List<Range> classificationRanges, int[] outputPixelValues, Number noDataValue, Class<? extends Number> clazz)
-
getRangeLookupTableJAIEXT
public static RangeLookupTable getRangeLookupTableJAIEXT(List<Range> classificationRanges, int[] outputPixelValues, Number noDataValue, int transferType)
-
getRegionParamsFromGridCoverage
public static HashMap<String,Double> getRegionParamsFromGridCoverage(GridCoverage2D gridCoverage)
Get the parameters of the region covered by thecoverage
.
-
-