Package org.geoserver.wms

Examples of org.geoserver.wms.MapLayerInfo


        assertXpathExists(layerDescPath + "/Query", dom);
        assertXpathEvaluatesTo("geos:states", layerDescPath + "/Query/@typeName", dom);
    }

    public void testSingleRasterLayer() throws Exception {
        MapLayerInfo mapLayerInfo = new MapLayerInfo(coverageLayerInfo);

        request.addLayer(mapLayerInfo);

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


        assertXpathExists(layerDescPath + "/Query", dom);
        assertXpathEvaluatesTo("geos:fakeCoverage", layerDescPath + "/Query/@typeName", dom);
    }

    public void testMultipleLayers() throws Exception {
        request.addLayer(new MapLayerInfo(vectorLayerInfo));
        request.addLayer(new MapLayerInfo(coverageLayerInfo));

        final String serverBaseUrl = "http://geoserver.org";

        transformer = new DescribeLayerTransformer(serverBaseUrl);
        final Document dom = WMSTestSupport.transform(request, transformer);
View Full Code Here

    private FeatureLayer getLayer(FeatureInfoRequestParameters params, Style style) throws IOException {
        // build the full filter
        List<Object> times = params.getTimes();
        List<Object> elevations = params.getElevations();
        Filter layerFilter = params.getFilter();
        MapLayerInfo layer = params.getLayer();
        Filter dimensionFilter = wms.getTimeElevationToFilter(times, elevations, layer.getFeature());
        Filter filter;
        if(layerFilter == null) {
            filter = dimensionFilter;
        } else if(dimensionFilter == null) {
            filter = layerFilter;
        } else {
            filter = FF.and(Arrays.asList(layerFilter, dimensionFilter));
        }

        GetMapRequest getMap = params.getGetMapRequest();
        FeatureSource<? extends FeatureType, ? extends Feature> featureSource = layer
                .getFeatureSource(true);
        final Query definitionQuery = new Query(featureSource.getSchema().getName().getLocalPart());
        definitionQuery.setVersion(getMap.getFeatureVersion());
        definitionQuery.setFilter(filter);
        Map<String, String> viewParams = params.getViewParams();
        if (viewParams != null) {
            definitionQuery.setHints(new Hints(Hints.VIRTUAL_TABLE_PARAMETERS, viewParams));
        }

        // check for startIndex + offset
        final Integer startIndex = getMap.getStartIndex();
        if (startIndex != null) {
            QueryCapabilities queryCapabilities = featureSource.getQueryCapabilities();
            if (queryCapabilities.isOffsetSupported()) {
                // fsource is required to support
                // SortBy.NATURAL_ORDER so we don't bother checking
                definitionQuery.setStartIndex(startIndex);
            } else {
                // source = new PagingFeatureSource(source,
                // request.getStartIndex(), limit);
                throw new ServiceException("startIndex is not supported for the " + layer.getName()
                        + " layer");
            }
        }

        int maxFeatures = getMap.getMaxFeatures() != null ? getMap.getMaxFeatures()
View Full Code Here

            final List<Layer> mapLayers = context.layers();
            final List<MapLayerInfo> layerInfos = context.getRequest().getLayers();
            for (int i = 0; i < mapLayers.size(); i++) {
                final Layer Layer = mapLayers.get(i);
                final MapLayerInfo layerInfo = layerInfos.get(i);

                ReferencedEnvelope layerLatLongBbox;
                layerLatLongBbox = computeLayerBounds(Layer, layerInfo, computeQueryBounds);
                try {
                    layerLatLongBbox = layerLatLongBbox.transform(aggregatedBounds.getCoordinateReferenceSystem(), true);
View Full Code Here

                List<ReferencedEnvelope> layerBounds) {

            List<MapLayerInfo> layers = request.getLayers();
            List<Style> styles = request.getStyles();
            for (int i = 0; i < layers.size(); i++) {
                MapLayerInfo layer = layers.get(i);
                if ("cached".equals(KMLUtils.getSuperoverlayMode(request, wms))
                        && KMLUtils.isRequestGWCCompatible(request, i, wms)) {
                    encodeGWCLink(request, layer);
                } else {
                    String styleName = i < styles.size() ? styles.get(i).getName() : null;
View Full Code Here

                List<ReferencedEnvelope> layerBounds) {

            final List<MapLayerInfo> layers = request.getLayers();
            final List<Style> styles = request.getStyles();
            for (int i = 0; i < layers.size(); i++) {
                MapLayerInfo layerInfo = layers.get(i);
                start("NetworkLink");
                element("name", layerInfo.getName());
                element("visibility", "1");
                element("open", "1");

                // look at for the network link for this single layer
                ReferencedEnvelope latLongBoundingBox = layerBounds.get(i);
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

            end("NetworkLink");
        }

        boolean isVectorLayer(Layer layer) {
            int index = mapContent.layers().indexOf(layer);
            MapLayerInfo info = mapContent.getRequest().getLayers().get(index);
            return (info.getType() == MapLayerInfo.TYPE_VECTOR || info.getType() == MapLayerInfo.TYPE_REMOTE_VECTOR);
        }
View Full Code Here

                       layerInfo = catalog.getLayerByName(new NameImpl(layerQName.getNamespaceURI(), layerQName.getLocalPart()));
                   }
                   if (layerInfo == null) {
                       throw new ServiceException("Layer not found: " + layerQName);
                   }
                   request.getLayers().add(new MapLayerInfo(layerInfo));
               }

               if (tiles.getBbox() == null) {
                   try {
                       // generate one from requests layers
View Full Code Here

        // see if we have to include sample data
        List<Layer> layers = mapContent.layers();
        boolean includeSampleData = false;
        for (int i = 0; i < layers.size(); i++) {
            // layer and info
            MapLayerInfo layerInfo = mapContent.getRequest().getLayers().get(i);
            final int type = layerInfo.getType();
            if (MapLayerInfo.TYPE_VECTOR == type || MapLayerInfo.TYPE_REMOTE_VECTOR == type) {
                includeSampleData = true;
            }
        }
        if(includeSampleData) {
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.