org.opengis.coverage.grid.Format.getReadParameters()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(176)

本文整理了Java中org.opengis.coverage.grid.Format.getReadParameters()方法的一些代码示例,展示了Format.getReadParameters()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Format.getReadParameters()方法的具体详情如下:
包路径:org.opengis.coverage.grid.Format
类名称:Format
方法名:getReadParameters

Format.getReadParameters介绍

[英]Retrieve the parameter information for a GridCoverageReader#read operation.
[中]

代码示例

代码示例来源:origin: geoserver/geoserver

/**
 * Utility method for finding Params
 *
 * @param factory DOCUMENT ME!
 * @param key DOCUMENT ME!
 * @return DOCUMENT ME!
 */
public static ParameterValue find(Format format, String key) {
  return find(format.getReadParameters(), key);
}

代码示例来源:origin: geoserver/geoserver

public static Map defaultParams(Format factory) {
  Map defaults = new HashMap();
  ParameterValueGroup params = factory.getReadParameters();

代码示例来源:origin: geoserver/geoserver

@Override
public ParameterValueGroup getReadParameters() {
  HashMap<String, String> info = new HashMap<String, String>();
  info.put("name", getName());
  info.put("description", getDescription());
  info.put("vendor", getVendor());
  info.put("docURL", getDocURL());
  info.put("version", getVersion());
  List<GeneralParameterDescriptor> delegateFormatParams =
      new ArrayList<GeneralParameterDescriptor>();
  delegateFormatParams.addAll(
      delegateFormat.getReadParameters().getDescriptor().descriptors());
  // add bands parameter descriptor only if the delegate reader doesn't have it
  // already
  if (!checkIfDelegateReaderSupportsBands()) {
    delegateFormatParams.add(AbstractGridFormat.BANDS);
  }
  return new ParameterGroup(
      new DefaultParameterDescriptorGroup(
          info,
          delegateFormatParams.toArray(
              new GeneralParameterDescriptor
                  [delegateFormatParams.size()])));
}

代码示例来源:origin: geoserver/geoserver

/** Helper method that checks if the delegate reader support bands selection. */
private boolean checkIfDelegateReaderSupportsBands() {
  List<GeneralParameterDescriptor> parameters =
      delegate.getFormat().getReadParameters().getDescriptor().descriptors();
  for (GeneralParameterDescriptor parameterDescriptor : parameters) {
    if (parameterDescriptor.getName().equals(AbstractGridFormat.BANDS.getName())) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: geoserver/geoserver

int[] getSelectedBandIndexes(GeneralParameterValue[] parameters) {
  // if the delegate cannot do band selection, don't bother
  if (delegate.getFormat() == null
      || !delegate.getFormat()
          .getReadParameters()
          .getDescriptor()
          .descriptors()
          .contains(AbstractGridFormat.BANDS)) {
    return null;
  }
  // lookup the bands if possible
  if (parameters != null) {
    for (int i = 0; i < parameters.length; i++) {
      final ParameterValue param = (ParameterValue) parameters[i];
      if (AbstractGridFormat.BANDS.getName().equals(param.getDescriptor().getName())) {
        int[] bandIndicesParam = (int[]) param.getValue();
        return bandIndicesParam;
      }
    }
  }
  return null;
}

代码示例来源:origin: geoserver/geoserver

reader.read(
    CoverageUtils.getParameters(
        reader.getFormat().getReadParameters(), info.getParameters()));

代码示例来源:origin: geoserver/geoserver

ParameterValueGroup readParameters = format.getReadParameters();
List<GeneralParameterDescriptor> descriptors =
    readParameters.getDescriptor().descriptors();

代码示例来源:origin: geoserver/geoserver

GridEnvelope originalRange = reader.getOriginalGridRange();
Format format = reader.getFormat();
final ParameterValueGroup readParams = format.getReadParameters();
final Map parameters = CoverageUtils.getParametersKVP(readParams);
final int minX = originalRange.getLow(0);

代码示例来源:origin: geoserver/geoserver

final ParameterValueGroup readParams = format.getReadParameters();

代码示例来源:origin: geoserver/geoserver

final ParameterValueGroup readParams = reader.getFormat().getReadParameters();
final Map parameters = CoverageUtils.getParametersKVP(readParams);
double[] minCP = envelope.getLowerCorner().getCoordinate();

代码示例来源:origin: geotools/geotools

/**
 * Checks if band selection is present, and can be delegated down to the reader
 *
 * @param reader
 * @param symbolizer
 * @return
 */
public static boolean isBandsSelectionApplicable(
    GridCoverageReader reader, RasterSymbolizer symbolizer) {
  int[] bandIndices =
      ChannelSelectionUpdateStyleVisitor.getBandIndicesFromSelectionChannels(symbolizer);
  return reader.getFormat() != null
      && reader.getFormat()
          .getReadParameters()
          .getDescriptor()
          .descriptors()
          .contains(AbstractGridFormat.BANDS)
      && bandIndices != null;
}

代码示例来源:origin: geotools/geotools

@SuppressWarnings({"unchecked", "deprecation"})
private void setDefaultParameterValues() {
  final ParameterValueGroup readParams =
      this.rasterManager.parent.getFormat().getReadParameters();
  if (readParams == null) {
    if (LOGGER.isLoggable(Level.FINE))

代码示例来源:origin: geotools/geotools

this.rasterManager.parentReader.getFormat().getReadParameters();
if (readParams == null) {
  if (LOGGER.isLoggable(Level.FINER))

代码示例来源:origin: geotools/geotools

try {
  ParameterValueGroup readerParams = reader.getFormat().getReadParameters();
  ParameterValue<?> bands =
      readerParams.parameter(AbstractGridFormat.BANDS.getName(null));

代码示例来源:origin: org.geoserver/gs-wms

private RasterSymbolizer updateSymbolizerForBandSelection(
    ReadingContext context, RasterSymbolizer symbolizer, int[] bandIndices) {
  GridCoverage2DReader reader = context != null ? context.reader : null;
  Object params = context != null ? context.params : null;
  if (params != null && reader != null && bandIndices != null) {
    Format format = reader.getFormat();
    ParameterValueGroup readParameters = null;
    ParameterDescriptorGroup descriptorGroup = null;
    List<GeneralParameterDescriptor> descriptors = null;
    if (format != null
        && ((readParameters = format.getReadParameters()) != null)
        && ((descriptorGroup = readParameters.getDescriptor()) != null)
        && ((descriptors = descriptorGroup.descriptors()) != null)
        && (descriptors.contains(AbstractGridFormat.BANDS))
        && bandIndices != null) {
      // if bands are selected, alter the symbolizer to use bands in order 0,1,2,...
      // since the channel order defined by it previously is taken care of the reader
      symbolizer = GridCoverageRenderer.setupSymbolizerForBandsSelection(symbolizer);
    }
  }
  return symbolizer;
}

代码示例来源:origin: org.geoserver.security/gs-security-tests

private Format setupFormat() {
    Format format = createNiceMock(Format.class);
    expect(format.getReadParameters())
        .andReturn(new ImageMosaicFormat().getReadParameters())
        .anyTimes();
    EasyMock.replay(format);
    return format;
  }
}

代码示例来源:origin: org.geoserver.community/gs-wps-download

&& reader.getFormat() != null
&& reader.getFormat()
    .getReadParameters()
    .getDescriptor()
    .descriptors()

代码示例来源:origin: org.geoserver.community/gs-wps-download

final ParameterValueGroup readParametersDescriptor = reader.getFormat().getReadParameters();
final List<GeneralParameterDescriptor> parameterDescriptors =
    readParametersDescriptor.getDescriptor().descriptors();

代码示例来源:origin: org.geoserver.extension/wps-core

@DescribeResult(name = "result", description = "Output raster", type = GridCoverage2D.class)
public GridCoverage2D execute(
    @DescribeParameter(name = "name", description = "Name of raster, optionally fully qualified (workspace:name)") String name,
    @DescribeParameter(name = "filter", description = "Filter to use on the raster data", min = 0) Filter filter)
    throws IOException {
  CoverageInfo ci = catalog.getCoverageByName(name);
  if (ci == null) {
    throw new WPSException("Could not find coverage " + name);
  }
  GridCoverageReader reader = ci.getGridCoverageReader(null, null);
  final ParameterValueGroup readParametersDescriptor = reader.getFormat().getReadParameters();
  final List<GeneralParameterDescriptor> parameterDescriptors = readParametersDescriptor
      .getDescriptor().descriptors();
  GeneralParameterValue[] params = new GeneralParameterValue[0];
  if (filter != null) {
    params = CoverageUtils.mergeParameter(parameterDescriptors, params, filter, "FILTER",
        "Filter");
  }
  return (GridCoverage2D) reader.read(params);
}

代码示例来源:origin: org.geoserver.extension/gs-wps-core

final ParameterValueGroup readParametersDescriptor = reader.getFormat().getReadParameters();
final List<GeneralParameterDescriptor> parameterDescriptors =
    readParametersDescriptor.getDescriptor().descriptors();

相关文章