Examples of WMSMapContext


Examples of org.vfny.geoserver.wms.WMSMapContext

        // 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(new MapLayerInfo[] { layer });

        request.setFormatOptions(Collections.singletonMap("relLinks", "true"));
        MockHttpServletRequest httpreq = (MockHttpServletRequest) request.getHttpServletRequest();
        httpreq.setScheme("http");
        httpreq.setServerName("geoserver.org");
        httpreq.setServerPort(8181);
        httpreq.setContextPath("/geoserver");
        mapContext.setRequest(request);
    }
View Full Code Here

Examples of org.vfny.geoserver.wms.WMSMapContext

        // 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);
        mapContext = new WMSMapContext();
        GetMapRequest request = mockData.createRequest();
        request.setLayers(new MapLayerInfo[] { layer });

        FeatureSource<SimpleFeatureType, SimpleFeature> featureSource;
        featureSource = (FeatureSource<SimpleFeatureType, SimpleFeature>) ((FeatureTypeInfo)layer.getFeature()).getFeatureSource(null, null);
View Full Code Here

Examples of org.vfny.geoserver.wms.WMSMapContext

        FeatureCollection<SimpleFeatureType, SimpleFeature> features = FeatureCollections
                .newCollection();
        Style style = mockData.getDefaultStyle().getStyle();
        MapLayer mapLayer = new DefaultMapLayer(features, style);

        WMSMapContext mapContext = new WMSMapContext();
        GetMapRequest request = mockData.createRequest();
        mapContext.setRequest(request);

        KMLVectorTransformer transformer = new KMLVectorTransformer(mapContext, mapLayer);

        Document document;
View Full Code Here

Examples of org.vfny.geoserver.wms.WMSMapContext

        Style style = mockData.getDefaultStyle().getStyle();
        MapLayer mapLayer = new DefaultMapLayer(features, style);
        mapLayer.setTitle("TestPointsTitle");

        WMSMapContext mapContext = new WMSMapContext();
        GetMapRequest request = mockData.createRequest();
        request.setLayers(new MapLayerInfo[] { layer });

        request.setMaxFeatures(2);
        request.setStartIndex(2);
        request.setFormatOptions(Collections.singletonMap("relLinks", "true"));
        MockHttpServletRequest httpreq = (MockHttpServletRequest) request.getHttpServletRequest();
        httpreq.setRequestURL("baseurl");
        mapContext.setRequest(request);

        KMLVectorTransformer transformer = new KMLVectorTransformer(mapContext, mapLayer);
        transformer.setStandAlone(false);
        transformer.setIndentation(2);
View Full Code Here

Examples of org.vfny.geoserver.wms.WMSMapContext

    public static Test suite() {
        return new OneTimeTestSetup(new RSSGeoRSSTransformerTest());
    }

    public void testLatLongInternal() throws Exception {
        WMSMapContext map = new WMSMapContext(createGetMapRequest(MockData.BASIC_POLYGONS));
        map.addLayer(createMapLayer(MockData.BASIC_POLYGONS));

        Document document = getRSSResponse(map, AtomGeoRSSTransformer.GeometryEncoding.LATLONG);

        Element element = document.getDocumentElement();
        assertEquals("rss", element.getNodeName());
View Full Code Here

Examples of org.vfny.geoserver.wms.WMSMapContext

            assertEquals(1, item.getElementsByTagName("geo:long").getLength());
        }
    }
   
    public void testSimpleInternal() throws Exception {
        WMSMapContext map = new WMSMapContext(createGetMapRequest(MockData.BASIC_POLYGONS));
        map.addLayer(createMapLayer(MockData.BASIC_POLYGONS));

        Document document = getRSSResponse(map, GeoRSSTransformerBase.GeometryEncoding.SIMPLE);
        print(document);

        Element element = document.getDocumentElement();
View Full Code Here

Examples of org.vfny.geoserver.wms.WMSMapContext

        }
    }

    public void testFilter() throws Exception {
        // Set up a map context with a filtered layer
        WMSMapContext map = new WMSMapContext(createGetMapRequest(MockData.BUILDINGS));
        MapLayer layer = createMapLayer(MockData.BUILDINGS);
        Filter f = ff.equals(ff.property("ADDRESS"), ff.literal("215 Main Street"));
        layer.setQuery(new DefaultQuery(MockData.BUILDINGS.getLocalPart(), f));
        map.addLayer(layer);
       
        Document document = getRSSResponse(map, AtomGeoRSSTransformer.GeometryEncoding.LATLONG);
        NodeList items = document.getDocumentElement().getElementsByTagName("item");
        assertEquals(1, items.getLength());
    }
View Full Code Here

Examples of org.vfny.geoserver.wms.WMSMapContext

        assertEquals(1, items.getLength());
    }
   
    public void testReproject() throws Exception {
        // Set up a map context with a projected layer
        WMSMapContext map = new WMSMapContext(createGetMapRequest(MockData.LINES));
        map.addLayer(createMapLayer(MockData.LINES));
       
        Document document = getRSSResponse(map, AtomGeoRSSTransformer.GeometryEncoding.LATLONG);
        NodeList items = document.getDocumentElement().getElementsByTagName("item");
       
        // check all items are there
View Full Code Here

Examples of org.vfny.geoserver.wms.WMSMapContext

    }

    protected void oneTimeSetUp() throws Exception {
        super.oneTimeSetUp();

        map = new WMSMapContext(createGetMapRequest(MockData.BASIC_POLYGONS));
        map.addLayer(createMapLayer(MockData.BASIC_POLYGONS));
    }
View Full Code Here

Examples of org.vfny.geoserver.wms.WMSMapContext

    protected void setUpInternal() throws Exception {
        super.setUpInternal();

        mapLayer = createMapLayer(DISPERSED_FEATURES);
       
        mapContext = new WMSMapContext(createGetMapRequest(MockData.BASIC_POLYGONS));
        mapContext.addLayer(mapLayer);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.