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 (mapContent.layers().size() > 0) {
                    org.geotools.map.Layer lastLayer = mapContent.layers().get(mapContent.layers().size() - 1);
                    if (lastLayer instanceof WMSLayer) {
                        WMSLayer lastWMS = (WMSLayer) lastLayer;
                        WebMapServer otherWMS = lastWMS.getWebMapServer();
                        if (otherWMS.equals(wms)) {
                            lastWMS.addLayer(gt2Layer);
                            merged = true;
                        }
                    }
                }
View Full Code Here


        // 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) {
                LOGGER.log(Level.FINEST, 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

        }
       
        //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

            MapLayerInfo layerInfo) throws Exception {

        final int x = request.getXPixel();
        final int y = request.getYPixel();
        WMSLayerInfo info = (WMSLayerInfo) layerInfo.getResource();
        WebMapServer wms = info.getStore().getWebMapServer(null);
        Layer layer = info.getWMSLayer(null);

        CoordinateReferenceSystem crs = request.getGetMapRequest().getCrs();
        if(crs == null)  {
            // use the native one
            crs = info.getCRS();
        }
        ReferencedEnvelope bbox = new ReferencedEnvelope(request.getGetMapRequest().getBbox(), crs);
        int width = request.getGetMapRequest().getWidth();
        int height = request.getGetMapRequest().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

        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

     * @return the layers described at the given URL
     */
    private synchronized List<TileLayer> getTileLayers(boolean reload) throws GeoWebCacheException {
        List<TileLayer> layers = null;

        WebMapServer wms = getWMS();
        if (wms == null) {
            throw new ConfigurationException("Unable to connect to " + this.url);
        }

        String wmsUrl = getWMSUrl(wms);
View Full Code Here

                metaWidthHeight, this.vendorParameters, queryable, null);
    }

    WebMapServer getWMS() {
        try {
            return new WebMapServer(new URL(url));
        } catch (IOException ioe) {
            log.error(url + " -> " + ioe.getMessage());
        } catch (ServiceException se) {
            log.error(se.getMessage());
        }
View Full Code Here

    public void testDelegateInitializingLayers() throws Exception {
        GridSetBroker broker = new GridSetBroker(false, false);
        String url = "http://test/wms";
        String mimeTypes = "image/png";
       
        final WebMapServer server = createMock(WebMapServer.class);
        WMSCapabilities cap = createMock(WMSCapabilities.class);
        WMSRequest req = createMock(WMSRequest.class);
        OperationType gcOpType = createMock(OperationType.class);
        XMLConfiguration globalConfig = createMock(XMLConfiguration.class);
        Capture<TileLayer> layerCapture = new Capture<TileLayer>();
       
        GetCapabilitiesConfiguration config =
                new GetCapabilitiesConfiguration(broker, url, mimeTypes, "3x3", "false"){

                    @Override
                    WebMapServer getWMS() {
                        return server;
                    }
           
        };
       
        expect(server.getCapabilities()).andStubReturn(cap);
        expect(cap.getRequest()).andStubReturn(req);
        expect(req.getGetCapabilities()).andStubReturn(gcOpType);
        expect(gcOpType.getGet()).andStubReturn(new URL("http://test/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=getcapabilities"));
       
        expect(cap.getVersion()).andStubReturn("1.1.1");
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.