public WebMapServer getWebMapServer(ProgressListener listener) throws IOException { return delegate.getWebMapServer(listener); }
/** * Locates and returns a WMS {@link Layer} based on the configuration stored in WMSLayerInfo * * @param info */ public Layer getWMSLayer(WMSLayerInfo info) throws IOException { // check which actual name we have to use String name = info.getName(); if (info.getNativeName() != null) { name = info.getNativeName(); } WMSCapabilities caps = info.getStore().getWebMapServer(null).getCapabilities(); for (Layer layer : caps.getLayerList()) { if (name.equals(layer.getName())) { return layer; } } throw new IOException( "Could not find layer " + info.getName() + " in the server capabilitiles document"); }
List<String> getAvailableLayersInternal( String workspaceName, String storeName, boolean quietOnNotFound) { NamespaceInfo ns = getNamespaceInternal(workspaceName); Collection<WMSStoreInfo> stores = getStoresInternal(ns, storeName, quietOnNotFound); return stores.stream() .flatMap( store -> { WebMapServer ds; try { ds = store.getWebMapServer(null); } catch (IOException e) { throw new RestException( "Could not load wms store: " + storeName, HttpStatus.INTERNAL_SERVER_ERROR, e); } final List<Layer> layerList = ds.getCapabilities().getLayerList(); return layerList .stream() .map(Layer::getName) .filter(Objects::nonNull) .filter(name -> !name.isEmpty()) .filter(name -> !layerConfigured(store, name)); }) .collect(Collectors.toList()); }
List<Layer> layers = wmsInfo.getWebMapServer(null).getCapabilities().getLayerList(); for (Layer l : layers) { if (l.getName() == null) {
WebMapServer wms = ((WMSStoreInfo) store).getWebMapServer(null); createWMSLayerImportContainer.setVisible(wms != null); } catch (IOException e) {
List<Layer> layers = wmsInfo.getWebMapServer(null).getCapabilities().getLayerList(); for(Layer l : layers) { if(l.getName() == null) {
WebMapServer ds = (WebMapServer) info.getWebMapServer(null);
void updateSpecialFunctionPanels(StoreInfo store) { // at the moment just assume every store can create types createTypeContainer.setVisible(store instanceof DataStoreInfo); // reset to default first, to avoid the container being displayed if store is not a // DataStoreInfo createSQLViewContainer.setVisible(false); if (store instanceof DataStoreInfo) { try { DataAccess da = ((DataStoreInfo) store).getDataStore(null); createSQLViewContainer.setVisible(da instanceof JDBCDataStore); } catch (IOException e) { } } // reset to default first, to avoid the container being displayed if store is not a // WMSStoreInfo createWMSLayerImportContainer.setVisible(false); if (store instanceof WMSStoreInfo) { try { WebMapServer wms = ((WMSStoreInfo) store).getWebMapServer(null); createWMSLayerImportContainer.setVisible(wms != null); } catch (IOException e) { } } }
/** 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; } }
List<Layer> layers = wmsInfo.getWebMapServer(null).getCapabilities().getLayerList(); for(Layer l : layers) { if(l.getName() == null) {
WebMapServer wms = wmsLayer.getStore().getWebMapServer(null); Layer gt2Layer = wmsLayer.getWMSLayer(null);
builder.setStore(store); List<Layer> layers = expandedStore.getWebMapServer(null).getCapabilities().getLayerList(); for (Layer l : layers) { if (l.getName() == null) {
final int y = params.getY(); WMSLayerInfo info = (WMSLayerInfo) params.getLayer().getResource(); WebMapServer wms = info.getStore().getWebMapServer(null); Layer layer = info.getWMSLayer(null);