@Test public void chGetEnvelopeTest() throws Exception { WMTSCapabilities caps = createCapabilities("admin_ch.getcapa.xml"); WebMapTileServer wmts = new WebMapTileServer(caps); Layer layer = (Layer) caps.getLayer("ch.are.alpenkonvention"); assertNotNull(wmts.getEnvelope(layer, CRS.decode("urn:ogc:def:crs:OGC:1.3:CRS84"))); assertNotNull(wmts.getEnvelope(layer, CRS.decode("CRS:84"))); assertNotNull(wmts.getEnvelope(layer, CRS.decode("EPSG:2056"))); assertNotNull(wmts.getEnvelope(layer, CRS.decode("urn:ogc:def:crs:EPSG:2056"))); assertNull(wmts.getEnvelope(layer, CRS.decode("EPSG:4326"))); CoordinateReferenceSystem crs = CRS.decode("CRS:84"); GeneralEnvelope envelope = wmts.getEnvelope(layer, crs); assertNotNull(envelope); assertEquals(45.398181, envelope.getMinimum(1), 0.0001); assertEquals(5.140242, envelope.getMinimum(0), 0.0001); assertEquals(48.230651, envelope.getMaximum(1), 0.0001); assertEquals(11.47757, envelope.getMaximum(0), 0.0001); }
public GeneralEnvelope getEnvelope(Layer layer, CoordinateReferenceSystem crs) { Map<String, CRSEnvelope> boundingBoxes = layer.getBoundingBoxes(); CRSEnvelope box = boundingBoxes.get(crs.getName().getCode()); if (box != null) { return new GeneralEnvelope(box); } for (String key : boundingBoxes.keySet()) { box = boundingBoxes.get(key); if (CRS.equalsIgnoreMetadata(crs, box.getCoordinateReferenceSystem())) { return new GeneralEnvelope(box); } } return null; }
WebMapTileServer extends AbstractOpenWebService<WMTSCapabilities, Layer> { public GeneralEnvelope getEnvelope(Layer layer, CoordinateReferenceSystem crs) { Map<String, CRSEnvelope> boundingBoxes = layer.getBoundingBoxes(); CRSEnvelope box = boundingBoxes.get(crs.getName().getCode()); if (box != null) { return new GeneralEnvelope(box); } for (String key : boundingBoxes.keySet()) { box = boundingBoxes.get(key); if (CRS.equalsIgnoreMetadata(crs, box.getCoordinateReferenceSystem())) { return new GeneralEnvelope(box); } } return null; } }
WebMapTileServer extends AbstractOpenWebService<WMTSCapabilities, Layer> { public GeneralEnvelope getEnvelope(Layer layer, CoordinateReferenceSystem crs) { Map<String, CRSEnvelope> boundingBoxes = layer.getBoundingBoxes(); CRSEnvelope box = boundingBoxes.get(crs.getName().getCode()); if (box != null) { return new GeneralEnvelope(box); } for (String key : boundingBoxes.keySet()) { box = boundingBoxes.get(key); if (CRS.equalsIgnoreMetadata(crs, box.getCoordinateReferenceSystem())) { return new GeneralEnvelope(box); } } return null; } WebMapTileServer(
            URL serverURL,
            HTTPClient httpClient,
            WMTSCapabilities capabilities,
            Map<String, Object> hints);  WebMapTileServer(URL serverURL, HTTPClient httpClient, WMTSCapabilities capabilities);  WebMapTileServer(URL serverURL);  WebMapTileServer(WMTSCapabilities capabilities);  WebMapTileServer(WebMapTileServer delegate); }
WebMapTileServer extends AbstractOpenWebService<WMTSCapabilities, Layer> { public GeneralEnvelope getEnvelope(Layer layer, CoordinateReferenceSystem crs) { Map<String, CRSEnvelope> boundingBoxes = layer.getBoundingBoxes(); CRSEnvelope box = boundingBoxes.get(crs.getName().getCode()); if (box != null) { return new GeneralEnvelope(box); } for (String key : boundingBoxes.keySet()) { box = boundingBoxes.get(key); if (CRS.equalsIgnoreMetadata(crs, box.getCoordinateReferenceSystem())) { return new GeneralEnvelope(box); } } return null; } WebMapTileServer(
            URL serverURL,
            HTTPClient httpClient,
            WMTSCapabilities capabilities,
            Map<String, Object> hints);  WebMapTileServer(URL serverURL, HTTPClient httpClient, WMTSCapabilities capabilities);  WebMapTileServer(URL serverURL);  WebMapTileServer(WMTSCapabilities capabilities);  WebMapTileServer(WebMapTileServer delegate); @Override WMTSCapabilities getCapabilities(); Set<Tile> issueRequest(GetTileRequest tileRequest); GetTileRequest createGetTileRequest(); GetFeatureInfoRequest createGetFeatureInfoRequest(GetTileRequest getmap); GetFeatureInfoResponse issueRequest(GetFeatureInfoRequest request); void setType(WMTSServiceType type); WMTSServiceType getType(); Map<String, String> getHeaders(); GeneralEnvelope getEnvelope(Layer layer, CoordinateReferenceSystem crs); }
WebMapTileServer extends AbstractOpenWebService<WMTSCapabilities, Layer> { public GeneralEnvelope getEnvelope(Layer layer, CoordinateReferenceSystem crs) { Map<String, CRSEnvelope> boundingBoxes = layer.getBoundingBoxes(); CRSEnvelope box = boundingBoxes.get(crs.getName().getCode()); if (box != null) { return new GeneralEnvelope(box); } for (String key : boundingBoxes.keySet()) { box = boundingBoxes.get(key); if (CRS.equalsIgnoreMetadata(crs, box.getCoordinateReferenceSystem())) { return new GeneralEnvelope(box); } } return null; } WebMapTileServer(
            URL serverURL,
            HTTPClient httpClient,
            WMTSCapabilities capabilities,
            Map<String, Object> hints);  WebMapTileServer(URL serverURL, HTTPClient httpClient, WMTSCapabilities capabilities);  WebMapTileServer(URL serverURL);  WebMapTileServer(WMTSCapabilities capabilities);  WebMapTileServer(WebMapTileServer delegate); @Override WMTSCapabilities getCapabilities(); Set<Tile> issueRequest(GetTileRequest tileRequest); GetTileRequest createGetTileRequest(); GetFeatureInfoRequest createGetFeatureInfoRequest(GetTileRequest getmap); GetFeatureInfoResponse issueRequest(GetFeatureInfoRequest request); void setType(WMTSServiceType type); WMTSServiceType getType(); Map<String, String> getHeaders(); GeneralEnvelope getEnvelope(Layer layer, CoordinateReferenceSystem crs);  }