Package org.geoserver.wms

Examples of org.geoserver.wms.MapLayerInfo


            // search into the remote WFS if there is any
            if (remoteTypeNames.contains(layerName)) {
                SimpleFeatureSource remoteSource;
                remoteSource = remoteWFS.getFeatureSource(layerName);
                if (remoteSource != null) {
                    layersOrGroups.add(new MapLayerInfo(remoteSource));
                    continue;
                }
            }

            // not a remote layer, lets look up for a registered one
View Full Code Here


        // set the content disposition
        StringBuffer filename = new StringBuffer();
        boolean containsRasterData = false;
        boolean isRegionatingFriendly = true;
        for (int i = 0; i < request.getLayers().size(); i++) {
            MapLayerInfo layer = request.getLayers().get(i);
            String name = layer.getName();

            containsRasterData = containsRasterData
                    || (layer.getType() == MapLayerInfo.TYPE_RASTER);

            if (layer.getType() == MapLayerInfo.TYPE_VECTOR) {
                isRegionatingFriendly = isRegionatingFriendly
                        && layer.getFeature().getFeatureSource(null, null).getQueryCapabilities()
                                .isReliableFIDSupported();
            } else if (layer.getType() == MapLayerInfo.TYPE_REMOTE_VECTOR) {
                isRegionatingFriendly = isRegionatingFriendly
                        && layer.getRemoteFeatureSource().getQueryCapabilities()
                                .isReliableFIDSupported();
            }

            // strip off prefix
            int j = name.indexOf(':');
View Full Code Here

    private List<String> styleNames(WMSMapContext mapContext) {
        if (mapContext.getLayerCount() != 1 || mapContext.getRequest() == null)
            return Collections.emptyList();

        MapLayerInfo info = mapContext.getRequest().getLayers().get(0);
        return info.getOtherStyleNames();
    }
View Full Code Here

    //Can't fetch bil for more than 1 layer
    if (reqlayers.size() > 1)
    {
      throw new ServiceException("Cannot combine layers into BIL output");
    }
    MapLayerInfo mapLayerInfo = reqlayers.get(0);
   
    /*
    final ParameterValueGroup writerParams = format.getWriteParameters();
        writerParams.parameter(AbstractGridFormat.GEOTOOLS_WRITE_PARAMS.getName().toString())
                    .setValue(wp);
    */
    GridCoverageReader coverageReader = mapLayerInfo.getCoverageReader();
   
    /*
     * Try to use a gridcoverage style render
     */
    GridCoverage2D subCov = null;
View Full Code Here

        LayerInfo l = createMock(LayerInfo.class);
        expect(l.getResource()).andReturn(r);
        expect(l.getType()).andReturn(LayerInfo.Type.VECTOR);
        replay(l);
       
        return new MapLayerInfo(l);
    }
View Full Code Here

        // Map<String, String> namespaces = new HashMap<String, String>();
        // namespaces.put("atom", "http://purl.org/atom/ns#");
        // XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));

        MapLayerInfo layer = mockData.addFeatureTypeLayer("TestPoints", Point.class);
        WMSMapContext mapContext = new WMSMapContext();
        request = mockData.createRequest();
        request.setLayers(Collections.singletonList(layer));

        request.setFormatOptions(Collections.singletonMap("relLinks", "true"));
View Full Code Here

        final Style style = (Style) request.getStyles().get(0);
        assertNotNull(style);
        assertEquals("TheLibraryModeStyle", style.getName());
        // check the layer
        assertEquals(1, request.getLayers().size());
        MapLayerInfo layer = request.getLayers().get(0);
        assertEquals(getLayerId(MockData.BASIC_POLYGONS), layer.getName());
        // check the filter imposed in the feature type constraint
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        assertEquals(1, layer.getLayerFeatureConstraints().length);
        assertEquals(ff.equals(ff.property("ID"), ff.literal("xyz")),
                layer.getLayerFeatureConstraints()[0].getFilter());
    }
View Full Code Here

        final Style style = (Style) request.getStyles().get(0);
        assertNotNull(style);
        assertEquals("TheLibraryModeStyle", style.getName());
        // check the layer
        assertEquals(1, request.getLayers().size());
        MapLayerInfo layer = request.getLayers().get(0);
        assertEquals(getLayerId(MockData.BASIC_POLYGONS), layer.getName());
        // check the filter imposed in the feature type constraint
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        assertEquals(1, layer.getLayerFeatureConstraints().length);
        assertEquals(ff.equals(ff.property("ID"), ff.literal("xyz")),
                layer.getLayerFeatureConstraints()[0].getFilter());
    }
View Full Code Here

        catalog.add(coverageInfo);
        catalog.add(layerInfo2);

        params.put("LAYERS", "topp:states,topp:fakeCoverage");
        Map<String, Object> kvp = new HashMap<String, Object>(params);
        kvp.put("LAYERS", Arrays.asList(new MapLayerInfo(layerInfo), new MapLayerInfo(layerInfo2)));
        DescribeLayerRequest describeRequest = getRequest(params, kvp);
        assertNotNull(describeRequest);
        assertNotNull(describeRequest.getLayers());
        assertEquals(2, describeRequest.getLayers().size());
    }
View Full Code Here

        transformer.transform(request, writer);
        assertTrue(writer.getBuffer().indexOf(expected) > 0);
    }

    public void testSingleVectorLayer() throws Exception {
        MapLayerInfo mapLayerInfo = new MapLayerInfo(vectorLayerInfo);

        request.addLayer(mapLayerInfo);

        final String serverBaseUrl = "http://geoserver.org";
View Full Code Here

TOP

Related Classes of org.geoserver.wms.MapLayerInfo

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.