org.geoserver.wms.WMS类的使用及代码示例

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

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

WMS介绍

[英]A facade providing access to the WMS configuration details
[中]一个门面,提供对WMS配置细节的访问

代码示例

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

public boolean isQueryable(final GeoServerTileLayer geoServerTileLayer) {
  WMS wmsMediator = WMS.get();
  LayerInfo layerInfo = geoServerTileLayer.getLayerInfo();
  if (layerInfo != null) {
    return wmsMediator.isQueryable(layerInfo);
  }
  LayerGroupInfo lgi = geoServerTileLayer.getLayerGroupInfo();
  return wmsMediator.isQueryable(lgi);
}

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

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

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

@Before
public void setUp() {
  this.reader = new CapabilitiesKvpReader(new WMS(null));
  this.kvp = new HashMap();
  this.rawKvp = new HashMap();
}

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

public boolean isQueryable(LayerGroupInfo layerGroup) {
  if (layerGroup.isQueryDisabled()) return false;
  boolean queryable = false;
  List<PublishedInfo> layers = getLayersForQueryableChecks(layerGroup);
  for (PublishedInfo published : layers) {
    if (published instanceof LayerInfo) {
      queryable |= isQueryable((LayerInfo) published);
    } else {
      queryable |= isQueryable((LayerGroupInfo) published);
    }
  }
  return queryable;
}

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

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

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

@SuppressWarnings("unchecked")
public LayerAuthoritiesAndIdentifiersPanel(final String id, final boolean isRootLayer,
    final IModel<? extends CatalogInfo> layerModel) {
  super(id);
  // authority URLs for the this layer
  IModel<List<AuthorityURLInfo>> authURLsModel;
  authURLsModel = LiveCollectionModel.list(new PropertyModel<List<AuthorityURLInfo>>(
      layerModel, "authorityURLs"));
  AuthorityURLListEditor authUrlEditor = new AuthorityURLListEditor("authorityurls",
      authURLsModel);
  add(authUrlEditor);
  // Layer Identifiers for this layer
  IModel<List<LayerIdentifierInfo>> identifiersModel;
  identifiersModel = LiveCollectionModel.list(new PropertyModel<List<LayerIdentifierInfo>>(
      layerModel, "identifiers"));
  LayerIdentifierListEditor identifiersEditor = new LayerIdentifierListEditor(
      "layerIdentifiers", identifiersModel, authUrlEditor);
  if (!isRootLayer) {
    WMSInfo serviceInfo = WMS.get().getServiceInfo();
    List<AuthorityURLInfo> rootLayerAuthorities = serviceInfo.getAuthorityURLs();
    identifiersEditor.setBaseAuthorities(rootLayerAuthorities);
  }
  add(identifiersEditor);
}

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

public void testSldDisabled() throws Exception {
  HashMap kvp = new HashMap();
  URL url = GetMapKvpRequestReader.class.getResource("BasicPolygonsLibraryDefault.sld");
  String decoded = URLDecoder.decode(url.toExternalForm(), "UTF-8");
  kvp.put("sld", decoded);
  kvp.put(
      "layers",
      MockData.BASIC_POLYGONS.getPrefix() + ":" + MockData.BASIC_POLYGONS.getLocalPart());
  WMS wms = new WMS(getGeoServer());
  WMSInfo oldInfo = wms.getGeoServer().getService(WMSInfo.class);
  WMSInfo info = new WMSInfoImpl();
  info.setDynamicStylingDisabled(Boolean.TRUE);
  getGeoServer().remove(oldInfo);
  getGeoServer().add(info);
  reader = new GetMapKvpRequestReader(wms);
  GetMapRequest request = (GetMapRequest) reader.createRequest();
  boolean error = false;
  try {
    request = (GetMapRequest) reader.read(request, parseKvp(kvp), kvp);
  } catch (ServiceException e) {
    error = true;
  }
  getGeoServer().remove(info);
  getGeoServer().add(oldInfo);
  assertTrue(error);
}

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

