org.opengis.coverage.grid.Format类的使用及代码示例

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

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

Format介绍

[英]A discovery mechanism to determine the formats supported by a GridCoverageExchangeimplementation. A GridCoverageExchange implementation can support a number of file format or resources.
[中]用于确定GridCoverageExchange实现支持的格式的发现机制。GridCoverageExchange实现可以支持多种文件格式或资源。

代码示例

代码示例来源: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

private GridSampleDimension[] getCoverageSampleDimensions(
    GridCoverage2DReader reader, Map customParameters)
    throws TransformException, IOException, Exception {
  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);
      reader.getOriginalGridToWorld(PixelInCell.CELL_CORNER);
      throw new Exception(
          "Unable to acquire test coverage and image layout for format:"
              + format.getName());
      throw new Exception(
          "Unable to acquire test coverage and color model for format:"
              + format.getName());
      throw new Exception(
          "Unable to acquire test coverage and sample model for format:"
              + format.getName());

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

final ParameterValueGroup writeParameters = writerParams.getWriteParameters();
final ParameterValue<?> format = writeParameters.parameter("Format");
format.setValue(getFileExtension(outputFormat));

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

Format format = delegate.getFormat();
    ParameterValueGroup readParameters = format.getReadParameters();
    List<GeneralParameterDescriptor> descriptors =
        readParameters.getDescriptor().descriptors();
GridCoverage2D grid = delegate.read(parameters);
      JTS.toGeometry((Envelope) new ReferencedEnvelope(grid.getEnvelope2D()));
  if (coverageBounds.intersects(rasterFilter)) {
    final ParameterValueGroup param = cropParams.clone();
    param.parameter("source").setValue(grid);
    param.parameter("ROI").setValue(rasterFilter);
    grid = (GridCoverage2D) coverageCropFactory.doOperation(param, null);

代码示例来源: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: org.geoserver/gs-wcs1_1

final GeneralEnvelope originalEnvelope = reader.getOriginalEnvelope();
final BoundingBoxType bbox = request.getDomainSubset().getBoundingBox();
final CoordinateReferenceSystem nativeCRS =
  requestedEnvelopeInNativeCRS = reader.getOriginalEnvelope();
  requestedEnvelope = requestedEnvelopeInNativeCRS;
  targetCRS = reader.getOriginalEnvelope().getCoordinateReferenceSystem();
} else {
  targetCRS = CRS.decode(gridCRS.getGridBaseCRS());
    reader.getFormat().getReadParameters();
GeneralParameterValue[] readParameters =
    CoverageUtils.getParameters(readParametersDescriptor, meta.getParameters());
    readParametersDescriptor.getDescriptor().descriptors();
ParameterValue time = null;
boolean hasTime = timeValues.size() > 0;

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

final GeneralEnvelope nativeEnvelope = reader.getOriginalEnvelope();
final CoordinateReferenceSystem nativeCRS =
    nativeEnvelope.getCoordinateReferenceSystem();
  targetCRS = reader.getOriginalEnvelope().getCoordinateReferenceSystem();
  requestedCRS = CRS.lookupIdentifier(targetCRS, true);
} else {
    reader.getFormat().getReadParameters();
GeneralParameterValue[] readParameters =
    CoverageUtils.getParameters(readParametersDescriptor, meta.getParameters());
        readParametersDescriptor.getDescriptor().descriptors());
Set<ParameterDescriptor<List>> dynamicParameters = reader.getDynamicParameters();
parameterDescriptors.addAll(dynamicParameters);

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

