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

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

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

WMS.getServiceInfo介绍

暂无

代码示例

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

/** @see WebMapService#getServiceInfo() */
public WMSInfo getServiceInfo() {
  return wms.getServiceInfo();
}

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

/**
 * If TRUE is returned GetFeatureInfo results should NOT be reproject to the map coordinate
 * reference system.
 *
 * @return GetFeatureInfo results reprojection allowance
 */
public boolean isFeaturesReprojectionDisabled() {
  return getServiceInfo().isFeaturesReprojectionDisabled();
}

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

<T> T getMetadataValue(String key, T defaultValue, Class<T> clazz) {
  if (getServiceInfo() == null) {
    return defaultValue;
  }
  MetadataMap metadata = getServiceInfo().getMetadata();
  T parsedValue = Converters.convert(metadata.get(key), clazz);
  if (parsedValue == null) return defaultValue;
  return parsedValue;
}

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

/**
 * Checks is a getMap mime type is allowed
 *
 * @param format
 */
public boolean isAllowedGetMapFormat(GetMapOutputFormat format) {
  if (getServiceInfo().isGetMapMimeTypeCheckingEnabled() == false) return true;
  Set<String> mimeTypes = getServiceInfo().getGetMapMimeTypes();
  return mimeTypes.contains(format.getMimeType());
}

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

public String getVersion() {
  WMSInfo serviceInfo = getServiceInfo();
  List<Version> versions = serviceInfo.getVersions();
  String version;
  if (versions.size() > 0) {
    version = versions.get(0).toString();
  } else {
    // shouldn't a version be set?
    version = "1.1.1";
  }
  return version;
}

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

public int getJpegCompression() {
  WMSInfo serviceInfo = getServiceInfo();
  return getMetadataPercentage(
      serviceInfo.getMetadata(), JPEG_COMPRESSION, JPEG_COMPRESSION_DEFAULT);
}

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

public int getPngCompression() {
  WMSInfo serviceInfo = getServiceInfo();
  return getMetadataPercentage(
      serviceInfo.getMetadata(), PNG_COMPRESSION, PNG_COMPRESSION_DEFAULT);
}

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

public boolean isSvgAntiAlias() {
  WMSInfo serviceInfo = getServiceInfo();
  Boolean svgAntiAlias =
      Converters.convert(serviceInfo.getMetadata().get("svgAntiAlias"), Boolean.class);
  return svgAntiAlias == null ? true : svgAntiAlias.booleanValue();
}

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

public boolean getKmlKmAttr() {
  Boolean kmAttr =
      Converters.convert(getServiceInfo().getMetadata().get(KML_KMLATTR), Boolean.class);
  return kmAttr == null ? KML_KMLATTR_DEFAULT : kmAttr.booleanValue();
}

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

public boolean getKmlPlacemark() {
  Boolean kmAttr =
      Converters.convert(
          getServiceInfo().getMetadata().get(KML_KMLPLACEMARK), Boolean.class);
  return kmAttr == null ? KML_KMLPLACEMARK_DEFAULT : kmAttr.booleanValue();
}

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

public int getWatermarkPosition() {
  WatermarkInfo watermark = getServiceInfo().getWatermark();
  Position position = watermark.getPosition();
  return position.getCode();
}

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

public void setSvgRenderer(String svgRendererHint) {
  WMSInfo serviceInfo = getServiceInfo();
  serviceInfo.getMetadata().put("svgRenderer", svgRendererHint);
  getGeoServer().save(serviceInfo);
}

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

@Test
public void testRootLayer() throws Exception {
  Document dom = findCapabilities(false);
  WMS wms = getWMS();
  WMSInfo info = wms.getServiceInfo();
  DOMSource domSource = new DOMSource(dom);
  StringWriter writer = new StringWriter();
  StreamResult result = new StreamResult(writer);
  TransformerFactory tf = TransformerFactory.newInstance();
  Transformer transformer = tf.newTransformer();
  transformer.transform(domSource, result);
  assertEquals(writer.toString().contains(info.getRootLayerTitle()), true);
}

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

void addSRSAndSetFlag() {
  WMSInfo wms = getWMS().getServiceInfo();
  wms.getSRS().add("4326");
  wms.getSRS().add("3005");
  wms.getSRS().add("3857");
  wms.setBBOXForEachCRS(true);
  getGeoServer().save(wms);
}

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

void addSRSAndSetFlag() {
  WMSInfo wms = getWMS().getServiceInfo();
  wms.getSRS().add("4326");
  wms.getSRS().add("3005");
  wms.getSRS().add("3857");
  wms.setBBOXForEachCRS(true);
  getGeoServer().save(wms);
}

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

void addSRSAndSetFlag() {
  WMSInfo wms = getWMS().getServiceInfo();
  wms.getSRS().add("4326");
  wms.getSRS().add("3005");
  wms.getSRS().add("3857");
  wms.setBBOXForEachCRS(true);
  getGeoServer().save(wms);
}

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

@After
public void removeSRS() {
  WMSInfo wms = getWMS().getServiceInfo();
  wms.getSRS().remove("4326");
  wms.getSRS().remove("3005");
  wms.getSRS().remove("3857");
  wms.setBBOXForEachCRS(false);
  getGeoServer().save(wms);
}

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

@After
public void removeSRS() {
  WMSInfo wms = getWMS().getServiceInfo();
  wms.getSRS().remove("4326");
  wms.getSRS().remove("3005");
  wms.getSRS().remove("3857");
  wms.setBBOXForEachCRS(false);
  getGeoServer().save(wms);
}

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

@After
public void removeSRS() {
  WMSInfo wms = getWMS().getServiceInfo();
  wms.getSRS().remove("4326");
  wms.getSRS().remove("3005");
  wms.getSRS().remove("3857");
  wms.setBBOXForEachCRS(false);
  getGeoServer().save(wms);
}

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

void addMimeTypes() {
  getMapFormat = new RenderedImageMapOutputFormat(getWMS());
  getInfoFormat = new TextFeatureInfoOutputFormat(getWMS());
  WMSInfo wms = getWMS().getServiceInfo();
  wms.getGetMapMimeTypes().add(getMapFormat.getMimeType());
  wms.getGetFeatureInfoMimeTypes().add(getInfoFormat.getContentType());
  wms.setGetMapMimeTypeCheckingEnabled(true);
  wms.setGetFeatureInfoMimeTypeCheckingEnabled(true);
  getGeoServer().save(wms);
}

相关文章