Package org.geotools.feature

Examples of org.geotools.feature.FeatureCollection.toArray()


    @Test
    public void testElementValueFilter() throws IOException {
        Filter filter = FF.equals(FF.property("dc:identifier/dc:value", CSWRecordDescriptor.NAMESPACES), FF.literal("urn:uuid:1ef30a8b-876d-4828-9246-c37ab4510bbd"));
        FeatureCollection records = store.getRecords(new Query("Record", filter), Transaction.AUTO_COMMIT);
        assertEquals(1, records.size());
        Feature record = (Feature) records.toArray()[0];
        assertEquals("urn:uuid:1ef30a8b-876d-4828-9246-c37ab4510bbd", getSimpleLiteralValue(record, "identifier"));
        assertEquals("http://purl.org/dc/dcmitype/Service", getSimpleLiteralValue(record, "type"));
        assertEquals("Proin sit amet justo. In justo. Aenean adipiscing nulla id tellus.", getSimpleLiteralValue(record, "abstract"));
    }
   
View Full Code Here


    @Test
    public void testSpatialFilter() throws IOException {
        Filter filter = FF.bbox("", 60.042, 13.754, 68.410, 17.920, CSWRecordDescriptor.DEFAULT_CRS_NAME);
        FeatureCollection records = store.getRecords(new Query("Record", filter), Transaction.AUTO_COMMIT);
        assertEquals(1, records.size());
        Feature record = (Feature) records.toArray()[0];
        assertEquals("urn:uuid:1ef30a8b-876d-4828-9246-c37ab4510bbd", getSimpleLiteralValue(record, "identifier"));
    }
   
    @Test
    public void testScheme() throws IOException {
View Full Code Here

    @Test
    public void testScheme() throws IOException {
        Filter filter = FF.equals(FF.property("dc:identifier/dc:value", CSWRecordDescriptor.NAMESPACES), FF.literal("urn:uuid:6a3de50b-fa66-4b58-a0e6-ca146fdd18d4"));
        FeatureCollection records = store.getRecords(new Query("Record", filter), Transaction.AUTO_COMMIT);
        assertEquals(1, records.size());
        Feature record = (Feature) records.toArray()[0];
        assertEquals("http://www.digest.org/2.1", getSimpleLiteralScheme(record, "subject"));
    }
   
    @Test
    public void testSpatialFilterWorld() throws IOException {
View Full Code Here

            records = new FilteringFeatureCollection<FeatureType, Feature>(records, expanded);
        }

        // sorting
        if (q.getSortBy() != null && q.getSortBy().length > 0) {
            Feature[] features = (Feature[]) records.toArray(new Feature[records.size()]);
            Comparator<Feature> comparator = ComplexComparatorFactory.buildComparator(q.getSortBy());
            Arrays.sort(features, comparator);
           
            records = new MemoryFeatureCollection(records.getSchema(), Arrays.asList(features));
        }
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.