org.geotools.arcsde.raster.info
Class RasterUtils

java.lang.Object
  extended by org.geotools.arcsde.raster.info.RasterUtils

public class RasterUtils
extends java.lang.Object

Since:
2.5.4
Version:
$Id: RasterUtils.java 35100 2010-03-23 15:02:18Z groldan $
Author:
Gabriel Roldan (OpenGeo)

Method Summary
static javax.imageio.ImageTypeSpecifier createFullImageTypeSpecifier(RasterDatasetInfo rasterInfo, int rasterIndex)
           
static org.opengis.referencing.operation.MathTransform createRasterToModel(java.awt.Rectangle levelGridRange, GeneralEnvelope levelEnvelope)
           
static java.lang.Number determineNoDataValue(java.awt.image.IndexColorModel colorMap)
          For a color-mapped raster, the no-data value is set to the transparent pixel
static java.lang.Number determineNoDataValue(int numBands, double statsMin, double statsMax, RasterCellType nativeCellType)
           
static RasterCellType determineTargetCellType(RasterCellType nativeCellType, java.util.List<java.lang.Number> noDataValues)
           
static java.awt.image.IndexColorModel ensureNoDataPixelIsAvailable(java.awt.image.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 java.util.List<RasterQueryInfo> findMatchingRasters(RasterDatasetInfo rasterInfo, GeneralEnvelope requestedEnvelope, java.awt.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 java.awt.image.IndexColorModel sdeColorMapToJavaColorModel(java.awt.image.DataBuffer colorMapData, int bitsPerSample)
          Creates an IndexColorModel out of a DataBuffer obtained from an ArcSDE's raster color map.
static java.awt.Rectangle setMosaicLocations(RasterDatasetInfo rasterInfo, GeneralEnvelope resultEnvelope, java.util.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createRasterToModel

public static org.opengis.referencing.operation.MathTransform createRasterToModel(java.awt.Rectangle levelGridRange,
                                                                                  GeneralEnvelope levelEnvelope)

sdeColorMapToJavaColorModel

public static java.awt.image.IndexColorModel sdeColorMapToJavaColorModel(java.awt.image.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 javax.imageio.ImageTypeSpecifier createFullImageTypeSpecifier(RasterDatasetInfo rasterInfo,
                                                                            int rasterIndex)

setMosaicLocations

public static java.awt.Rectangle setMosaicLocations(RasterDatasetInfo rasterInfo,
                                                    GeneralEnvelope resultEnvelope,
                                                    java.util.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 java.util.List<RasterQueryInfo> findMatchingRasters(RasterDatasetInfo rasterInfo,
                                                                  GeneralEnvelope requestedEnvelope,
                                                                  java.awt.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 java.awt.image.IndexColorModel ensureNoDataPixelIsAvailable(java.awt.image.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 java.lang.Number determineNoDataValue(java.awt.image.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 java.lang.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,
                                                     java.util.List<java.lang.Number> noDataValues)


Copyright © 1996-2010 Geotools. All Rights Reserved.