* gather all the colormaps once and held them here by rasterband id
*/
final Map<Long, IndexColorModel> rastersColorMaps;
{
final SeRasterColumn rasterColumn;
final SeRasterBand sampleBand;
final long rasterColumnId;
final int bitsPerSample;
try {
SeRasterAttr ratt = rasterAttributes.get(0);
rasterColumn = new SeRasterColumn(connection, ratt.getRasterColumnId());
rasterColumnId = rasterColumn.getID().longValue();
sampleBand = ratt.getBands()[0];
bitsPerSample = RasterCellType.valueOf(ratt.getPixelType()).getBitsPerSample();
} catch (SeException e) {
throw new ArcSdeException(e);
}
final SeCoordinateReference seCoordRef = rasterColumn.getCoordRef();
if (seCoordRef == null) {
throw new IllegalArgumentException(rasterTableName
+ " has no coordinate reference system set");
}
LOGGER.finer("Looking CRS for raster column " + rasterTableName);
coverageCrs = ArcSDEUtils.findCompatibleCRS(seCoordRef);
if (DefaultEngineeringCRS.CARTESIAN_2D == coverageCrs) {
LOGGER.warning("Raster " + rasterTableName
+ " has not CRS set, using DefaultEngineeringCRS.CARTESIAN_2D");
}
if (sampleBand.hasColorMap()) {
rastersColorMaps = loadColorMaps(rasterColumnId, bitsPerSample, connection);
} else {
rastersColorMaps = Collections.emptyMap();
}