Package org.locationtech.geogig.api.plumbing.diff

Examples of org.locationtech.geogig.api.plumbing.diff.FeatureDiff


        String path = NodeRef.appendChild(pointsName, points1B.getIdentifier().getID());
        Map<PropertyDescriptor, AttributeDiff> map = Maps.newHashMap();
        Optional<?> oldValue = Optional.fromNullable(points1B.getProperty("extra").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(oldValue, null);
        map.put(modifiedPointsType.getDescriptor("extra"), diff);
        FeatureDiff featureDiff = new FeatureDiff(path, map,
                RevFeatureTypeImpl.build(modifiedPointsType), RevFeatureTypeImpl.build(pointsType));
        patch.addModifiedFeature(featureDiff);
        geogig.command(ApplyPatchOp.class).setPatch(patch).call();
        Optional<RevFeature> feature = geogig.command(RevObjectParse.class)
                .setRefSpec("WORK_HEAD:" + path).call(RevFeature.class);
View Full Code Here


        String path = NodeRef.appendChild(pointsName, points1.getIdentifier().getID());
        Map<PropertyDescriptor, AttributeDiff> map = Maps.newHashMap();
        Optional<?> newValue = Optional.fromNullable(points1B.getProperty("extra").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(null, newValue);
        map.put(modifiedPointsType.getDescriptor("extra"), diff);
        FeatureDiff featureDiff = new FeatureDiff(path, map, RevFeatureTypeImpl.build(pointsType),
                RevFeatureTypeImpl.build(modifiedPointsType));
        patch.addModifiedFeature(featureDiff);
        geogig.command(ApplyPatchOp.class).setPatch(patch).call();
        // TODO
    }
View Full Code Here

        String path = NodeRef.appendChild(pointsName, points1B.getIdentifier().getID());
        Map<PropertyDescriptor, AttributeDiff> map = Maps.newHashMap();
        Optional<?> oldValue = Optional.fromNullable(points1B.getProperty("extra").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(oldValue, null);
        map.put(modifiedPointsType.getDescriptor("extra"), diff);
        FeatureDiff featureDiff = new FeatureDiff(path, map,
                RevFeatureTypeImpl.build(modifiedPointsType), RevFeatureTypeImpl.build(pointsType));
        patch.addModifiedFeature(featureDiff);
        try {
            geogig.command(ApplyPatchOp.class).setPatch(patch).call();
            fail();
View Full Code Here

        String path = NodeRef.appendChild(pointsName, points1.getIdentifier().getID());
        Map<PropertyDescriptor, AttributeDiff> map = Maps.newHashMap();
        Optional<?> newValue = Optional.fromNullable(points1B.getProperty("extra").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(null, newValue);
        map.put(modifiedPointsType.getDescriptor("extra"), diff);
        FeatureDiff featureDiff = new FeatureDiff(path, map,
                RevFeatureTypeImpl.build(modifiedPointsType), RevFeatureTypeImpl.build(modifiedPointsType));
        patch.addModifiedFeature(featureDiff);
        try {
            geogig.command(ApplyPatchOp.class).setPatch(patch).call();
            fail();
View Full Code Here

        String path = NodeRef.appendChild(pointsName, points1.getIdentifier().getID());
        Map<PropertyDescriptor, AttributeDiff> map = Maps.newHashMap();
        Optional<?> oldValue = Optional.fromNullable(points1.getProperty("sp").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(oldValue, Optional.of("new"));
        map.put(pointsType.getDescriptor("sp"), diff);
        FeatureDiff featureDiff = new FeatureDiff(path, map, RevFeatureTypeImpl.build(pointsType),
                RevFeatureTypeImpl.build(pointsType));
        patch.addModifiedFeature(featureDiff);
        try {
            geogig.command(ApplyPatchOp.class).setPatch(patch).call();
            fail();
View Full Code Here

        String pathModify = NodeRef.appendChild(pointsName, points1B.getIdentifier().getID());
        Map<PropertyDescriptor, AttributeDiff> map = Maps.newHashMap();
        Optional<?> oldValue = Optional.fromNullable(points1B.getProperty("extra").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(oldValue, null);
        map.put(modifiedPointsType.getDescriptor("extra"), diff);
        FeatureDiff featureDiff = new FeatureDiff(pathModify, map,
                RevFeatureTypeImpl.build(modifiedPointsType), RevFeatureTypeImpl.build(pointsType));
        patch.addModifiedFeature(featureDiff);
        Patch rejected = geogig.command(ApplyPatchOp.class).setPatch(patch).setApplyPartial(true)
                .call();
        assertFalse(rejected.isEmpty());
View Full Code Here

        String path = NodeRef.appendChild(pointsName, points1.getIdentifier().getID());
        Map<PropertyDescriptor, AttributeDiff> map = Maps.newHashMap();
        Optional<?> oldValue = Optional.fromNullable(points1.getProperty("sp").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(oldValue, Optional.of("new"));
        map.put(pointsType.getDescriptor("sp"), diff);
        FeatureDiff feaureDiff = new FeatureDiff(path, map, RevFeatureTypeImpl.build(pointsType),
                RevFeatureTypeImpl.build(pointsType));
        patch.addModifiedFeature(feaureDiff);
        String removedPath = NodeRef.appendChild(pointsName, points2.getIdentifier().getID());
        patch.addRemovedFeature(removedPath, points2, RevFeatureTypeImpl.build(pointsType));
        String addedPath = NodeRef.appendChild(pointsName, points3.getIdentifier().getID());
View Full Code Here

    public void testDiffBetweenEditedFeatures() {
        NodeRef oldRef = geogig.command(FeatureNodeRefFromRefspec.class)
                .setRefspec("HEAD:" + NodeRef.appendChild(pointsName, idP1)).call().orNull();
        NodeRef newRef = geogig.command(FeatureNodeRefFromRefspec.class)
                .setRefspec(NodeRef.appendChild(pointsName, idP1)).call().orNull();
        FeatureDiff diff = geogig.command(DiffFeature.class)
                .setOldVersion(Suppliers.ofInstance(oldRef))
                .setNewVersion(Suppliers.ofInstance(newRef)).call();
        assertTrue(diff.hasDifferences());
        System.out.println(diff);
    }
View Full Code Here

    public void testDiffBetweenFeatureAndItself() {
        NodeRef oldRef = geogig.command(FeatureNodeRefFromRefspec.class)
                .setRefspec(NodeRef.appendChild(pointsName, idP1)).call().orNull();
        NodeRef newRef = geogig.command(FeatureNodeRefFromRefspec.class)
                .setRefspec(NodeRef.appendChild(pointsName, idP1)).call().orNull();
        FeatureDiff diff = geogig.command(DiffFeature.class)
                .setOldVersion(Suppliers.ofInstance(oldRef))
                .setNewVersion(Suppliers.ofInstance(newRef)).call();
        assertFalse(diff.hasDifferences());
        System.out.println(diff);
    }
View Full Code Here

                    }
                }
            }
            diffs = tempDiffs;
        } else {
            FeatureDiff diff = new FeatureDiff(path, newFeature, oldFeature, newFeatureType,
                    oldFeatureType, all);
            diffs = diff.getDiffs();
        }

        context.setResponseContent(new CommandResponse() {

            @Override
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.api.plumbing.diff.FeatureDiff

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.