parameters.add( new DefaultParameterDescriptor(_key, descr.getValueClass(), null, value) .createValue());
private GeneralParameterValue[] buildFootprintBandParams( FootprintBehavior footprintBehavior, int[] bands) { final List<ParameterValue<?>> parameters = new ArrayList<ParameterValue<?>>(); parameters.add( new DefaultParameterDescriptor<>( AbstractGridFormat.FOOTPRINT_BEHAVIOR.getName().toString(), AbstractGridFormat.FOOTPRINT_BEHAVIOR.getValueClass(), null, footprintBehavior.name()) .createValue()); parameters.add( new DefaultParameterDescriptor<>( AbstractGridFormat.BANDS.getName().toString(), AbstractGridFormat.BANDS.getValueClass(), null, bands) .createValue()); return (GeneralParameterValue[]) parameters.toArray(new GeneralParameterValue[parameters.size()]); }
public void checkBandSelectionResolution( CoverageInfo info, int[] bands, double expectedResolutionX, double expectedResolutionY) throws IOException { GridCoverage2D coverage = null; try { GridCoverage2DReader reader = (GridCoverage2DReader) info.getGridCoverageReader(null, null); ParameterValue<int[]> bandsValue = AbstractGridFormat.BANDS.createValue(); bandsValue.setValue(bands); coverage = reader.read(new GeneralParameterValue[] {bandsValue}); assertNotNull(coverage); assertCoverageResolution(coverage, expectedResolutionX, expectedResolutionY); } finally { getCatalog().remove(info); if (coverage != null) { coverage.dispose(true); } } }
private void setDefaultParameters() { // set the tile size if (layout == null) setTileSize(BaseGDALGridFormat.SUGGESTED_TILE_SIZE.createValue()); }
try { ParameterValue<GridGeometry2D> gg = AbstractGridFormat.READ_GRIDGEOMETRY2D.createValue(); gg.setValue( new GridGeometry2D(
private GeneralParameterValue[] applyBandsSelectionParameter( GridCoverageReader reader, GeneralParameterValue[] readParams, RasterSymbolizer symbolizer) { int[] bandIndices = ChannelSelectionUpdateStyleVisitor.getBandIndicesFromSelectionChannels(symbolizer); Parameter<int[]> bandIndicesParam = null; bandIndicesParam = (Parameter<int[]>) AbstractGridFormat.BANDS.createValue(); bandIndicesParam.setValue(bandIndices); List<GeneralParameterValue> paramList = new ArrayList<GeneralParameterValue>(); if (readParams != null) { paramList.addAll(Arrays.asList(readParams)); } paramList.add(bandIndicesParam); return paramList.toArray(new GeneralParameterValue[paramList.size()]); }
private GeneralParameterValue[] mergeBandParam(GeneralParameterValue[] params, int[] bands) { // is it already there for some reason? if (params != null) { for (GeneralParameterValue param : params) { if (param.getDescriptor().getName().equals(AbstractGridFormat.BANDS.getName())) { ((ParameterValue) param).setValue(bands); return params; } } } // not found, need to add List<GeneralParameterValue> list = new ArrayList<>(params == null ? Collections.emptyList() : Arrays.asList(params)); ParameterValue<int[]> value = AbstractGridFormat.BANDS.createValue(); value.setValue(bands); list.add(value); return list.toArray(new GeneralParameterValue[list.size()]); }
(Parameter<GridGeometry2D>) AbstractGridFormat.READ_GRIDGEOMETRY2D.createValue(); readGGParam.setValue(new GridGeometry2D(gg));
new GridCoverageReaderHelper(reader2, rasterArea, readEnvelope, null); ParameterValue<GridGeometry2D> ggParam = AbstractGridFormat.READ_GRIDGEOMETRY2D.createValue(); ggParam.setValue(new GridGeometry2D(new GridEnvelope2D(rasterArea), readEnvelope)); GridCoverage2D coverage = helper.readCoverage(new GeneralParameterValue[] {ggParam});
private void setDefaultParameters() { // set the tile size if(layout == null) setTileSize(BaseGDALGridFormat.SUGGESTED_TILE_SIZE.createValue()); }
AbstractGridFormat.READ_GRIDGEOMETRY2D.createValue(); readGG.setValue(new GridGeometry2D(new GridEnvelope2D(requestedRasterArea), envelope)); bandIndicesParam = (Parameter<int[]>) AbstractGridFormat.BANDS.createValue(); bandIndicesParam.setValue(bandIndices);
(Parameter<GridGeometry2D>) AbstractGridFormat.READ_GRIDGEOMETRY2D.createValue(); readGGParam.setValue(readGG); (Parameter<OverviewPolicy>) AbstractGridFormat.OVERVIEW_POLICY.createValue(); readOverview.setValue(overviewPolicy);
final ParameterValue<GridGeometry2D> gg = ImageMosaicFormat.READ_GRIDGEOMETRY2D.createValue(); final GeneralEnvelope cropEnvelope = new GeneralEnvelope(new double[] { _minx, _miny }, new double[] { _maxx,_maxy }); cropEnvelope.setCoordinateReferenceSystem(inReader.getCrs());
.createValue(); tileSizeParam.setValue(tileSizes.width + "," + tileSizes.height);
LOGGER.log(Level.WARNING, "GeoTools does not support null CoordinateReferenceSystem!"); final ParameterValue<Boolean> tfw = GeoTiffFormat.WRITE_TFW.createValue(); tfw.setValue(true);
bandIndicesParam = (Parameter<int[]>) AbstractGridFormat.BANDS.createValue(); bandIndicesParam.setValue(bandIndices);
bandIndicesParam = (Parameter<int[]>) AbstractGridFormat.BANDS.createValue(); bandIndicesParam.setValue(bandIndices);
(Parameter<int[]>) AbstractGridFormat.BANDS.createValue(); bandIndicesParam.setValue(bandIndices); List<GeneralParameterValue> paramList = new ArrayList<GeneralParameterValue>();
coverageReader = coverageInfo.getGridCoverageReader(null, null); final ParameterValue<Boolean> useJAI = ImageMosaicFormat.USE_JAI_IMAGEREAD.createValue(); useJAI.setValue(false); sourceCoverage =