org.geoserver.wms.WMS.getWMSReadParameters()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(194)

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

WMS.getWMSReadParameters介绍

[英]Returns the read parameters for the specified layer, merging some well known request parameters into the read parameters if possible
[中]返回指定层的读取参数,如果可能,将一些已知的请求参数合并到读取参数中

代码示例

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

@Test
public void testTimeDimension() throws Exception {
  MapLayerInfo mapLayerInfo =
      new MapLayerInfo(getCatalog().getLayerByName(WATTEMP_TIME.getLocalPart()));
  final GridCoverage2DReader reader = (GridCoverage2DReader) mapLayerInfo.getCoverageReader();
  GetMapRequest req = new GetMapRequest();
  req.setRawKvp(new HashMap<String, String>());
  req.getRawKvp()
      .put(
          "DIM_" + CustomFormat.CUSTOM_DIMENSION_NAME,
          "2001-05-01T00:00:00.000Z, 2001-05-02T00:00:00.000Z");
  GeneralParameterValue[] readParam =
      wms.getWMSReadParameters(
          req, mapLayerInfo, Filter.INCLUDE, null, null, reader, false);
  @SuppressWarnings("unchecked")
  ParameterValue<List<Date>> val =
      (ParameterValue<List<Date>>) readParam[readParam.length - 1];
  assertEquals(2, val.getValue().size());
  assertEquals(DF.parse("2001-05-01 00:00:00"), val.getValue().get(0));
  assertEquals(DF.parse("2001-05-02 00:00:00"), val.getValue().get(1));
}

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

@Test
public void testCustomDepthIntervalDimension() throws Exception {
  MapLayerInfo mapLayerInfo =
      new MapLayerInfo(getCatalog().getLayerByName(WATTEMP_DEPTH.getLocalPart()));
  final GridCoverage2DReader reader = (GridCoverage2DReader) mapLayerInfo.getCoverageReader();
  GetMapRequest req = new GetMapRequest();
  req.setRawKvp(new HashMap<String, String>());
  req.getRawKvp().put("DIM_" + CustomFormat.CUSTOM_DIMENSION_NAME, "10/50");
  GeneralParameterValue[] readParam =
      wms.getWMSReadParameters(
          req, mapLayerInfo, Filter.INCLUDE, null, null, reader, false);
  @SuppressWarnings("unchecked")
  ParameterValue<List<NumberRange>> val =
      (ParameterValue<List<NumberRange>>) readParam[readParam.length - 1];
  assertEquals(new NumberRange<Double>(Double.class, 10d, 50d), val.getValue().get(0));
}

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

@Test
  public void testCustomDepthListDimension() throws Exception {
    MapLayerInfo mapLayerInfo =
        new MapLayerInfo(getCatalog().getLayerByName(WATTEMP_DEPTH.getLocalPart()));
    final GridCoverage2DReader reader = (GridCoverage2DReader) mapLayerInfo.getCoverageReader();
    GetMapRequest req = new GetMapRequest();
    req.setRawKvp(new HashMap<String, String>());
    req.getRawKvp().put("DIM_" + CustomFormat.CUSTOM_DIMENSION_NAME, "10,50");

    GeneralParameterValue[] readParam =
        wms.getWMSReadParameters(
            req, mapLayerInfo, Filter.INCLUDE, null, null, reader, false);
    @SuppressWarnings("unchecked")
    ParameterValue<List<Double>> val =
        (ParameterValue<List<Double>>) readParam[readParam.length - 1];
    assertEquals(10, (Double) val.getValue().get(0), 1E-6);
    assertEquals(50, (Double) val.getValue().get(1), 1E-6);
  }
}

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

boolean readGeom)
  throws IOException {
return getWMSReadParameters(
    request, mapLayerInfo, layerFilter, null, times, elevations, reader, readGeom);

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

wms.getWMSReadParameters(
    getMap,
    layer,

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

wms.getWMSReadParameters(
    request,
    mapLayerInfo,

相关文章