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

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


                PropertyDescriptor pd = entry.getKey();
                AttributeDiff ad = entry.getValue();
                if (ad instanceof GeometryAttributeDiff
                        && ad.getType() == org.locationtech.geogig.api.plumbing.diff.AttributeDiff.TYPE.MODIFIED
                        && !noGeom) {
                    GeometryAttributeDiff gd = (GeometryAttributeDiff) ad;
                    ansi.fg(YELLOW);
                    ansi.a(pd.getName()).a(": ");
                    ansi.reset();
                    String text = gd.getDiff().getDiffCoordsString();
                    for (int i = 0; i < text.length(); i++) {
                        if (text.charAt(i) == '(') {
                            ansi.fg(GREEN);
                            ansi.a(text.charAt(i));
                        } else if (text.charAt(i) == '[') {
View Full Code Here


            Optional<Object> valueB = valuesB.get(i);
            if (!valueA.equals(valueAncestor)) {
                Optional<Object> merged = valueA;
                if (isGeom && !valueB.equals(valueAncestor)) { // true merge is only done with
                                                               // geometries
                    GeometryAttributeDiff diffB = new GeometryAttributeDiff(
                            Optional.fromNullable((Geometry) valueAncestor.orNull()),
                            Optional.fromNullable((Geometry) valueB.orNull()));
                    merged = (Optional<Object>) diffB.applyOn(valueA);
                }
                featureBuilder.set(name, merged.orNull());
            } else {
                featureBuilder.set(name, valueB.orNull());
            }
View Full Code Here

                if (Geometry.class.isAssignableFrom(attributes.get(index).getType().getBinding())) {
                    Optional<Geometry> temp = Optional.absent();
                    if (value.isPresent() || all) {
                        tempDiffs.put(
                                attributes.get(index),
                                new GeometryAttributeDiff(Optional.fromNullable((Geometry) value
                                        .orNull()), temp));
                    }
                } else {
                    if (value.isPresent() || all) {
                        tempDiffs.put(attributes.get(index), new GenericAttributeDiffImpl(value,
                                Optional.absent()));
                    }
                }
            }
            diffs = tempDiffs;
        } else if (added) {
            Map<PropertyDescriptor, AttributeDiff> tempDiffs = new HashMap<PropertyDescriptor, AttributeDiff>();
            ImmutableList<PropertyDescriptor> attributes = newFeatureType.sortedDescriptors();
            ImmutableList<Optional<Object>> values = newFeature.getValues();
            for (int index = 0; index < attributes.size(); index++) {
                Optional<Object> value = values.get(index);
                if (Geometry.class.isAssignableFrom(attributes.get(index).getType().getBinding())) {
                    Optional<Geometry> temp = Optional.absent();
                    if (value.isPresent() || all) {
                        tempDiffs.put(attributes.get(index), new GeometryAttributeDiff(temp,
                                Optional.fromNullable((Geometry) value.orNull())));
                    }
                } else {
                    if (value.isPresent() || all) {
                        tempDiffs.put(attributes.get(index),
View Full Code Here

TOP

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

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.