public List<String> getSupportedFormats() { return delegate.getSupportedFormats(); }
} else if (!responseSRS.equals(other.getResponseSRS())) return false; if (supportedFormats == null) { if (other.getSupportedFormats() != null) return false; } else if (!supportedFormats.equals(other.getSupportedFormats())) return false; if (nativeCoverageName == null) { if (other.getNativeCoverageName() != null) return false;
cinfo.getSupportedFormats().add("GIF"); cinfo.getSupportedFormats().add("PNG"); cinfo.getSupportedFormats().add("JPEG"); cinfo.getSupportedFormats().add("TIFF"); } else if (fName.toLowerCase().startsWith("geotiff")) { cinfo.getSupportedFormats().add("GEOTIFF"); } else { cinfo.getSupportedFormats().add(fName);
coverage.getSupportedFormats().addAll(cInfoReader.supportedFormats());
coverage.getInterpolationMethods().add("Bilinear"); coverage.getParameters().put("ParameterKey", "ParameterValue"); coverage.getSupportedFormats().add("GEOTIFF"); coverage.getRequestSRS().add("EPSG:4326"); coverage.getResponseSRS().add("EPSG:4326");
protected void handleSupportedFormats(CoverageInfo ci) throws Exception { // gather all the formats for this coverage Set<String> formats = new LinkedHashSet<String>(); for (Iterator it = ci.getSupportedFormats().iterator(); it.hasNext(); ) { String format = (String) it.next(); // wcs 1.1 requires mime types, not format names try { CoverageResponseDelegate delegate = responseFactory.encoderFor(format); String formatMime = delegate.getMimeType(format); if (formatMime != null) formats.add(formatMime); } catch (Exception e) { // no problem, we just want to avoid people writing HALLABALOOLA in the // supported formats section of the coverage config and then break the // describe response } } // sort them for (String format : formats) { element("wcs:SupportedFormat", format); } }
/** * DOCUMENT ME! * * @param ci */ private void handleSupportedFormats(CoverageInfo ci) throws Exception { final String nativeFormat = (((ci.getNativeFormat() != null) && ci.getNativeFormat().equalsIgnoreCase("GEOTIFF")) ? "GeoTIFF" : ci.getNativeFormat()); final AttributesImpl attributes = new AttributesImpl(); attributes.addAttribute("", "nativeFormat", "nativeFormat", "", nativeFormat); // gather all the formats for this coverage Set<String> formats = new HashSet<String>(); for (Iterator it = ci.getSupportedFormats().iterator(); it.hasNext(); ) { String format = (String) it.next(); formats.add(format); } // sort them start("wcs:supportedFormats", attributes); List<String> sortedFormats = new ArrayList<String>(formats); Collections.sort(sortedFormats); for (String format : sortedFormats) { element("wcs:formats", format.equalsIgnoreCase("GEOTIFF") ? "GeoTIFF" : format); } end("wcs:supportedFormats"); }
/** * Checks that the elements of the Output part of the request do make sense by comparing them to * the coverage metadata * * @param info * @param rangeSubset */ private void checkOutput(CoverageInfo meta, OutputType output) { if (output == null) return; // check output format String format = output.getFormat().getValue(); String declaredFormat = getDeclaredFormat(meta.getSupportedFormats(), format); if (declaredFormat == null) throw new WcsException( "format " + format + " is not supported for this coverage", InvalidParameterValue, "format"); // check requested CRS // if (output.getCrs() != null) { // String requestedCRS = output.getCrs().getValue(); // if (getRequestResponseCRS(meta.getRequestCRSs(), requestedCRS) == null && // getRequestResponseCRS(meta.getResponseCRSs(), requestedCRS) == null) // throw new WcsException("CRS " + requestedCRS + " is not supported for this coverage", // InvalidParameterValue, "CRS"); // } else { // // The requested CRS was not specified ... what to do ??? // } }
String declaredFormat = getDeclaredFormat(meta.getSupportedFormats(), format); if (declaredFormat == null) throw new WcsException(