public LayersParser() {
  super(WMS.get());
}

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

public GetMapKvpRequestReader(WMS wms) {
  super(GetMapRequest.class);
  this.wms = wms;
  this.entityResolverProvider = new EntityResolverProvider(wms.getGeoServer());
}

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

long maxMemory = wms.getMaxRequestMemory() * KB;
  if (WMSInterpolation.Nearest.equals(wms.getInterpolation())) {
    hintsMap.put(JAI.KEY_INTERPOLATION, NN_INTERPOLATION);
    hintsMap.put(
        RenderingHints.KEY_INTERPOLATION,
        RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
  } else if (WMSInterpolation.Bilinear.equals(wms.getInterpolation())) {
    hintsMap.put(JAI.KEY_INTERPOLATION, BIL_INTERPOLATION);
    hintsMap.put(
        RenderingHints.KEY_INTERPOLATION,
        RenderingHints.VALUE_INTERPOLATION_BILINEAR);
  } else if (WMSInterpolation.Bicubic.equals(wms.getInterpolation())) {
    hintsMap.put(JAI.KEY_INTERPOLATION, BIC_INTERPOLATION);
    hintsMap.put(
if (wms.isAdvancedProjectionHandlingEnabled()) {
  rendererParams.put(StreamingRenderer.ADVANCED_PROJECTION_HANDLING_KEY, true);
  if (wms.isContinuousMapWrappingEnabled()) {
    rendererParams.put(StreamingRenderer.CONTINUOUS_MAP_WRAPPING, true);
int maxErrors = wms.getMaxRenderingErrors();
MaxErrorEnforcer errorChecker = new MaxErrorEnforcer(renderer, maxErrors);
int maxRenderingTime = wms.getMaxRenderingTime(request);
ServiceException serviceException = null;
boolean saveMap =

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

final Version version = WMS.version(request.getVersion());
if (version == null) {
  throw new IllegalArgumentException("version not supplied.");
long geoUS = wms.getUpdateSequence();
if (reqUS > geoUS) {
  throw new ServiceException(
Set<String> legendFormats = wms.getAvailableLegendGraphicsFormats();
  Set<String> mapFormats = wms.getAllowedMapFormatNames();
  List<ExtendedCapabilitiesProvider> extCapsProviders;
  extCapsProviders = wms.getAvailableExtendedCapabilitiesProviders();
  transformer =
      new GetCapabilitiesTransformer(
          wms, baseUrl, mapFormats, legendFormats, extCapsProviders);
} else if (WMS.VERSION_1_3_0.equals(version)) {
  Collection<GetMapOutputFormat> mapFormats = wms.getAllowedMapFormats();
  Collection<ExtendedCapabilitiesProvider> extCapsProviders =
      wms.getAvailableExtendedCapabilitiesProviders();
  transformer =
      new Capabilities_1_3_0_Transformer(wms, baseUrl, mapFormats, extCapsProviders);

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

@Override
  protected boolean skipResource(Object theResource) {
    if (theResource instanceof LayerGroupInfo) {
      LayerGroupInfo groupInfo = (LayerGroupInfo) theResource;
      if (groupInfo.isQueryDisabled()) {
        return true;
      }
    } else if (theResource instanceof LayerInfo) {
      LayerInfo layerInfo = (LayerInfo) theResource;
      if (!wms.isQueryable(layerInfo)) {
        return true;
      }
    } else if (theResource instanceof MapLayerInfo) {
      LayerInfo layerInfo = ((MapLayerInfo) theResource).getLayerInfo();
      if (!wms.isQueryable(layerInfo)) {
        return true;
      }
    }
    return super.skipResource(theResource);
  }
}

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

boolean queryable = wmsConfig.isQueryable(layer);
AttributesImpl qatts = attributes("queryable", queryable ? "1" : "0");
boolean opaque = wmsConfig.isOpaque(layer);
qatts.addAttribute("", "opaque", "opaque", "", opaque ? "1" : "0");
Integer cascadedHopCount = wmsConfig.getCascadedHopCount(layer);
if (cascadedHopCount != null) {
  qatts.addAttribute(

代码示例来源:origin: locationtech/geowave

renderScaleMethodAccurate =
  StreamingRenderer.SCALE_ACCURATE.equals(mapContent.getRendererScaleMethod());
wmsIterpolationOrdinal = wms.getInterpolation().ordinal();
maxErrors = wms.getMaxRenderingErrors();
this.style = style;
envelope = mapContent.getRenderingArea();
advancedProjectionHandlingEnabled = wms.isAdvancedProjectionHandlingEnabled();
final Object advancedProjectionObj =
  request.getFormatOptions().get(WMS.ADVANCED_PROJECTION_KEY);

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

epsgCode = WMS.toInternalSRS(epsgCode, WMS.version(getMap.getVersion()));
getMap.setSRS(epsgCode);
    && wms.isDynamicStylingDisabled()) {
  throw new ServiceException("Dynamic style usage is forbidden");

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

private boolean isWms13FlippedCRS(CoordinateReferenceSystem crs) {
  try {
    String code = CRS.lookupIdentifier(crs, false);
    if (!code.contains("EPSG:")) {
      code = "EPGS:" + code;
    }
    code = WMS.toInternalSRS(code, WMS.version("1.3.0"));
    CoordinateReferenceSystem crs13 = CRS.decode(code);
    return CRS.getAxisOrder(crs13) == AxisOrder.NORTH_EAST;
  } catch (Exception e) {
    LOGGER.log(Level.WARNING, "Failed to determine CRS axis order, assuming is EN", e);
    return false;
  }
}

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

if (byLayerInterpolation == null && wms != null) {
    byServiceInterpolation = wms.getInterpolation();
try {
  final Color readerBgColor = transparent ? null : bgColor;
  if (transformation == null && wms.isAdvancedProjectionHandlingEnabled()) {
            interpolationHints);
    gcr.setAdvancedProjectionHandlingEnabled(true);
    gcr.setWrapEnabled(wms.isContinuousMapWrappingEnabled());

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

@Before
public void internalSetUp() throws IOException {
  this.catalog = getCatalog();
  geosConfig = new GeoServerImpl();
  geosInfo = new GeoServerInfoImpl(geosConfig);
  geosInfo.setContact(new ContactInfoImpl());
  geosConfig.setGlobal(geosInfo);
  wmsInfo = new WMSInfoImpl();
  geosConfig.add(wmsInfo);
  geosConfig.setCatalog(catalog);
  wmsConfig = new WMS(geosConfig);
  wmsConfig.setApplicationContext(applicationContext);
  req = new GetCapabilitiesRequest();
  req.setBaseUrl(baseUrl);
  getTestData()
      .copyTo(
          getClass().getResourceAsStream("/legendURL/BasicPolygons.png"),
          LegendSampleImpl.LEGEND_SAMPLES_FOLDER + "/BasicPolygons.png");
  getTestData()
      .copyTo(
          getClass().getResourceAsStream("/legendURL/Bridges.png"),
          LegendSampleImpl.LEGEND_SAMPLES_FOLDER + "/Bridges.png");
  Map<String, String> namespaces = new HashMap<String, String>();
  namespaces.put("xlink", "http://www.w3.org/1999/xlink");
  namespaces.put("wms", "http://www.opengis.net/wms");
  namespaces.put("ows", "http://www.opengis.net/ows");
  XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));
  XPATH = XMLUnit.newXpathEngine();
}

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

/**
 * Returns a version object for the specified version string.
 * <p>
 * Calls through to {@link #version(String, boolean)} with exact set to <code>false</false>.
 * </p>
 */
public static Version version(String version) {
  return version(version, false);
}

相关文章