Package org.opengis.feature

Examples of org.opengis.feature.Feature


        // create one commit per feature
        ArrayList<RevCommit> commits = Lists.newArrayList(populate(true, points1, points3,
                points1_modified));
        this.points1_modified_commit = commits.get(2);

        Feature p1ModifiedAgain = feature(pointsType, idP1, "StringProp1_1a", new Integer(1001),
                "POINT(10 20)");// used to be POINT(1 2)
        insertAndAdd(p1ModifiedAgain);
        commits.add(geogig.command(CommitOp.class).call());

        points1B_modified = feature(pointsType, idP1, "StringProp1B_1a", new Integer(2000),
View Full Code Here


        return "POINT(" + i + " " + i + ")";
    }

    private Node feature(ObjectDatabase db, String idPrefix, int index) {
        final String id = idPrefix + "." + index;
        final Feature feature;
        try {
            feature = super.feature(pointsType, id, id, index, point(index));
        } catch (ParseException e) {
            throw Throwables.propagate(e);
        }
        RevFeature revFeature = RevFeatureBuilder.build(feature);
        db.put(revFeature);
        Envelope bounds = (Envelope) feature.getBounds();
        return Node.create(id, revFeature.getId(), ObjectId.NULL, TYPE.FEATURE, bounds);
    }
View Full Code Here

                        + "serialized:java.io.Serializable," + "randomClass:java.lang.Object,"
                        + "pp:Point:srid=4326," + "lng:java.lang.Long," + "uuid:java.util.UUID");

        coverageRevFeatureType = RevFeatureTypeImpl.build(coverageFeatureType);

        Feature coverageFeature = feature(coverageFeatureType, "TestType.Coverage.1",
                "StringProp1_1", null, Boolean.TRUE, Byte.valueOf("18"), new Double(100.01),
                new BigDecimal("1.89e1021"), new Float(12.5), new Integer(1000), new BigInteger(
                        "90000000"), boolArray, byteArray, charArray, doubleArray, floatArray,
                intArray, longArray, serializableObject, new SomeRandomClass(), "POINT(1 1)",
                new Long(800000), UUID.fromString("bd882d24-0fe9-11e1-a736-03b3c0d0d06d"));
View Full Code Here

        SimpleFeatureType resultSchema = features.getSchema();

        assertEquals(1, resultSchema.getAttributeCount());
        assertEquals("SHAPE", resultSchema.getDescriptor(0).getLocalName());

        Feature feature = null;
        SimpleFeatureIterator iterator = features.features();
        try {
            feature = iterator.next();
        } finally {
            iterator.close();
        }

        assertEquals(resultSchema, feature.getType());
    }
View Full Code Here

        Collections.sort(al2, FEATURE_COMPARATOR);

        int n = c1.size();

        for (int i = 0; i < n; i++) {
            Feature f1 = al1.get(i);
            Feature f2 = al2.get(i);
            if (i == 0) {
                assertEquals("Feature Type", f1.getType(), f2.getType());
            }
            assertEquals("Feature[" + i + "] identifiers Equal", f1.getIdentifier().getID(), f2
                    .getIdentifier().getID());
            if (!f1.equals(f2)) {
                // go through properties and figure out differneces...
                for (PropertyDescriptor property : f1.getType().getDescriptors()) {
                    String name = property.getName().getLocalPart();
                    Object value1 = f1.getProperty(name).getValue();
                    Object value2 = f2.getProperty(name).getValue();
                    if (value1 instanceof Calendar) {
                        continue;
                    }
                    if (value1 instanceof Date) {
                        continue;
View Full Code Here

            ReferencedEnvelope boundingBox = new ReferencedEnvelope(DefaultGeographicCRS.WGS84);
            FeatureCollection features = source.getFeatures();
            FeatureIterator iterator = features.features();
            try {
                while (iterator.hasNext()) {
                    Feature f = iterator.next();
                    boundingBox.include(f.getBounds());
                }
            } finally {
                iterator.close();
            }
            return boundingBox;
View Full Code Here

        assertNotNull(reader);

        FeatureIterator<Feature> features = reader.features();
        assertTrue(features.hasNext());

        Feature complexFeature = (Feature) features.next();
        assertNotNull(complexFeature);
        assertEquals(targetType, complexFeature.getType());

        features.close();

        org.opengis.filter.FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        PropertyName expr;
View Full Code Here

        Filter badFilter = ff.greater(ff.property("sample/measurement[1]/value"), ff
                .literal(new Integer(3)));

        while (reader.hasNext()) {
            Feature f = (Feature) reader.next();
            assertNotNull(f);
            assertTrue(filter.evaluate(f));
            assertFalse(badFilter.evaluate(f));
            count++;
        }
View Full Code Here

        FeatureIterator<Feature> features = content.features();
        int count = 0;
        final int expectedCount = 5;
        try {
            while (features.hasNext()) {
                Feature f = features.next();
                LOGGER.finest(String.valueOf(f));
                ++count;
            }
        } catch (Exception e) {
            e.printStackTrace();
            throw e;
        } finally {
            features.close();
        }
        assertEquals("feature count", expectedCount, count);

        // Test DefaultMappingFeatureIterator MaxFeatures support [GEOS-1930]
        final int expectedCount2 = 3;
        DefaultQuery query = new DefaultQuery();
        query.setMaxFeatures(expectedCount2);
        FeatureCollection<FeatureType, Feature> content2 = source.getFeatures(query);
        FeatureIterator<Feature> features2 = content2.features();
        int count2 = 0;
        try {
            while (features2.hasNext()) {
                Feature f = (Feature) features2.next();
                LOGGER.finest(String.valueOf(f));
                ++count2;
            }
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

            FeatureCollection features = (FeatureCollection) fSource.getFeatures();

            int resultCount = getCount(features);
            assertEquals(EXPECTED_RESULT_COUNT, resultCount);

            Feature feature;
            int count = 0;
            FeatureIterator it = features.features();
            for (; it.hasNext();) {
                feature = (Feature) it.next();
                count++;
View Full Code Here

TOP

Related Classes of org.opengis.feature.Feature

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.