Package org.geotools.wfs

Examples of org.geotools.wfs.PropertyValueCollection$PropertyValueIterator


        b.add("1");
        b.add(DATE_FORMAT.parse("2011-06-20 11:11:11"));
        features.add(b.buildFeature(null));

        ValueCollectionType vc = Wfs20Factory.eINSTANCE.createValueCollectionType();
        PropertyValueCollection valueCollection = new PropertyValueCollection(features, featureType.getDescriptor("geom"), filterFac.property("geom"));
        vc.getMember().add(valueCollection);

        Document doc = encode(vc, WFS.ValueCollection);
        assertEquals("wfs:ValueCollection", doc.getDocumentElement().getNodeName());
        assertEquals(2, getElementsByQName(doc, WFS.member).getLength());
       
        NodeList geoms = getElementsByQName(doc, new QName("http://geotools.org", "geom"));
        assertEquals(2, geoms.getLength());

        assertNotNull(getElementByQName((Element)geoms.item(0), GML.Point));
        assertNotNull(getElementByQName((Element)geoms.item(1), GML.Point));
       
        vc = Wfs20Factory.eINSTANCE.createValueCollectionType();
        vc.getMember().add(new PropertyValueCollection(features, featureType.getDescriptor("str"), filterFac.property("str")));

        doc = encode(vc, WFS.ValueCollection);
        assertEquals("wfs:ValueCollection", doc.getDocumentElement().getNodeName());
        assertEquals(2, getElementsByQName(doc, WFS.member).getLength());
       
        NodeList strs = getElementsByQName(doc, new QName("http://geotools.org", "str"));
        assertEquals(2, strs.getLength());

        Set vals = new HashSet(Arrays.asList("zero", "one"));
        vals.remove(strs.item(0).getFirstChild().getNodeValue());
        vals.remove(strs.item(1).getFirstChild().getNodeValue());
        assertTrue(vals.isEmpty());
       
        vc = Wfs20Factory.eINSTANCE.createValueCollectionType();
        vc.getMember().add(new PropertyValueCollection(features, featureType.getDescriptor("date"), filterFac.property("date")));

        doc = encode(vc, WFS.ValueCollection);
        assertEquals("wfs:ValueCollection", doc.getDocumentElement().getNodeName());
        assertEquals(2, getElementsByQName(doc, WFS.member).getLength());
       
View Full Code Here


            // create value collection type from feature collection
            ValueCollectionType vc = Wfs20Factory.eINSTANCE.createValueCollectionType();
            vc.setTimeStamp(fc.getTimeStamp());
            vc.setNumberMatched(fc.getNumberMatched());
            vc.setNumberReturned(fc.getNumberReturned());
            vc.getMember().add(new PropertyValueCollection(fc.getMember().iterator().next(), descriptor, propertyName));
            return vc;
        } catch (IOException e) {
            throw new WFSException(request, e);
        }
    }
View Full Code Here

TOP

Related Classes of org.geotools.wfs.PropertyValueCollection$PropertyValueIterator

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.