Examples of LsTreeOp


Examples of org.locationtech.geogig.api.plumbing.LsTreeOp

    private Iterator<Feature> getFeatures(String ref) {
        Optional<ObjectId> id = command(RevParse.class).setRefSpec(ref).call();
        if (!id.isPresent()) {
            return Iterators.emptyIterator();
        }
        LsTreeOp op = command(LsTreeOp.class).setStrategy(Strategy.DEPTHFIRST_ONLY_FEATURES)
                .setReference(ref);

        Iterator<NodeRef> iterator = op.call();

        Function<NodeRef, Feature> nodeRefToFeature = new Function<NodeRef, Feature>() {

            private final Map<String, FeatureBuilder> builders = //
            ImmutableMap.<String, FeatureBuilder> of(//
View Full Code Here

Examples of org.locationtech.geogig.api.plumbing.LsTreeOp

    private Iterator<EntityContainer> getFeatures(String ref) {
        Optional<ObjectId> id = geogig.command(RevParse.class).setRefSpec(ref).call();
        if (!id.isPresent()) {
            return Iterators.emptyIterator();
        }
        LsTreeOp op = geogig.command(LsTreeOp.class).setStrategy(Strategy.DEPTHFIRST_ONLY_FEATURES)
                .setReference(ref);
        if (bbox != null) {
            final Envelope env;
            try {
                env = new Envelope(Double.parseDouble(bbox.get(0)),
                        Double.parseDouble(bbox.get(2)), Double.parseDouble(bbox.get(1)),
                        Double.parseDouble(bbox.get(3)));
            } catch (NumberFormatException e) {
                throw new IllegalArgumentException("Wrong bbox definition");
            }
            Predicate<Bounded> filter = new Predicate<Bounded>() {
                @Override
                public boolean apply(final Bounded bounded) {
                    boolean intersects = bounded.intersects(env);
                    return intersects;
                }
            };
            op.setBoundsFilter(filter);
        }
        Iterator<NodeRef> iterator = op.call();
        final EntityConverter converter = new EntityConverter();
        Function<NodeRef, EntityContainer> function = new Function<NodeRef, EntityContainer>() {

            @Override
            @Nullable
View Full Code Here

Examples of org.locationtech.geogig.api.plumbing.LsTreeOp

            until = geogig.command(RevParse.class).setRefSpec(this.until).call();
            Preconditions.checkArgument(until.isPresent(), "Object not found '%s'", this.until);
            logOp.setUntil(until.get());
        }

        LsTreeOp lsTreeOp = geogig.command(LsTreeOp.class)
                .setStrategy(LsTreeOp.Strategy.TREES_ONLY);
        if (path != null && !path.trim().isEmpty()) {
            lsTreeOp.setReference(path);
            logOp.addPath(path);
        }
        final Iterator<NodeRef> treeIter = lsTreeOp.call();

        while (treeIter.hasNext()) {
            NodeRef node = treeIter.next();
            stats.add(new FeatureTypeStats(node.path(), context.getGeoGIG().getRepository()
                    .getTree(node.objectId()).size()));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.