Package org.geotools.data.wms

Examples of org.geotools.data.wms.WebMapServer$LayerInfo


                            "Internal error : unable to get reader for this coverage layer ")
                            .append(mapLayerInfo.toString()).toString());
                }
            } else if (layerType == MapLayerInfo.TYPE_WMS) {
                WMSLayerInfo wmsLayer = (WMSLayerInfo) mapLayerInfo.getResource();
                WebMapServer wms = wmsLayer.getStore().getWebMapServer(null);
                Layer gt2Layer = wmsLayer.getWMSLayer(null);

                // see if we can merge this layer with the previous one
                boolean merged = false;
                if (mapContext.getLayerCount() > 0) {
                    MapLayer lastLayer = mapContext.getLayer(mapContext.getLayerCount() - 1);
                    if (lastLayer instanceof WMSMapLayer) {
                        WMSMapLayer lastWMS = (WMSMapLayer) lastLayer;
                        WebMapServer otherWMS = lastWMS.getWebMapServer();
                        if (otherWMS.equals(wms)) {
                            lastWMS.addLayer(gt2Layer);
                            merged = true;
                        }
                    }
                }
View Full Code Here


            }
        }
       
        if(store instanceof WMSStoreInfo) {
            try {
                WebMapServer wms = ((WMSStoreInfo)store).getWebMapServer(null);
                createWMSLayerImportContainer.setVisible(wms != null);
            } catch (IOException e) {
               
            }
        }
View Full Code Here

        @Override
        protected void onValidate(IValidatable validatable) {
            String url = (String) validatable.getValue();
            try {
                WebMapServer server = new WebMapServer(new URL(url));
                server.getCapabilities();
            } catch(Exception e) {
                error(validatable, "WMSCapabilitiesValidator.connectionFailure",
                        Collections.singletonMap("error", e.getMessage()));
            }
        }
View Full Code Here

                remoteWMSStatesAvailable = Boolean.FALSE;
            } else {
                // let's check if the remote WFS tests are runnable
                try {
                    remoteWMSStatesAvailable = Boolean.FALSE;
                    WebMapServer server = new WebMapServer(new URL(WMS_SERVER_URL + "service=WMS&request=GetCapabilities"), 5000);
                    for(Layer l : server.getCapabilities().getLayerList()) {
                        if("topp:states".equals(l.getName())) {
                            remoteWMSStatesAvailable = Boolean.TRUE;
                            break;
                        }
                    }
View Full Code Here

     * @throws IOException
     */
    public WebMapServer getWebMapServer(WMSStoreInfo info) throws IOException {
        try {
            String id = info.getId();
            WebMapServer wms = wmsCache.get(id);
            if (wms == null) {
                synchronized (wmsCache) {
                    wms = wmsCache.get(id);
                    if (wms == null) {
                        HTTPClient client = getHTTPClient(info);
                        String capabilitiesURL = info.getCapabilitiesURL();
                        URL serverURL = new URL(capabilitiesURL);
                        wms = new WebMapServer(serverURL, client);
                       
                        wmsCache.put(id, wms);
                    }
                }
            }
View Full Code Here

        }
       
        //list of available feature types
        List<String> available = new ArrayList<String>();
        try {
            WebMapServer ds = (WebMapServer) info.getWebMapServer(null);
           
            for ( Layer layer : ds.getCapabilities().getLayerList() ) {
                if(layer.getName() == null || "".equals(layer.getName())) {
                    continue;
                }
                   
                WMSLayerInfo wIinfo = catalog.getResourceByStore(info, layer.getName(), WMSLayerInfo.class);
View Full Code Here

        this.policy = policy;
    }

    @Override
    public WebMapServer getWebMapServer(ProgressListener listener) throws IOException {
        WebMapServer wms = super.getWebMapServer(null);
        if (wms == null)
            return null;
        else if(policy.level == AccessLevel.METADATA)
            throw SecureCatalogImpl.unauthorizedAccess(this.getName());
        else
View Full Code Here

                // try to see if we can connect
                getCatalog().getResourcePool().clear(info);
                // do not call info.getWebMapServer cause it ends up calling
                // resourcepool.getWebMapServer with the unproxied instance (old values)
                //info.getWebMapServer(null).getCapabilities();
                WebMapServer webMapServer = getCatalog().getResourcePool().getWebMapServer(info);
                webMapServer.getCapabilities();
                doSaveStore(info);
            } catch(Exception e) {
                confirmSaveOnConnectionFailure(info, target, e);
            }
        }
View Full Code Here

                String pwd = password.getFormComponent().getInput();
                if (user != null && user.length() > 0 && pwd != null && pwd.length() > 0) {
                    client.setUser(user);
                    client.setPassword(pwd);
                }
                WebMapServer server = new WebMapServer(new URL(url), client);
                server.getCapabilities();
            } catch(Exception e) {
                error(validatable, "WMSCapabilitiesValidator.connectionFailure",
                        Collections.singletonMap("error", e.getMessage()));
            }
        }
View Full Code Here

    public List<FeatureCollection> identify(FeatureInfoRequestParameters params, int maxFeatures) throws IOException {
        final int x = params.getX();
        final int y = params.getY();
        WMSLayerInfo info = (WMSLayerInfo) params.getLayer().getResource();
        WebMapServer wms = info.getStore().getWebMapServer(null);
        Layer layer = info.getWMSLayer(null);

        CoordinateReferenceSystem crs = params.getRequestedCRS();
        if (crs == null) {
            // use the native one
            crs = info.getCRS();
        }
        ReferencedEnvelope bbox = params.getRequestedBounds();
        int width = params.getWidth();
        int height = params.getHeight();

        // we can cascade GetFeatureInfo on queryable layers and if the GML mime type is supported
        if (!layer.isQueryable()) {
            return null;
        }

        List<String> infoFormats;
        infoFormats = wms.getCapabilities().getRequest().getGetFeatureInfo().getFormats();
        if (!infoFormats.contains("application/vnd.ogc.gml")) {
            return null;
        }

        // the wms layer does request in a CRS that's compatible with the WMS server srs
View Full Code Here

TOP

Related Classes of org.geotools.data.wms.WebMapServer$LayerInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.