@Test public void testPreferedFormatWMSLayerJPEGOnly() throws Exception { MockHttpClient client = new MockHttpClient() { public HTTPResponse get(URL url) throws IOException { if (url.getQuery().contains("GetCapabilities")) { Map<String, String> params = parseParams(url.getQuery()); URL caps = null; if ("1.3.0".equals(params.get("VERSION"))) { caps = WMSCoverageReaderTest.class.getResource( "caps130_jpeg_only.xml"); } return new MockHttpResponse(caps, "text/xml"); } else { throw new IllegalArgumentException( "Don't know how to handle a get request over " + url.toExternalForm()); } } }; WebMapServer jpegOnlyWMSserver = new WebMapServer(new URL("http: Layer[] wmsLayers = WMSUtils.getNamedLayers(jpegOnlyWMSserver.getCapabilities()); WMSLayer l = new WMSLayer(jpegOnlyWMSserver, wmsLayers[0], "", "image/png"); assertTrue(l.getReader().format.equalsIgnoreCase("image/jpeg")); WMSLayer l2 = new WMSLayer(jpegOnlyWMSserver, wmsLayers[0], "", "image/unknown"); assertTrue(l2.getReader().format.equalsIgnoreCase("image/jpeg")); }
public WMSCoverageReader getReader() { return (WMSCoverageReader) this.reader; }
WMSLayer extends GridReaderLayer { public WMSCoverageReader getReader() { return (WMSCoverageReader) this.reader; } }
WMSLayer extends GridReaderLayer { public WMSCoverageReader getReader() { return (WMSCoverageReader) this.reader; } WMSLayer(WebMapServer wms, Layer layer);  WMSLayer(WebMapServer wms, Layer layer, String style);  WMSLayer(WebMapServer wms, Layer layer, String style, String imageFromat); }
WMSLayer extends GridReaderLayer { public WMSCoverageReader getReader() { return (WMSCoverageReader) this.reader; } WMSLayer(WebMapServer wms, Layer layer);  WMSLayer(WebMapServer wms, Layer layer, String style);  WMSLayer(WebMapServer wms, Layer layer, String style, String imageFromat); WMSCoverageReader getReader(); synchronized ReferencedEnvelope getBounds(); String getFeatureInfoAsText(DirectPosition2D pos, int featureCount); InputStream getFeatureInfo(DirectPosition2D pos, String infoFormat, int featureCount); InputStream getFeatureInfo(
            ReferencedEnvelope bbox,
            int width,
            int height,
            int x,
            int y,
            String infoFormat,
            int featureCount); WebMapServer getWebMapServer(); List<Layer> getWMSLayers(); List<String> getWMSStyles(); CoordinateReferenceSystem getCoordinateReferenceSystem(); GetMapRequest getLastGetMap(); void addLayer(Layer layer); void addLayer(Layer layer, String style); boolean isNativelySupported(CoordinateReferenceSystem crs); }
WMSLayer extends GridReaderLayer { public WMSCoverageReader getReader() { return (WMSCoverageReader) this.reader; } WMSLayer(WebMapServer wms, Layer layer);  WMSLayer(WebMapServer wms, Layer layer, String style);  WMSLayer(WebMapServer wms, Layer layer, String style, String imageFromat); WMSCoverageReader getReader(); synchronized ReferencedEnvelope getBounds(); String getFeatureInfoAsText(DirectPosition2D pos, int featureCount); InputStream getFeatureInfo(DirectPosition2D pos, String infoFormat, int featureCount); InputStream getFeatureInfo(
            ReferencedEnvelope bbox,
            int width,
            int height,
            int x,
            int y,
            String infoFormat,
            int featureCount); WebMapServer getWebMapServer(); List<Layer> getWMSLayers(); List<String> getWMSStyles(); CoordinateReferenceSystem getCoordinateReferenceSystem(); GetMapRequest getLastGetMap(); void addLayer(Layer layer); void addLayer(Layer layer, String style); boolean isNativelySupported(CoordinateReferenceSystem crs);  }