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 Object getValue(Element element, ElementValue[] value, Attributes attrs, Map hints) throws SAXException, OperationNotSupportedException { org.geotools.data.ows.OperationType operationType = new org.geotools.data.ows.OperationType(); for (int i = 0; i < value.length; i++) { if (sameName(elems[0], value[i])) { operationType.setGet((URL) value[i].getValue()); } if (sameName(elems[1], value[i])) { operationType.setPost((URL) value[i].getValue()); } } return operationType; }
.getName())) { if (result[0] == null) { result[0] = new OperationType(); if ((result[0].getGet() == null) && (t[j].getGet() != null)) { result[0].setGet(t[j].getGet()); if ((result[0].getPost() == null) && (t[j].getPost() != null)) { result[0].setPost(t[j].getPost()); .getName())) { if (result[1] == null) { result[1] = new OperationType(); if ((result[1].getGet() == null) && (t[j].getGet() != null)) { result[1].setGet(t[j].getGet()); if ((result[1].getPost() == null) && (t[j].getPost() != null)) { result[1].setPost(t[j].getPost()); if (t[j].getFormats() != null) { if (result[1].getFormats() == null) { result[1].setFormats(t[j].getFormats()); } else { List st = result[0].getFormats();
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { OperationType ret = new OperationType(); ret.setFormats(node.getChildValues("Format")); Iterator dcpTypes = ((List)node.getChildValue("DCPType")).iterator(); while (dcpTypes.hasNext()) { Object[] curOp = (Object[])dcpTypes.next(); if (curOp[0].equals("Get")) { ret.setGet((URL)curOp[1]); } else if (curOp[0].equals("Post")) { ret.setPost((URL)curOp[1]); } } return ret; }
private void determineCorrectStrategy() { URL host = capabilities.getGetCapabilities().getGet(); if (wfsStrategy != null && wfsStrategy.equalsIgnoreCase("mapserver")) { strategy = new MapServerWFSStrategy(this, filterCompliance); } else if (wfsStrategy != null && wfsStrategy.equalsIgnoreCase("geoserver")) { strategy = new NonStrictWFSStrategy(this, filterCompliance); } else if (wfsStrategy != null && wfsStrategy.equalsIgnoreCase("strict")) { strategy = new StrictWFSStrategy(this, filterCompliance); } else if (wfsStrategy != null && wfsStrategy.equalsIgnoreCase("nonstrict")) { strategy = new NonStrictWFSStrategy(this, filterCompliance); } else { if (host == null) { host = capabilities.getGetCapabilities().getPost(); } if (host.toString().indexOf("mapserv") != -1) { strategy = new MapServerWFSStrategy(this, filterCompliance); } else if (host.toString().indexOf("geoserver") != -1) { strategy = new NonStrictWFSStrategy(this, filterCompliance); } else if (lenient) { strategy = new NonStrictWFSStrategy(this, filterCompliance); } else { strategy = new StrictWFSStrategy(this, filterCompliance); } } }
public Object getValue(Element element, ElementValue[] value, Attributes attrs, Map hints) throws SAXException, OperationNotSupportedException { org.geotools.data.ows.OperationType operationType = null; List formatStrings = new ArrayList(); for (int i = 0; i < value.length; i++) { if (sameName(elems[0], value[i])) { Object[] stringValues = (Object[]) value[i].getValue(); for (int ii = 0; ii < stringValues.length; ii++) { formatStrings.add((String) stringValues[ii]); } } if (sameName(elems[1], value[i])) { operationType = (org.geotools.data.ows.OperationType) value[i].getValue(); } } if (operationType != null) { operationType.setFormats(new ArrayList(formatStrings)); } return operationType; }
public Object getValue(Element element, ElementValue[] value, Attributes attrs, Map hints) throws SAXException, OperationNotSupportedException { org.geotools.data.ows.OperationType operationType = null; List formatStrings = new ArrayList(); for (int i = 0; i < value.length; i++) { if (sameName(elems[0], value[i])) { Object[] stringValues = (Object[]) value[i].getValue(); for (int ii = 0; ii < stringValues.length; ii++) { formatStrings.add((String) stringValues[ii]); } } if (sameName(elems[1], value[i])) { operationType = (org.geotools.data.ows.OperationType) value[i].getValue(); } } if (operationType != null) { operationType.setFormats(new ArrayList(formatStrings)); } return operationType; }
OperationType operationType = new OperationType(); operationType.setGet(null); request.setGetCapabilities(operationType); OperationsMetadataType operationsMetadata = caps.getOperationsMetadata(); RequestMethodType get = (RequestMethodType) gets.get(j); try { opt.setGet(new URL(get.getHref())); if (!get.getConstraint().isEmpty()) { for (Object con : get.getConstraint()) { RequestMethodType post = (RequestMethodType) posts.get(j); try { opt.setPost(new URL(post.getHref())); if (!post.getConstraint().isEmpty()) { for (Object con : post.getConstraint()) {
List<String> formats = getLegendGraphic.getFormats(); if (formats.contains("image/png")) { desiredFormat = "image/png";
ot[i].setFormats(sdl);
/** * Creates a new WebMapServer from a WMSCapablitiles document. * * <p>The implementation assumes that the server is located at: * capabilities.getRequest().getGetCapabilities().getGet() * * @param capabilities * @throws IOException * @throws ServiceException */ public WebMapServer(WMSCapabilities capabilities) throws IOException, ServiceException { super(capabilities, capabilities.getRequest().getGetCapabilities().getGet()); }
public Object getValue(Element element, ElementValue[] value, Attributes attrs, Map hints) throws SAXException, OperationNotSupportedException { org.geotools.data.ows.OperationType operationType = new org.geotools.data.ows.OperationType(); for (int i = 0; i < value.length; i++) { if (sameName(elems[0], value[i])) { operationType.setGet((URL) value[i].getValue()); } if (sameName(elems[1], value[i])) { operationType.setPost((URL) value[i].getValue()); } } return operationType; }
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; } } }
ot[i].setFormats(sdl);
/** * The source of this WMS is the capabilities document. * * <p>We make an effort here to look in the capabilities document provided for the * unambiguous capabilities URI. This covers the case where the capabilities document has * been cached on disk and we are restoring a WebMapServer instance. */ public URI getSource() { try { URL source = getCapabilities().getRequest().getGetCapabilities().getGet(); return source.toURI(); } catch (NullPointerException huh) { } catch (URISyntaxException e) { } try { return serverURL.toURI(); } catch (URISyntaxException e) { return null; } }
OperationType c = new OperationType(); .getName())) { c.setGet((URL) value[i].getValue()); .getName())) { c.setPost((URL) value[i].getValue());
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; }