public WMSCoverageReader(WebMapServer wms, Layer layer, String style) { this.wms = wms; // init the reader addLayer(layer, style); // best guess at the format with a preference for PNG (since it's normally transparent) List<String> formats = wms.getCapabilities().getRequest().getGetMap().getFormats(); this.format = formats.iterator().next(); for (String format : formats) { if ("image/png".equals(format) || "image/png24".equals(format) || "png".equals(format) || "png24".equals(format) || "image/png; mode=24bit".equals(format)) { this.format = format; break; } } }
List<String> formats = getLegendGraphic.getFormats(); if (formats.contains("image/png")) { desiredFormat = "image/png";
public WMSCoverageReader(WebMapServer wms, Layer layer, String style) { this.wms = wms; // init the reader addLayer(layer, style); // best guess at the format with a preference for PNG (since it's normally transparent) List<String> formats = wms.getCapabilities().getRequest().getGetMap().getFormats(); this.format = formats.iterator().next(); for (String format : formats) { if ("image/png".equals(format) || "image/png24".equals(format) || "png".equals(format) || "png24".equals(format) || "image/png; mode=24bit".equals(format)) { this.format = format; break; } } }
public GeneralParameterDescriptor createFormatReadParam() { Map properties = fillProperties("FORMAT", "Value contains the desired format"); GeneralParameterDescriptor param = new DefaultParameterDescriptor(properties, String.class, capabilities.getRequest().getGetMap().getFormats().toArray(new String[capabilities.getRequest().getGetMap().getFormats().size()]), null, null, null, null, true); return param; }
private String getCascadingFormat(WebMapServer server) { // best guess at the format with a preference for PNG (since it's normally transparent) List<String> formats = server.getCapabilities().getRequest().getGetMap().getFormats(); String requestFormat = null; for (String format : formats) { if (format.toLowerCase().contains("image/png") || "png".equalsIgnoreCase(format)) { requestFormat = format; break; } } // if we did not find any format looking like PNG choose any that ImageIO would likely read if (requestFormat == null) { for (String format : formats) { String loFormat = format.toLowerCase(); if (loFormat.contains("jpeg") || loFormat.contains("gif") || loFormat.contains("tif")) { requestFormat = format; break; } } } if (requestFormat == null) { throw new WPSException( "Could not find a suitable WMS cascading format among server supported formats: " + formats); } return requestFormat; }
List<String> formats = getLegendGraphic.getFormats(); if (formats.contains("image/png")) { desiredFormat = "image/png";
/** Returns true if the layer can be queried */ public boolean isQueryable(LayerInfo layer) { try { if (layer.getResource() instanceof WMSLayerInfo) { WMSLayerInfo info = (WMSLayerInfo) layer.getResource(); Layer wl = info.getWMSLayer(null); if (!wl.isQueryable()) { return false; } WMSCapabilities caps = info.getStore().getWebMapServer(null).getCapabilities(); OperationType featureInfo = caps.getRequest().getGetFeatureInfo(); if (featureInfo == null || !featureInfo.getFormats().contains("application/vnd.ogc.gml")) { return false; } } else if (layer.getResource() instanceof WMTSLayerInfo) { return false; } return layer.isQueryable(); } catch (IOException e) { LOGGER.log( Level.INFO, "Failed to determine if the layer is queryable, assuming it's not", e); return false; } }
if (t[j].getFormats() != null) { if (result[1].getFormats() == null) { result[1].setFormats(t[j].getFormats()); } else { List st = result[0].getFormats(); if (t[j].getFormats() == null) { t[j].setFormats(st); } else if (st != null) { t[j].getFormats().addAll(st); if (t[j].getFormats() != null) { if (result[3].getFormats() == null) { result[3].setFormats(t[j] .getFormats()); } else { List st = (List) result[0] .getFormats(); if (t[j].getFormats() == null) { t[j].setFormats(st); } else if (st != null) { ((List) t[j].getFormats()) .addAll(st); if (t[j].getFormats() != null) { if (result[4].getFormats() == null) { result[4].setFormats(t[j] .getFormats());
infoFormats = wms.getCapabilities().getRequest().getGetFeatureInfo().getFormats(); if (!infoFormats.contains("application/vnd.ogc.gml")) { return null;
info.setGetFeatureInfoFormats(operationTypeFeatureInfo.getFormats());
info.setGetFeatureInfoFormats(operationTypeFeatureInfo.getFormats());