public class RasterUtils extends Object
Modifier and Type | Method and Description |
---|---|
static ImageTypeSpecifier |
createFullImageTypeSpecifier(RasterDatasetInfo rasterInfo,
int rasterIndex) |
static Number |
determineNoDataValue(IndexColorModel colorMap)
For a color-mapped raster, the no-data value is set to the
transparent pixel |
static Number |
determineNoDataValue(int numBands,
double statsMin,
double statsMax,
RasterCellType nativeCellType) |
static RasterCellType |
determineTargetCellType(RasterCellType nativeCellType,
List<Number> noDataValues) |
static IndexColorModel |
ensureNoDataPixelIsAvailable(IndexColorModel colorMap)
Returns a color model based on
colorMap that's guaranteed to have at least one
transparent pixel whose index can be used as no-data value for colormapped rasters, even if
the returned IndexColorModel needs to be of a higher sample depth (ie, 16 instead of 8 bit)
to satisfy that. |
static RasterQueryInfo |
findLowestResolution(List<RasterQueryInfo> results) |
static List<RasterQueryInfo> |
findMatchingRasters(RasterDatasetInfo rasterInfo,
GeneralEnvelope requestedEnvelope,
GridEnvelope requestedDim,
OverviewPolicy overviewPolicy)
Find out the raster ids and their pyramid levels in the raster dataset for the rasters whose
envelope overlaps the requested one
|
static void |
fitRequestToRaster(GeneralEnvelope requestedEnvelope,
RasterDatasetInfo rasterInfo,
RasterQueryInfo query) |
static boolean |
isGeoPhysics(int numBands,
RasterCellType nativeCellType) |
static IndexColorModel |
sdeColorMapToJavaColorModel(DataBuffer colorMapData,
int bitsPerSample)
Creates an IndexColorModel out of a DataBuffer obtained from an ArcSDE's raster color map.
|
static GridEnvelope |
setMosaicLocations(RasterDatasetInfo rasterInfo,
List<RasterQueryInfo> results)
Given a collection of
RasterQueryInfo instances holding information about how a
request fits for each individual raster composing a catalog, figure out where their resulting
images fit into the overall mosaic that's gonna be the result of the request. |
public static IndexColorModel sdeColorMapToJavaColorModel(DataBuffer colorMapData, int bitsPerSample)
colorMapData
- public static ImageTypeSpecifier createFullImageTypeSpecifier(RasterDatasetInfo rasterInfo, int rasterIndex)
public static GridEnvelope setMosaicLocations(RasterDatasetInfo rasterInfo, List<RasterQueryInfo> results)
RasterQueryInfo
instances holding information about how a
request fits for each individual raster composing a catalog, figure out where their resulting
images fit into the overall mosaic that's gonna be the result of the request.rasterInfo
- resultEnvelope
- results
- public static RasterQueryInfo findLowestResolution(List<RasterQueryInfo> results)
public static List<RasterQueryInfo> findMatchingRasters(RasterDatasetInfo rasterInfo, GeneralEnvelope requestedEnvelope, GridEnvelope requestedDim, OverviewPolicy overviewPolicy)
rasterInfo
- requestedEnvelope
- requestedDim
- overviewPolicy
- public static void fitRequestToRaster(GeneralEnvelope requestedEnvelope, RasterDatasetInfo rasterInfo, RasterQueryInfo query)
public static IndexColorModel ensureNoDataPixelIsAvailable(IndexColorModel colorMap)
colorMap
that's guaranteed to have at least one
transparent pixel whose index can be used as no-data value for colormapped rasters, even if
the returned IndexColorModel needs to be of a higher sample depth (ie, 16 instead of 8 bit)
to satisfy that.colorMap
- the raster's native color map the returned one will be based oncolorMap
if it has a transparent pixel, another, possibly of a
higher depth one if not, containing all the colors from colorMap
and a newly
allocated cell for the transparent pixel if necessarypublic static Number determineNoDataValue(IndexColorModel colorMap)
transparent pixel
colorMap
- public static Number determineNoDataValue(int numBands, double statsMin, double statsMax, RasterCellType nativeCellType)
numBands
- number of bands in the raster dataset for the band whose nodata value is to
be determined. Might be useful to treat special cases where some assumptions are made
depending on the cell type and number of bandsstatsMin
- the minimum sample value for the band as reported by the band's statistics,
or NaN
statsMax
- the maximum sample value for the band as reported by the band's statistics,
or NaN
nativeCellType
- the band's native cell typepublic static boolean isGeoPhysics(int numBands, RasterCellType nativeCellType)
public static RasterCellType determineTargetCellType(RasterCellType nativeCellType, List<Number> noDataValues)
Copyright © 1996–2019 Geotools. All rights reserved.