Package org.opengis.feature

Examples of org.opengis.feature.Feature


        Iterator<Feature> iterator = Iterators.concat(nodes, ways);

        if (iterator.hasNext()) {
            FeatureMapFlusher insertsByParent = new FeatureMapFlusher(workingTree());
            while (iterator.hasNext()) {
                Feature feature = iterator.next();
                List<MappedFeature> mappedFeatures = mapping.map(feature);
                if (!mappedFeatures.isEmpty()) {
                    for (MappedFeature mapped : mappedFeatures) {
                        String path = mapped.getPath();
                        insertsByParent.put(path, mapped);
View Full Code Here


                RevFeature revFeature = parseCommand.setObjectId(ref.objectId())
                        .call(RevFeature.class).get();
                final String parentPath = ref.getParentPath();
                FeatureBuilder featureBuilder = builders.get(parentPath);
                String fid = ref.name();
                Feature feature = featureBuilder.build(fid, revFeature);
                return feature;
            }

        };
        return Iterators.transform(iterator, nodeRefToFeature);
View Full Code Here

                if (ref.isPresent()) {
                    org.locationtech.geogig.api.Node nodeRef = ref.get();

                    RevFeature revFeature = index.getDatabase().getFeature(nodeRef.getObjectId());
                    String id = NodeRef.nodeFromPath(nodeRef.getName());
                    Feature feature = featureBuilder.build(id, revFeature);

                    Point p = (Point) ((SimpleFeature) feature).getAttribute("location");
                    if (p != null) {
                        coord = p.getCoordinate();
                        thisChangePointCache.put(Long.valueOf(nodeId), coord);
View Full Code Here

                                property.getValue());
                    } else {
                        builder.set(property.getName(), property.getValue());
                    }
                }
                Feature modifiedFeature = builder.buildFeature(feature.getIdentifier().getID());
                return Optional.fromNullable(modifiedFeature);
            }

        };
View Full Code Here

        // |
        // o - master - HEAD - Points 1 modifiedB, 2 removed
        insertAndAdd(points1, points2);
        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)");
        insert(points1Modified);
        delete(points2);
        insert(points3);
        geogig.command(AddOp.class).call();
        RevCommit masterCommit = geogig.command(CommitOp.class).call();
        geogig.command(CheckoutOp.class).setSource("TestBranch").call();
        Feature points1ModifiedB = feature(pointsType, idP1, "StringProp1_3", new Integer(2000),
                "POINT(1 1)");
        insert(points1ModifiedB);
        delete(points2);
        geogig.command(AddOp.class).call();
        RevCommit branchCommit = geogig.command(CommitOp.class).call();
        // Now try to merge branch into master
        geogig.command(CheckoutOp.class).setSource("master").call();
        Ref branch = geogig.command(RefParse.class).setName("TestBranch").call().get();
        try {
            geogig.command(MergeOp.class).addCommit(Suppliers.ofInstance(branch.getObjectId()))
                    .call();
            fail();
        } catch (MergeConflictsException e) {
            assertTrue(e.getMessage().contains("conflict"));
        }

        Optional<Ref> ref = geogig.command(RefParse.class).setName(Ref.ORIG_HEAD).call();
        assertTrue(ref.isPresent());
        assertEquals(masterCommit.getId(), ref.get().getObjectId());
        ref = geogig.command(RefParse.class).setName(Ref.MERGE_HEAD).call();
        assertTrue(ref.isPresent());
        assertEquals(branch.getObjectId(), ref.get().getObjectId());

        String msg = geogig.command(ReadMergeCommitMessageOp.class).call();
        assertFalse(Strings.isNullOrEmpty(msg));

        List<Conflict> conflicts = geogig.command(ConflictsReadOp.class).call();
        assertEquals(1, conflicts.size());
        String path = NodeRef.appendChild(pointsName, idP1);
        assertEquals(conflicts.get(0).getPath(), path);
        assertEquals(conflicts.get(0).getOurs(), RevFeatureBuilder.build(points1Modified).getId());
        assertEquals(conflicts.get(0).getTheirs(), RevFeatureBuilder.build(points1ModifiedB)
                .getId());

        // try to commit
        try {
            geogig.command(CommitOp.class).call();
            fail();
        } catch (IllegalStateException e) {
            assertEquals(e.getMessage(), "Cannot run operation while merge conflicts exist.");
        }

        // solve, and commit
        Feature points1Merged = feature(pointsType, idP1, "StringProp1_2", new Integer(2000),
                "POINT(1 1)");
        insert(points1Merged);
        geogig.command(AddOp.class).call();
        RevCommit commit = geogig.command(CommitOp.class).call();
        assertTrue(commit.getMessage().contains(idP1));
View Full Code Here

        geogig.command(CommitOp.class).call();
        geogig.command(BranchCreateOp.class).setName("branch1").call();
        insertAndAdd(points2);
        geogig.command(CommitOp.class).call();
        geogig.command(BranchCreateOp.class).setName("branch2").call();
        Feature points1ModifiedC = feature(pointsType, idP1, "StringProp1_4", new Integer(3000),
                "POINT(1 3)");
        insertAndAdd(points1ModifiedC);
        geogig.command(CommitOp.class).call();
        geogig.command(CheckoutOp.class).setSource("branch1").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("branch2").call();
        Feature points1ModifiedB = feature(pointsType, idP1, "StringProp1_3", new Integer(2000),
                "POINT(1 2)");
        insertAndAdd(points1ModifiedB);
        geogig.command(CommitOp.class).call();

        // Now try to merge all branches into master
View Full Code Here

        // |
        // o - master - HEAD - Points 1 modifiedB
        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(2000),
                "POINT(1 1)");
        insertAndAdd(points1ModifiedB);
        insertAndAdd(points2);
        geogig.command(CommitOp.class).call();
View Full Code Here

        // |
        // o - master - HEAD - Points 1 modifiedB
        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(2000),
                "POINT(1 1)");
        insertAndAdd(points1ModifiedB);
        geogig.command(CommitOp.class).call();

        geogig.command(CheckoutOp.class).setSource("master").call();
View Full Code Here

    @Test
    public void testOursAndTheirs() 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(2000),
                "POINT(1 1)");
        insertAndAdd(points1ModifiedB);
        geogig.command(CommitOp.class).call();
        geogig.command(CheckoutOp.class).setSource("master").call();
        Ref branch = geogig.command(RefParse.class).setName("TestBranch").call().get();
View Full Code Here

        // |
        // o - master - HEAD - Points 1 modifiedB
        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(2000),
                "POINT(1 1)");
        insertAndAdd(points1ModifiedB);
        insertAndAdd(points2);
        geogig.command(CommitOp.class).call();
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.