final CoordinateReferenceSystem coverageCRS = reader.getCoordinateReferenceSystem();
WCSEnvelope subset = request.getSpatialSubset();
List<GridCoverage2D> result = new ArrayList<GridCoverage2D>();
final ParameterValueGroup readParametersDescriptor = reader.getFormat().getReadParameters();
GeneralParameterValue[] readParameters =
    CoverageUtils.getParameters(readParametersDescriptor, cinfo.getParameters());
      readParametersDescriptor.getDescriptor().descriptors();
  List<Object> times = new ArrayList<Object>();
  times.add(request.getTemporalSubset());
      readParametersDescriptor.getDescriptor().descriptors();
  List<Object> elevations = new ArrayList<Object>();
  elevations.add(request.getElevationSubset());
      readParametersDescriptor.getDescriptor().descriptors();
  readParameters =
      CoverageUtils.mergeParameter(

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

(GridCoverage2DReader) coverageInfo.getGridCoverageReader(null, null);
final ParameterValueGroup readParametersDescriptor =
    reader.getFormat().getReadParameters();
final List<GeneralParameterDescriptor> parameterDescriptors =
    readParametersDescriptor.getDescriptor().descriptors();
Map<String, Serializable> coverageParameters = coverageInfo.getParameters();
GeneralParameterValue[] readParameters =
  roiManager.useNativeCRS(reader.getCoordinateReferenceSystem());
  roiManager.useTargetCRS(targetCRS);
  targetEnvelope =
          roiManager.getRoiInTargetCRS().getEnvelopeInternal(), targetCRS);
} else {
  targetEnvelope = new ReferencedEnvelope(reader.getOriginalEnvelope());
  if (reproject) {
    targetEnvelope = targetEnvelope.transform(targetCRS, true);

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

CoordinateReferenceSystem crs = reader.getCoordinateReferenceSystem();
GeneralEnvelope envelope = reader.getOriginalEnvelope();
GeneralEnvelope wgs84envelope = CoverageStoreUtils.getWGS84LonLatEnvelope(envelope);
final String nativeCrsName = CRS.lookupIdentifier(crs, false);
final ParameterValueGroup readParams = reader.getFormat().getReadParameters();
final Map parameters = CoverageUtils.getParametersKVP(readParams);
double[] minCP = envelope.getLowerCorner().getCoordinate();

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

try {
  ParameterValueGroup readerParams = reader.getFormat().getReadParameters();
  ParameterValue<?> bands =
      readerParams.parameter(AbstractGridFormat.BANDS.getName(null));
  if (bands == null) {
    LOGGER.log(Level.FINE, "The reader does not support band selection, reading all");
  ImageLayout layout = r2d.getImageLayout();
  if (layout == null || layout.getSampleModel(null) == null) {
    LOGGER.log(Level.FINE, "Cannot determine the reader bands, reading them all");

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

GeneralEnvelope envelope = reader.getOriginalEnvelope();
CoordinateReferenceSystem nativeCRS = envelope.getCoordinateReferenceSystem();
cinfo.setNativeCRS(nativeCRS);
    new ReferencedEnvelope(CoverageStoreUtils.getWGS84LonLatEnvelope(envelope)));
GridEnvelope originalRange = reader.getOriginalGridRange();
cinfo.setGrid(
    new GridGeometry2D(
        originalRange,
        reader.getOriginalGridToWorld(PixelInCell.CELL_CENTER),
        nativeCRS));
final ParameterValueGroup readParams = format.getReadParameters();
    new StringBuilder("Generated from ").append(format.getName()).toString());
cinfo.getKeywords().add(new Keyword(format.getName()));
cinfo.setNativeFormat(format.getName());
cinfo.getMetadata()
    .put(
for (Iterator i = formats.iterator(); i.hasNext(); ) {
  final Format fTmp = (Format) i.next();
  final String fName = fTmp.getName();

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

ParameterValue time = reader.getFormat().getReadParameters().parameter(
    "TIME");
if (time != null && request.getTime() != null) {
ParameterValue elevation = reader.getFormat().getReadParameters()
    .parameter("ELEVATION");
if (elevation != null && request.getElevation() != null) {
  elevation.setValue(request.getElevation().intValue());
    .getReadParameters();

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

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

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

public static Map defaultParams(Format factory) {
  Map defaults = new HashMap();
  ParameterValueGroup params = factory.getReadParameters();
    List list = params.values();
    Iterator it = list.iterator();
    ParameterDescriptor descr = null;

代码示例来源: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: org.geoserver/gs-restconfig

info.setType(coverageFormat.getName());
URL uploadedFileURL = URLs.fileToUrl(Resources.find(uploadedFile));
if (method.isInline()) {
  String[] names = reader.getGridCoverageNames();
  if (names.length > 1 && coverageName != null) {
    throw new RestException(
  if (reader != null) {
    try {
      reader.dispose();
    } catch (IOException e) {

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

@Override
public String getName() {
  return delegateFormat.getName();
}

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

@Override
  public String getDescription() {
    return delegateFormat.getDescription();
  }
};

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

@Override
public ParameterValueGroup getWriteParameters() {
  return delegateFormat.getWriteParameters();
}

相关文章