if(!(descriptor instanceof ParameterDescriptor))
continue;
// get name and default value
final ParameterDescriptor desc=(ParameterDescriptor) descriptor;
final ReferenceIdentifier name = desc.getName();
final Object value= desc.getDefaultValue();
// //
//
// Requested GridGeometry2D parameter
//
// //
if (descriptor.getName().equals(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName())) {
if (value == null)
continue;
final GridGeometry2D gg = (GridGeometry2D)value;
spatialRequestHelper.setRequestedGridGeometry(gg);
continue;
}
// //
//
// Use JAI ImageRead parameter
//
// //
if (name.equals(AbstractGridFormat.USE_JAI_IMAGEREAD.getName())) {
if (value == null)
continue;
readType = ((Boolean)value)? ReadType.JAI_IMAGEREAD: ReadType.DIRECT_READ;
continue;
}
// //
//
// Overview Policy parameter
//
// //
if (name.equals(AbstractGridFormat.OVERVIEW_POLICY.getName())) {
if (value == null)
continue;
overviewPolicy = (OverviewPolicy) value;
continue;
}
// //
//
// Decimation Policy parameter
//
// //
if (name.equals(AbstractGridFormat.DECIMATION_POLICY.getName())) {
if (value == null)
continue;
decimationPolicy = (DecimationPolicy) value;
continue;
}
// //
//
// Interpolation parameter
//
// //
if (name.equals(ImageMosaicFormat.INTERPOLATION.getName())) {
if (value == null) {
continue;
}
interpolation = (Interpolation) value;
continue;
}
if (name.equals(AbstractGridFormat.INPUT_TRANSPARENT_COLOR.getName())) {
if(value==null)
continue;
inputTransparentColor = (Color) value;
// paranoiac check on the provided transparent color
inputTransparentColor = new Color(
inputTransparentColor.getRed(),
inputTransparentColor.getGreen(),
inputTransparentColor.getBlue());
continue;
}
if (name.equals(ImageMosaicFormat.FADING.getName())) {
if(value==null)
continue;
blend = ((Boolean) value).booleanValue();
continue;
}
if (name.equals(
ImageMosaicFormat.OUTPUT_TRANSPARENT_COLOR.getName())) {
if(value==null)
continue;
outputTransparentColor = (Color) value;
// paranoiac check on the provided transparent color
outputTransparentColor = new Color(
outputTransparentColor.getRed(),
outputTransparentColor.getGreen(),
outputTransparentColor.getBlue());
continue;
}
if (name.equals(
ImageMosaicFormat.BACKGROUND_VALUES.getName())) {
if(value==null)
continue;
backgroundValues = (double[]) value;
continue;
}
if (name.equals(ImageMosaicFormat.MAX_ALLOWED_TILES.getName())) {
if(value==null)
continue;
maximumNumberOfGranules=(Integer)value;
continue;
}
if (name.equals(ImageMosaicFormat.DEFAULT_ARTIFACTS_FILTER_THRESHOLD.getName())) {
if (value==null)
continue;
defaultArtifactsFilterThreshold =(Integer)value;
continue;
}
if (name.equals(ImageMosaicFormat.ARTIFACTS_FILTER_PTILE_THRESHOLD.getName())) {
if (value==null)
continue;
artifactsFilterPTileThreshold =(Double)value;
continue;
}
if (name.equals(ImageMosaicFormat.ALLOW_MULTITHREADING.getName())) {
if(value==null)
continue;
multithreadingAllowed = ((Boolean) value).booleanValue();
continue;
}
if (name.equals(ImageMosaicFormat.FOOTPRINT_BEHAVIOR.getName())) {
if (value == null)
continue;
footprintBehavior = FootprintBehavior.valueOf((String) value);
continue;
}
// //
//
// Suggested tile size parameter. It must be specified with
// the syntax: "TileWidth,TileHeight" (without quotes where TileWidth
// and TileHeight are integer values)
//
// //
if (name.equals(AbstractGridFormat.SUGGESTED_TILE_SIZE.getName())) {
final String suggestedTileSize = (String) value;
// Preliminary checks on parameter value
if ((suggestedTileSize != null)
&& (suggestedTileSize.trim().length() > 0)) {
if (suggestedTileSize
.contains(AbstractGridFormat.TILE_SIZE_SEPARATOR)) {
final String[] tilesSize = suggestedTileSize
.split(AbstractGridFormat.TILE_SIZE_SEPARATOR);
if (tilesSize.length == 2) {
try {
// Getting suggested tile size
final int tileWidth = Integer.valueOf(tilesSize[0] .trim());
final int tileHeight = Integer.valueOf(tilesSize[1].trim());
tileDimensions= new Dimension(tileWidth,tileHeight);
} catch (NumberFormatException nfe) {
if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.log(Level.WARNING, "Unable to parse "
+ "suggested tile size parameter");
}
}
}
}
}
}
if (name.equals(ImageMosaicFormat.ACCURATE_RESOLUTION.getName())) {
if (value == null)
continue;
accurateResolution = ((Boolean) value).booleanValue();
return;
}