Package org.geotools.data.ows

Examples of org.geotools.data.ows.WMSCapabilities


    private class WMSResourceInfo extends IGeoResourceInfo {
        @SuppressWarnings("unchecked")
        WMSResourceInfo( IProgressMonitor monitor ) throws IOException {
            WebMapServer wms = service(monitor).getWMS(monitor);
            WMSCapabilities caps = wms.getCapabilities();

            if (layer.getTitle() != null && layer.getTitle().length() != 0) {
                title = layer.getTitle();
            }

            calculateBounds();

            String parentid = service != null && service.getIdentifier() != null ? getIdentifier()
                    .toString() : ""; //$NON-NLS-1$
            name = layer.getName();
            getKeywords(caps, parentid);

            if (layer.get_abstract() != null && layer.get_abstract().length() != 0) {
                description = layer.get_abstract();
            } else {
                description = caps.getService().get_abstract();
            }
            description = caps.getService().get_abstract();

            super.icon = CatalogUIPlugin.getDefault().getImageDescriptor(
                    ISharedImages.GRID_OBJ);

            // icon = fetchIcon( monitor );
View Full Code Here


    private final WMSGeoResourceImpl resource;
    @SuppressWarnings("unchecked")
    WMSGeoResourceInfo( WMSGeoResourceImpl geoResourceImpl, IProgressMonitor monitor ) throws IOException {
        resource = geoResourceImpl;
        WebMapServer wms = resource.service(monitor).getWMS(monitor);
        WMSCapabilities caps = wms.getCapabilities();
       
        bounds = bbox( resource.layer );
        if( bounds == null ){
            bounds = new ReferencedEnvelope( CRS.getEnvelope( DefaultGeographicCRS.WGS84 ) );
        }

        String parentid = resource.service(monitor) != null && resource.service(monitor).getIdentifier() != null ? resource.getIdentifier()
                .toString() : ""; //$NON-NLS-1$
        name = resource.layer.getName();
        List<String> keywordsFromWMS = new ArrayList<String>();
        if (caps.getService().getKeywordList() != null) {
            keywordsFromWMS.addAll(Arrays.asList(caps.getService().getKeywordList()));
        }

        if (resource.layer.getKeywords() != null) {
            keywordsFromWMS.addAll(Arrays.asList(resource.layer.getKeywords()));
        }
        keywordsFromWMS.add("WMS"); //$NON-NLS-1$
        keywordsFromWMS.add(resource.layer.getName());
        keywordsFromWMS.add(caps.getService().getName());
        keywordsFromWMS.add(parentid);
        keywords = keywordsFromWMS.toArray(new String[keywordsFromWMS.size()]);

        if (resource.layer.get_abstract() != null && resource.layer.get_abstract().length() != 0) {
            description = resource.layer.get_abstract();
        } else {
            description = caps.getService().get_abstract();
        }
        description = caps.getService().get_abstract();

        if (resource.layer.getTitle() != null && resource.layer.getTitle().length() != 0) {
            title = resource.layer.getTitle();
        } else {
            title = caps.getService().getTitle();
        }
        super.icon = CatalogUIPlugin.getDefault().getImageDescriptor(
                ISharedImages.GRID_OBJ);
    }
View Full Code Here

    }

    private static void writeLayer( ILayer layer, BufferedWriter out ) throws IOException {
        Layer wmsLayer = layer.getResource( Layer.class, null );
        WebMapServer wms = layer.getResource( WebMapServer.class, null );
        WMSCapabilities caps = wms.getCapabilities();
        String version = caps.getVersion();
       
        String title = wms.getCapabilities().getService().getTitle();
        int hidden = layer.isVisible() ? 1 : 0;
        int info = layer.getInteraction(Interaction.INFO) ? 1 : 0;
        String get = caps.getRequest().getGetCapabilities().getGet().toExternalForm();
System.out.println(get); if (get.endsWith("&")) get = get.substring(0,get.length()-1); //$NON-NLS-1$
        append( 4, out, "<Layer hidden=\""+ hidden +"\" queryable=\""+info+"\">" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        append( 6, out,   "<Server service=\"OGC:WMS\" title=\""+title+"\" version=\""+version+"\">" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        append( 8, out,     "<OnlineResource method=\"GET\" xlink:href=\""+get+"\" xlink:type=\"simple\"/>" ); //$NON-NLS-1$ //$NON-NLS-2$
        append( 6, out,   "</Server>" ); //$NON-NLS-1$
        append( 6, out,   "<Name>"+wmsLayer.getName()+"</Name>"); //$NON-NLS-1$ //$NON-NLS-2$
        append( 6, out,   "<Title>"+wmsLayer.getTitle()+"</Title>");                //$NON-NLS-1$ //$NON-NLS-2$
        if( !Double.isNaN( wmsLayer.getScaleHintMin() ))
            append( 6, out,   "<sld:MinScaleDenominator>"+wmsLayer.getScaleHintMin()+"</sld:MinScaleDenominator>");         //$NON-NLS-1$ //$NON-NLS-2$
        if( !Double.isNaN( wmsLayer.getScaleHintMax() ))
            append( 6, out,   "<sld:MaxScaleDenominator>"+wmsLayer.getScaleHintMax()+"</sld:MaxScaleDenominator>");         //$NON-NLS-1$ //$NON-NLS-2$
        for( String srs : (Set<String>) wmsLayer.getSrs() ){
            append( 6, out,   "<SRS>"+srs+"</SRS>"); //$NON-NLS-1$ //$NON-NLS-2$
        }
        append( 6, out,   "<FormatList>"); //$NON-NLS-1$
       
boolean first = true; // TODO: look up preferences?
for( String format : caps.getRequest().getGetMap().getFormats() ){
    if( first ){
        append( 8, out,     "<Format current=\"1\">"+format+"</Format>");                 //$NON-NLS-1$ //$NON-NLS-2$
        first = false;
    }
        append( 8, out,   "<Format>"+format+"</Format>");     //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

           
            GetMapRequest request = wms.createGetMapRequest();
           
            // put in default exception format we understand as a client
            // (if suppoted by the server)
            WMSCapabilities capabilities = wms.getCapabilities();
            if( capabilities.getRequest().getGetMap().getFormats().contains(GetMapRequest.EXCEPTION_XML) ){
                request.setExceptions(GetMapRequest.EXCEPTION_XML);
            }
            setImageFormat(wms, request);

            if (monitor.isCanceled())
                return;

            double currScale = getContext().getViewportModel().getScaleDenominator();
            List<ILayer> layers = getLayers();
            for( int i = layers.size() - 1; i >= 0; i-- ) {
                ILayer ilayer = layers.get(i);
                Layer layer;
                double minScale = 0;
                double maxScale = Double.MAX_VALUE;
                layer = ilayer.getResource(org.geotools.data.ows.Layer.class, null);
                // check if there are min/max scale rules
                StyleBlackboard sb = (StyleBlackboard) ilayer.getStyleBlackboard();
                Style style = (Style) sb.lookup(Style.class);
                if (style != null) {
                    Rule rule = style.getFeatureTypeStyles()[0].getRules()[0];
                    minScale = rule.getMinScaleDenominator();
                    maxScale = rule.getMaxScaleDenominator();
                }

                if (currScale >= minScale && currScale <= maxScale) {
                    // check for a wms style
                    StyleImpl wmsStyle = (StyleImpl) ilayer.getStyleBlackboard().get(
                            WMSStyleContent.WMSSTYLE);
                    if (wmsStyle != null) {
                        request.addLayer(layer, wmsStyle);
                    } else {
                        request.addLayer(layer);
                    }
                }
            }

            if (monitor.isCanceled())
                return;

            List<Layer> wmsLayers = getWMSLayers();
            if (wmsLayers == null || wmsLayers.isEmpty()){
                endLayerStatus = ILayer.WARNING;
                return;
            }
           
            // figure out request CRS
            CoordinateReferenceSystem viewportCRS = getViewportCRS();
            IMap map = getContext().getMap();
           
            String requestCRScode = findRequestCRS(wmsLayers, viewportCRS, map);
           
            // TODO: make findRequestCRS more efficient (we are running CRS.decode at *least* twice)
            CoordinateReferenceSystem requestCRS = CRS.decode(requestCRScode);

            // figure out viewport
//            ReferencedEnvelope viewport;
//            Envelope viewportBBox = getViewportBBox();
//            CoordinateReferenceSystem viewportCRS = getViewportCRS();
//            if (viewportBBox == null) {
//                // change viewport to world
//                viewportBBox = new Envelope(-180, 180, -90, 90);
//                if (!DefaultGeographicCRS.WGS84.equals(viewportCRS)) { // reproject
//                    viewport = new ReferencedEnvelope(viewportBBox, DefaultGeographicCRS.WGS84);
//                    viewportBBox = viewport.transform(viewportCRS, true);
//                }
//            }


            ReferencedEnvelope requestBBox = null;
            Envelope backprojectedBBox = null; // request bbox projected to the viewport crs
//            viewport = new ReferencedEnvelope(viewportBBox, viewportCRS);
//            requestBBox = calculateRequestBBox(wmsLayers, viewport, requestCRS);
           
            requestBBox = calculateRequestBBox(wmsLayers, bounds, requestCRS, capabilities.getVersion() );

            // check that a request is needed (not out of a bounds, invalid, etc)
            if (requestBBox == NILL_BOX) {
                endLayerStatus = ILayer.WARNING;
                return;
            }
            assert requestBBox.getCoordinateReferenceSystem().equals(requestCRS);

            if (requestBBox.getCoordinateReferenceSystem().equals(viewportCRS)) {
                backprojectedBBox = (Envelope) requestBBox;
            } else {
                backprojectedBBox = (Envelope) requestBBox.transform(viewportCRS, true);
            }

            if (WMSPlugin.isDebugging(Trace.RENDER)) {
                WMSPlugin.trace("Viewport CRS: " + viewportCRS.getName()); //$NON-NLS-1$
                WMSPlugin.trace("Request CRS: " + requestCRS.getName()); //$NON-NLS-1$
                WMSPlugin.trace("Context Image bounds: " + getContext().getImageBounds()); //$NON-NLS-1$
                WMSPlugin.trace("Request BBox  bounds: " + requestBBox); //$NON-NLS-1$
                WMSPlugin.trace("Backprojected request bounds: " + backprojectedBBox); //$NON-NLS-1$
            }

            Service wmsService = capabilities.getService();
            Dimension maxDimensions = new Dimension(wmsService.getMaxWidth(), wmsService
                    .getMaxHeight());
//            Dimension imageDimensions = calculateImageDimensions(getContext().getMapDisplay()
//                    .getDisplaySize(), maxDimensions, getViewportBBox(), backprojectedBBox);
            Dimension imageDimensions = calculateImageDimensions(getContext().getImageSize(), maxDimensions, bounds, backprojectedBBox);
View Full Code Here

    private List<TileLayer> getLayers(WebMapServer wms, String wmsUrl, String urlVersion)
            throws GeoWebCacheException {
        List<TileLayer> layers = new LinkedList<TileLayer>();

        WMSCapabilities capabilities = wms.getCapabilities();
        if (capabilities == null) {
            throw new ConfigurationException("Unable to get capabitilies from " + wmsUrl);
        }

        WMSHttpHelper sourceHelper = new WMSHttpHelper();

        List<Layer> layerList = capabilities.getLayerList();
        Iterator<Layer> layerIter = layerList.iterator();

        while (layerIter.hasNext()) {
            Layer layer = layerIter.next();
            String name = layer.getName();
            String stylesStr = "";

            String title = layer.getTitle();

            String description = layer.get_abstract();

            LayerMetaInformation layerMetaInfo = null;
            if (title != null || description != null) {
                layerMetaInfo = new LayerMetaInformation(title, description, null, null);
            }
            boolean queryable = layer.isQueryable();

            if (name != null) {
                List<StyleImpl> styles = layer.getStyles();

                StringBuffer buf = new StringBuffer();
                if (styles != null) {
                    Iterator<StyleImpl> iter = styles.iterator();
                    boolean hasOne = false;
                    while (iter.hasNext()) {
                        if (hasOne) {
                            buf.append(",");
                        }
                        buf.append(iter.next().getName());
                        hasOne = true;
                    }
                    stylesStr = buf.toString();
                }

                double minX = layer.getLatLonBoundingBox().getMinX();
                double minY = layer.getLatLonBoundingBox().getMinY();
                double maxX = layer.getLatLonBoundingBox().getMaxX();
                double maxY = layer.getLatLonBoundingBox().getMaxY();

                BoundingBox bounds4326 = new BoundingBox(minX, minY, maxX, maxY);

                log.info("Found layer: " + layer.getName() + " with LatLon bbox "
                        + bounds4326.toString());

                BoundingBox bounds3785 = new BoundingBox(longToSphericalMercatorX(minX),
                        latToSphericalMercatorY(minY), longToSphericalMercatorX(maxX),
                        latToSphericalMercatorY(maxY));

                String[] wmsUrls = { wmsUrl };

                LinkedList<ParameterFilter> paramFilters = new LinkedList<ParameterFilter>();
                for (Dimension dimension : layer.getDimensions().values()) {
                    Extent dimExtent = layer.getExtent(dimension.getName());
                    paramFilters.add(new NaiveWMSDimensionFilter(dimension, dimExtent));
                }

                WMSLayer wmsLayer = null;
                try {
                    wmsLayer = getLayer(name, wmsUrls, bounds4326, bounds3785, stylesStr,
                            queryable, layer.getBoundingBoxes(), paramFilters);
                } catch (GeoWebCacheException gwc) {
                    log.error("Error creating " + layer.getName() + ": " + gwc.getMessage());
                }

                if (wmsLayer != null) {

                    // Finalize with some defaults
                    wmsLayer.setCacheBypassAllowed(allowCacheBypass);
                    wmsLayer.setBackendTimeout(backendTimeout);

                    wmsLayer.setMetaInformation(layerMetaInfo);

                    if (urlVersion != null) {
                        wmsLayer.setVersion(urlVersion);
                    } else {
                        String wmsVersion = capabilities.getVersion();
                        if (wmsVersion != null && wmsVersion.length() > 0) {
                            wmsLayer.setVersion(wmsVersion);
                        }
                    }
                    wmsLayer.setSourceHelper(sourceHelper);
View Full Code Here

//        assertNotNull(request);
//
//    }
   
    public void testCreateParser() throws Exception {
        WMSCapabilities capabilities = createCapabilities("1.1.0Capabilities.xml");
        try{
            assertEquals(capabilities.getVersion(), "1.1.0");
            assertEquals(capabilities.getService().getName(), "OGC:WMS");
            assertEquals(capabilities.getService().getTitle(), "GMap WMS Demo Server");
            assertNotNull(capabilities.getService().get_abstract());
            assertEquals(capabilities.getService().getOnlineResource(), new URL("http://dev1.dmsolutions.ca/cgi-bin/mswms_gmap?"));
            assertNull(capabilities.getService().getKeywordList());
           
            assertEquals(capabilities.getRequest().getGetCapabilities().getFormats().size(), 1);
            assertEquals(capabilities.getRequest().getGetCapabilities().getFormats().get(0), "application/vnd.ogc.wms_xml");
            assertEquals(capabilities.getRequest().getGetCapabilities().getGet(), new URL("http://dev1.dmsolutions.ca/cgi-bin/mswms_gmap?"));
            assertEquals(capabilities.getRequest().getGetCapabilities().getPost(), new URL("http://dev1.dmsolutions.ca/cgi-bin/mswms_gmap?"));
           
            assertEquals(capabilities.getRequest().getGetMap().getFormats().size(), 7);
            assertEquals(capabilities.getRequest().getGetMap().getFormats().get(0), "image/gif");
            assertEquals(capabilities.getRequest().getGetMap().getFormats().get(3), "image/wbmp");
            assertEquals(capabilities.getRequest().getGetMap().getFormats().get(6), "image/tiff");
            assertEquals(capabilities.getRequest().getGetMap().getGet(), new URL("http://dev1.dmsolutions.ca/cgi-bin/mswms_gmap?"));
            assertEquals(capabilities.getRequest().getGetMap().getPost(), new URL("http://dev1.dmsolutions.ca/cgi-bin/mswms_gmap?"));
           
            assertEquals(capabilities.getRequest().getGetFeatureInfo().getFormats().size(), 3);
            assertEquals(capabilities.getRequest().getGetFeatureInfo().getFormats().get(0), "text/plain");
            assertEquals(capabilities.getRequest().getGetFeatureInfo().getFormats().get(1), "text/html");
            assertEquals(capabilities.getRequest().getGetFeatureInfo().getFormats().get(2), "application/vnd.ogc.gml");
           
            assertEquals(capabilities.getLayerList().size(), 12);
           
            Layer layer = (Layer) capabilities.getLayerList().get(0);
            assertNull(layer.getParent());
            assertEquals(layer.getName(), "DEMO");
            assertEquals(layer.get_abstract(), "Abstract Test");
            String[] keywords = layer.getKeywords();
            assertNotNull(keywords);
            assertEquals(keywords.length, 2);
            assertEquals(keywords[0], "word1");
            assertEquals(keywords[1], "word2");
            assertEquals(layer.getTitle(), "GMap WMS Demo Server");
            assertEquals(layer.getSrs().size(), 4);
            assertTrue(layer.getSrs().contains("EPSG:42304"));
            assertTrue(layer.getSrs().contains("EPSG:42101"));
            assertTrue(layer.getSrs().contains("EPSG:4269"));
            assertTrue(layer.getSrs().contains("EPSG:4326"));
           
            CRSEnvelope llbbox = layer.getLatLonBoundingBox();
            validateBoundingBox(llbbox, -172.367, 35.6673, -11.5624, 83.8293);
           
           
            assertEquals(layer.getBoundingBoxes().size(), 1);
            assertNotNull(layer.getBoundingBoxes().get("EPSG:42304"));
           
            Layer layer2 = (Layer) capabilities.getLayerList().get(1);
            assertEquals(layer2.getParent(), layer);
            assertEquals(layer2.getName(), "bathymetry");
            assertEquals(layer2.getTitle(), "Elevation/Bathymetry");
            assertTrue(layer2.getSrs().contains("EPSG:42304"));
            assertFalse(layer2.isQueryable());
           
            layer2 = (Layer) capabilities.getLayerList().get(2);
            assertEquals(layer2.getParent(), layer);
            assertEquals(layer2.getName(), "land_fn");
            assertEquals(layer2.getTitle(), "Foreign Lands");
           
            validateBoundingBox(layer2.getLatLonBoundingBox(),
                    -178.838, 31.8844, 179.94, 89.8254);
           
            assertTrue(layer2.getSrs().contains("EPSG:42304"));
            assertFalse(layer2.isQueryable());
            assertNotNull(layer2.getBoundingBoxes().get("EPSG:42304"));
           
            layer2 = (Layer) capabilities.getLayerList().get(3);
            assertEquals(layer2.getParent(), layer);
            assertEquals(layer2.getName(), "park");
            assertEquals(layer2.getTitle(), "Parks");
           
            validateBoundingBox(layer2.getLatLonBoundingBox(),
                    -173.433, 41.4271, -13.3643, 83.7466);
           
            assertTrue(layer2.getSrs().contains("EPSG:42304"));
            assertTrue(layer2.isQueryable());
            assertNotNull(layer2.getBoundingBoxes().get("EPSG:42304"));
           
            layer2 = (Layer) capabilities.getLayerList().get(11);
            assertEquals(layer2.getParent(), layer);
            assertEquals(layer2.getName(), "grid");
            assertEquals(layer2.getTitle(), "Grid");
           
            llbbox = layer2.getLatLonBoundingBox();
View Full Code Here

    }
   
    public void testCreateGetMapRequest() throws Exception {
        try{
            WebMapServer wms = new WebMapServer(server);
            WMSCapabilities caps = wms.getCapabilities();
            GetMapRequest request = wms.createGetMapRequest();
            request.setFormat("image/jpeg");
            //System.out.println(request.getFinalURL().toExternalForm());
           
            String externalForm = request.getFinalURL().toExternalForm();
View Full Code Here

        assertEquals(properties.get("SERVICE"), "WMS");
    }
   
    public void testCreateParser() throws Exception {
        try{
            WMSCapabilities capabilities = createCapabilities("1.3.0Capabilities.xml");
           
            assertNotNull(capabilities);
           
            assertEquals(capabilities.getVersion(), "1.3.0");
            assertEquals(capabilities.getService().getName(), "WMS");
            assertEquals(capabilities.getService().getTitle(), "World Map");
            assertEquals(capabilities.getService().get_abstract(), "None");
            assertEquals(capabilities.getService().getOnlineResource(), new URL("http://www2.demis.nl"));
           
            assertEquals(capabilities.getService().getLayerLimit(), 40);
            assertEquals(capabilities.getService().getMaxWidth(), 2000);
            assertEquals(capabilities.getService().getMaxHeight(), 2000);
           
            assertEquals(capabilities.getRequest().getGetCapabilities().getFormats().get(0), "text/xml");
            assertEquals(capabilities.getRequest().getGetCapabilities().getGet(), new URL("http://www2.demis.nl/wms/wms.asp?wms=WorldMap&"));
            assertEquals(capabilities.getRequest().getGetCapabilities().getPost(), new URL("http://www2.demis.nl/wms/wms.asp?wms=WorldMap&"));
           
            assertEquals(capabilities.getRequest().getGetMap().getFormats().size(), 5);
            assertEquals(capabilities.getRequest().getGetMap().getFormats().get(0), "image/gif");
            assertEquals(capabilities.getRequest().getGetMap().getFormats().get(1), "image/png");
            assertEquals(capabilities.getRequest().getGetMap().getFormats().get(2), "image/jpeg");
            assertEquals(capabilities.getRequest().getGetMap().getFormats().get(3), "image/bmp");
            assertEquals(capabilities.getRequest().getGetMap().getFormats().get(4), "image/swf");
            assertEquals(capabilities.getRequest().getGetMap().getGet(), new URL("http://www2.demis.nl/wms/wms.asp?wms=WorldMap&"));
           
            assertEquals(capabilities.getRequest().getGetFeatureInfo().getFormats().size(), 4);
            assertEquals(capabilities.getRequest().getGetFeatureInfo().getFormats().get(0), "text/xml");
            assertEquals(capabilities.getRequest().getGetFeatureInfo().getFormats().get(1), "text/plain");
            assertEquals(capabilities.getRequest().getGetFeatureInfo().getFormats().get(2), "text/html");
            assertEquals(capabilities.getRequest().getGetFeatureInfo().getFormats().get(3), "text/swf");
            assertEquals(capabilities.getRequest().getGetFeatureInfo().getGet(), new URL("http://www2.demis.nl/wms/wms.asp?wms=WorldMap&"));
           
            Layer topLayer = (Layer) capabilities.getLayerList().get(0);
            assertNotNull(topLayer);
            assertNull(topLayer.getParent());
            assertFalse(topLayer.isQueryable());
            assertEquals(topLayer.getTitle(), "World Map");
            assertEquals(topLayer.getSrs().size(), 1);
            assertTrue(topLayer.getSrs().contains("CRS:84"));
           
            CRSEnvelope llbbox = topLayer.getLatLonBoundingBox();
            assertNotNull(llbbox);
            assertEquals(llbbox.getMinX(), -180, 0.0);
            assertEquals(llbbox.getMaxX(), 180, 0.0);
            assertEquals(llbbox.getMinY(), -90, 0.0);
            assertEquals(llbbox.getMaxY(), 90, 0.0);
           
            assertEquals(topLayer.getBoundingBoxes().size(), 1);
           
            CRSEnvelope bbox = (CRSEnvelope) topLayer.getBoundingBoxes().get("CRS:84");
            assertNotNull(bbox);
            assertEquals(bbox.getEPSGCode(), "CRS:84");
            assertEquals(bbox.getMinX(), -184, 0.0);
            assertEquals(bbox.getMaxX(), 180, 0.0);
            assertEquals(bbox.getMinY(), -90.0000000017335, 0.0);
            assertEquals(bbox.getMaxY(), 90, 0.0);
           
            Layer layer = (Layer) capabilities.getLayerList().get(1);
            assertEquals(layer.getParent(), topLayer);
            assertTrue(layer.isQueryable());
            assertEquals(layer.getName(), "Bathymetry");
            assertEquals(layer.getTitle(), "Bathymetry");
           
            // Added test to verify inheritance, should be same as previous llbbox
            llbbox = topLayer.getLatLonBoundingBox();
            assertNotNull(llbbox);
            assertEquals(llbbox.getMinX(), -180, 0.0);
            assertEquals(llbbox.getMaxX(), 180, 0.0);
            assertEquals(llbbox.getMinY(), -90, 0.0);
            assertEquals(llbbox.getMaxY(), 90, 0.0);
           
            bbox = (CRSEnvelope) layer.getBoundingBoxes().get("CRS:84");
            assertNotNull(bbox);
            assertEquals(bbox.getEPSGCode(), "CRS:84");
            assertEquals(bbox.getMinX(), -180, 0.0);
            assertEquals(bbox.getMaxX(), 180, 0.0);
            assertEquals(bbox.getMinY(), -90, 0.0);
            assertEquals(bbox.getMaxY(), 90, 0.0);
           
            assertEquals(capabilities.getLayerList().size(), 21);
           
            layer = (Layer) capabilities.getLayerList().get(20);
            assertEquals(layer.getParent(), topLayer);
            assertTrue(layer.isQueryable());
            assertEquals(layer.getName(), "Ocean features");
            assertEquals(layer.getTitle(), "Ocean features");
           
View Full Code Here

        }
    }
   
    public void testGEOT4706() {
        try{
            WMSCapabilities capabilities = createCapabilities("envitia-OGC.xml");
           
            assertNotNull(capabilities);
           
            assertEquals(capabilities.getVersion(), "1.3.0");
            assertEquals(capabilities.getService().getName(), "WMS");
           
            Layer topLayer = (Layer) capabilities.getLayerList().get(0);
            assertNotNull(topLayer);
            assertNull(topLayer.getParent());
            assertFalse(topLayer.isQueryable());
            assertEquals(topLayer.getTitle(), "MapRite");
            assertEquals(topLayer.getSrs().size(), 1);
View Full Code Here

   
    public void testCreateGetFeatureInfoRequest() throws Exception {
        try{
            URL featureURL = new URL("http://demo.cubewerx.com/cipi12/cubeserv/cubeserv.cgi?service=wms&request=getcapabilities");
            WebMapServer wms = getCustomWMS(featureURL);
            WMSCapabilities caps = wms.getCapabilities();
            assertNotNull(caps);
            assertNotNull(caps.getRequest().getGetFeatureInfo());
           
            GetMapRequest getMapRequest = wms.createGetMapRequest();
           
            getMapRequest.setProperty(GetMapRequest.LAYERS, "ETOPO2:Foundation");
//        List simpleLayers = getMapRequest.getAvailableLayers();
View Full Code Here

TOP

Related Classes of org.geotools.data.ows.WMSCapabilities

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.