org.geotools.arcsde.raster.info
Class RasterUtils

Object
  extended by RasterUtils

public class RasterUtils
extends Object

Since:
2.5.4
Author:
Gabriel Roldan (OpenGeo)
Module:

Method Summary
static ImageTypeSpecifier createFullImageTypeSpecifier(RasterDatasetInfo rasterInfo, int rasterIndex)
           
static MathTransform createRasterToModel(Rectangle levelGridRange, GeneralEnvelope levelEnvelope)
           
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 List<RasterQueryInfo> findMatchingRasters(RasterDatasetInfo rasterInfo, GeneralEnvelope requestedEnvelope, Rectangle 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 Rectangle setMosaicLocations(RasterDatasetInfo rasterInfo, GeneralEnvelope resultEnvelope, 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.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createRasterToModel

public static MathTransform createRasterToModel(Rectangle levelGridRange,
                                                GeneralEnvelope levelEnvelope)

sdeColorMapToJavaColorModel

public static IndexColorModel sdeColorMapToJavaColorModel(DataBuffer colorMapData,
                                                          int bitsPerSample)
Creates an IndexColorModel out of a DataBuffer obtained from an ArcSDE's raster color map.

Parameters:
colorMapData -
Returns:

createFullImageTypeSpecifier

public static ImageTypeSpecifier createFullImageTypeSpecifier(RasterDatasetInfo rasterInfo,
                                                              int rasterIndex)

setMosaicLocations

public static Rectangle setMosaicLocations(RasterDatasetInfo rasterInfo,
                                           GeneralEnvelope resultEnvelope,
                                           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.

Parameters:
rasterInfo -
resultEnvelope -
results -
Returns:

findMatchingRasters

public static List<RasterQueryInfo> findMatchingRasters(RasterDatasetInfo rasterInfo,
                                                        GeneralEnvelope requestedEnvelope,
                                                        Rectangle 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

Parameters:
rasterInfo -
requestedEnvelope -
requestedDim -
overviewPolicy -
Returns:

fitRequestToRaster

public static void fitRequestToRaster(GeneralEnvelope requestedEnvelope,
                                      RasterDatasetInfo rasterInfo,
                                      RasterQueryInfo query)

ensureNoDataPixelIsAvailable

public 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.

Parameters:
colorMap - the raster's native color map the returned one will be based on
Returns:
the same colorMap 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 necessary

determineNoDataValue

public static Number determineNoDataValue(IndexColorModel colorMap)
For a color-mapped raster, the no-data value is set to the transparent pixel

Parameters:
colorMap -
Returns:
the index in the colorMap that's the transparent pixel as is to be used as no-data value

determineNoDataValue

public static Number determineNoDataValue(int numBands,
                                          double statsMin,
                                          double statsMax,
                                          RasterCellType nativeCellType)
Parameters:
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 bands
statsMin - 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 type
Returns:

isGeoPhysics

public static boolean isGeoPhysics(int numBands,
                                   RasterCellType nativeCellType)

determineTargetCellType

public static RasterCellType determineTargetCellType(RasterCellType nativeCellType,
                                                     List<Number> noDataValues)


Copyright © 1996-2010 Geotools. All Rights Reserved.