Examples of FeatureCollectionType


Examples of net.opengis.wfs.FeatureCollectionType

    public void testSingle() throws Exception {
        FeatureSource<? extends FeatureType, ? extends Feature> source = getFeatureSource(MockData.SEVEN);
        FeatureCollection<? extends FeatureType, ? extends Feature> features = source.getFeatures();

        FeatureCollectionType fcType = WfsFactory.eINSTANCE
                .createFeatureCollectionType();

        fcType.getFeature().add(features);

        ByteArrayOutputStream output = new ByteArrayOutputStream();
        producer().write(fcType, output, request(MockData.SEVEN) );

        DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance()
View Full Code Here

Examples of net.opengis.wfs.FeatureCollectionType

        assertEquals(7, document.getElementsByTagName("cdf:Seven").getLength());

    }

    public void testMultipleSameNamespace() throws Exception {
        FeatureCollectionType fcType = WfsFactory.eINSTANCE
                .createFeatureCollectionType();
        fcType.getFeature().add(
               getFeatureSource(MockData.SEVEN).getFeatures());
        fcType.getFeature().add(getFeatureSource(MockData.FIFTEEN).getFeatures());

        ByteArrayOutputStream output = new ByteArrayOutputStream();
        producer().write(fcType, output, request(MockData.SEVEN, MockData.FIFTEEN));

        DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance()
View Full Code Here

Examples of net.opengis.wfs.FeatureCollectionType

                .getLength()
                + document.getElementsByTagName("cdf:Fifteen").getLength());
    }

    public void testMultipleDifferentNamespace() throws Exception {
        FeatureCollectionType fcType = WfsFactory.eINSTANCE
                .createFeatureCollectionType();
        fcType.getFeature().add(getFeatureSource(MockData.SEVEN).getFeatures());
        fcType.getFeature().add(getFeatureSource(MockData.POLYGONS).getFeatures());
       
        int npolys = getFeatureSource(MockData.POLYGONS).getFeatures().size();

        ByteArrayOutputStream output = new ByteArrayOutputStream();
        producer().write(fcType, output, request(MockData.SEVEN, MockData.POLYGONS));
View Full Code Here

Examples of net.opengis.wfs.FeatureCollectionType

       
        // build the request objects and feed the output format
        GetFeatureType gft = WfsFactory.eINSTANCE.createGetFeatureType();
        Operation op = new Operation("GetFeature", getServiceDescriptor10(), null, new Object[] {gft});
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        FeatureCollectionType fct = WfsFactory.eINSTANCE.createFeatureCollectionType();
        fct.getFeature().add(fs.getFeatures());
       
        // write out the results
        CSVOutputFormat format = new CSVOutputFormat(getGeoServer());
        format.write(fct, bos, op);
       
View Full Code Here

Examples of net.opengis.wfs.FeatureCollectionType

        return false;
    }

    public void write(Object value, OutputStream output, Operation operation)
        throws IOException, ServiceException {
        FeatureCollectionType fct = (FeatureCollectionType) value;
        SimpleFeatureCollection fc = (SimpleFeatureCollection) fct.getFeature().get(0);

        // setup template subsystem
        GeoServerTemplateLoader templateLoader = new GeoServerTemplateLoader(getClass());
        templateLoader.setFeatureType(fc.getSchema());
View Full Code Here

Examples of net.opengis.wfs.FeatureCollectionType

        tx.transform(new DOMSource(doc), new StreamResult(tmp));

        in = new FileInputStream(tmp);

        Parser parser = new Parser(configuration);
        FeatureCollectionType fc = (FeatureCollectionType) parser.parse(in);
        assertNotNull(fc);

        List featureCollections = fc.getFeature();
        assertEquals(1, featureCollections.size());

        SimpleFeatureCollection featureCollection;
        featureCollection = (SimpleFeatureCollection) featureCollections.get(0);
        assertEquals(5, featureCollection.size());
View Full Code Here

Examples of net.opengis.wfs.FeatureCollectionType

        return WFS.FeatureCollectionType;
    }

    @Override
    public Object getProperty(Object object, QName name) throws Exception {
        FeatureCollectionType fc = (FeatureCollectionType) object;
        if ( !fc.getFeature().isEmpty() ) {
            Object val = WFSParsingUtils.FeatureCollectionType_getProperty(fc, name);
            if (val != null) {
                return val;
            }
        }
View Full Code Here

Examples of net.opengis.wfs.FeatureCollectionType

        return super.getProperty(object, name);
    }
   
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        FeatureCollectionType fct = (FeatureCollectionType) super.parse(instance, node, value);
        return WFSParsingUtils.FeatureCollectionType_parse(fct, instance, node);
    }
View Full Code Here

Examples of net.opengis.wfs.FeatureCollectionType

       
        b.add( new GeometryFactory().createPoint( new Coordinate( 1, 1 ) ) );
        b.add( 1 );
        features.add( b.buildFeature( "one" ) );
       
        FeatureCollectionType fc = WfsFactory.eINSTANCE.createFeatureCollectionType();
        fc.getFeature().add( features );
       
        Document dom = encode( fc, WFS.FeatureCollection );
        print( dom );
       
        NodeList featureNodes = dom.getElementsByTagNameNS( "http://geotools.org" , "feature" );
View Full Code Here

Examples of net.opengis.wfs.FeatureCollectionType

    @Override
    public void testParse() throws Exception {
        final URL resource = TestData.getResource(this, "FeatureCollectionTypeBindingTest.xml");
        buildDocument(resource);
       
        FeatureCollectionType fc = (FeatureCollectionType) parse();
        assertEquals( 1, fc.getFeature().size() );
       
        FeatureCollection features = (FeatureCollection) fc.getFeature().get( 0 );
        assertEquals( 2, features.size() );
       
        FeatureIterator fi = features.features();
        try {
            assertTrue( fi.hasNext() );
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.