Package org.opengis.feature

Examples of org.opengis.feature.Feature


            public SimpleFeature apply(final NodeRef input) {
                final ObjectId metadataId = input.getMetadataId();
                final RevFeature revFeature = database.getFeature(input.objectId());

                FeatureBuilder featureBuilder = getBuilderFor(metadataId);
                Feature feature = featureBuilder.build(input.name(), revFeature);
                feature.getUserData().put(Hints.USE_PROVIDED_FID, true);
                feature.getUserData().put(RevFeature.class, revFeature);
                feature.getUserData().put(RevFeatureType.class, featureBuilder.getType());

                if (feature instanceof SimpleFeature) {
                    return (SimpleFeature) feature;
                }
                return null;
View Full Code Here


                    String name = featureType.getDescriptor(i + 1).getLocalName();
                    Object value = values.get(i).orNull();
                    featureBuilder.set(name, value);
                }
                featureBuilder.set("geogig_fid", nodeRef.name());
                Feature feature = featureBuilder.buildFeature(nodeRef.name());
                feature.getUserData().put(Hints.USE_PROVIDED_FID, true);
                feature.getUserData().put(RevFeature.class, revFeature);
                feature.getUserData().put(RevFeatureType.class, revFeatureType);

                if (feature instanceof SimpleFeature) {
                    return (SimpleFeature) feature;
                }
                return null;
View Full Code Here

        String simplifiedPointsName = "simplifiedPoints";
        String simplifiedPointsTypeSpec = "sp:String,pp:Point:srid=4326";
        SimpleFeatureType simplifiedPointsType = DataUtilities.createType(pointsNs,
                simplifiedPointsName, simplifiedPointsTypeSpec);

        Feature simplifiedPoints1 = feature(simplifiedPointsType,
                ((SimpleFeature) points1).getID(), ((SimpleFeature) points1).getAttribute(0),
                ((SimpleFeature) points1).getAttribute(2));
        Feature simplifiedPoints2 = feature(simplifiedPointsType,
                ((SimpleFeature) points2).getID(), ((SimpleFeature) points2).getAttribute(0),
                ((SimpleFeature) points2).getAttribute(2));
        Feature simplifiedPoints3 = feature(simplifiedPointsType,
                ((SimpleFeature) points3).getID(), ((SimpleFeature) points3).getAttribute(0),
                ((SimpleFeature) points3).getAttribute(2));

        Feature[] simplifiedPoints = new Feature[] { simplifiedPoints1, simplifiedPoints2,
                simplifiedPoints3 };
View Full Code Here

    @Test
    public void testModifiedSameFeatureCompatible() throws Exception {
        insertAndAdd(points1);
        geogig.command(CommitOp.class).call();
        geogig.command(BranchCreateOp.class).setName("TestBranch").call();
        Feature points1Modified = feature(pointsType, idP1, "StringProp1_2", new Integer(1000),
                "POINT(1 1)");
        insertAndAdd(points1Modified);
        geogig.command(CommitOp.class).call();
        geogig.command(CheckoutOp.class).setSource("TestBranch").call();
        Feature points1ModifiedB = feature(pointsType, idP1, "StringProp1_1", new Integer(2000),
                "POINT(1 1)");
        insertAndAdd(points1ModifiedB);
        RevCommit branchCommit = geogig.command(CommitOp.class).call();
        geogig.command(CheckoutOp.class).setSource("master").call();
        MergeScenarioReport conflicts = geogig.command(ReportCommitConflictsOp.class)
View Full Code Here

        geogig.command(CommitOp.class).call();
        geogig.command(BranchCreateOp.class).setName("TestBranch").call();
        geogig.command(CheckoutOp.class).setSource("TestBranch").call();
        insertAndAdd(points1);
        geogig.command(CommitOp.class).call();
        Feature points1Modified = feature(pointsType, idP1, "StringProp1_2", new Integer(1000),
                "POINT(1 1)");
        insertAndAdd(points1Modified);
        RevCommit branchCommit = geogig.command(CommitOp.class).call();
        geogig.command(CheckoutOp.class).setSource("master").call();
        MergeScenarioReport conflicts = geogig.command(ReportCommitConflictsOp.class)
View Full Code Here

    @Test
    public void testModifiedSameAttributeCompatible() throws Exception {
        insertAndAdd(points1);
        geogig.command(CommitOp.class).call();
        geogig.command(BranchCreateOp.class).setName("TestBranch").call();
        Feature points1Modified = feature(pointsType, idP1, "StringProp1_2", new Integer(1000),
                "POINT(1 1)");
        insertAndAdd(points1Modified);
        geogig.command(CommitOp.class).call();
        geogig.command(CheckoutOp.class).setSource("TestBranch").call();
        Feature points1ModifiedB = feature(pointsType, idP1, "StringProp1_2", new Integer(2000),
                "POINT(1 1)");
        insertAndAdd(points1ModifiedB);
        RevCommit branchCommit = geogig.command(CommitOp.class).call();
        geogig.command(CheckoutOp.class).setSource("master").call();
        MergeScenarioReport conflicts = geogig.command(ReportCommitConflictsOp.class)
View Full Code Here

    @Test
    public void testModifiedSameFeatureIncompatible() throws Exception {
        insertAndAdd(points1);
        geogig.command(CommitOp.class).call();
        geogig.command(BranchCreateOp.class).setName("TestBranch").call();
        Feature points1Modified = feature(pointsType, idP1, "StringProp1_2", new Integer(1000),
                "POINT(1 1)");
        insertAndAdd(points1Modified);
        geogig.command(CommitOp.class).call();
        geogig.command(CheckoutOp.class).setSource("TestBranch").call();
        Feature points1ModifiedB = feature(pointsType, idP1, "StringProp1_3", new Integer(1000),
                "POINT(1 1)");
        insertAndAdd(points1ModifiedB);
        RevCommit branchCommit = geogig.command(CommitOp.class).call();
        geogig.command(CheckoutOp.class).setSource("master").call();
        MergeScenarioReport conflicts = geogig.command(ReportCommitConflictsOp.class)
View Full Code Here

    @Test
    public void testModifiedAndRemoved() throws Exception {
        insertAndAdd(points1);
        geogig.command(CommitOp.class).call();
        geogig.command(BranchCreateOp.class).setName("TestBranch").call();
        Feature points1Modified = feature(pointsType, idP1, "StringProp1_2", new Integer(1000),
                "POINT(1 1)");
        insertAndAdd(points1Modified);
        geogig.command(CommitOp.class).call();
        geogig.command(CheckoutOp.class).setSource("TestBranch").call();
        deleteAndAdd(points1);
View Full Code Here

    @Test
    public void testGetFeatureFromHead() throws Exception {
        insertAndAdd(points1);
        geogig.command(CommitOp.class).setMessage("Commit message").call();
        Feature feature = geogigAPI.getFeatureFromHead(NodeRef.appendChild(pointsName, idP1));
        assertNotNull(feature);
    }
View Full Code Here

    }

    @Test
    public void testGetFeatureFromWorkingTree() throws Exception {
        insert(points1);
        Feature feature = geogigAPI
                .getFeatureFromWorkingTree(NodeRef.appendChild(pointsName, idP1));
        assertNotNull(feature);
    }
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.