Search in sources :

Example 11 with BoundingBox

use of org.opengis.geometry.BoundingBox in project GeoGig by boundlessgeo.

the class DiffBounds method _call.

@Override
protected DiffSummary<BoundingBox, BoundingBox> _call() {
    checkArgument(cached && oldVersion == null || !cached, String.format("compare index allows only one revision to check against, got %s / %s", oldVersion, newVersion));
    checkArgument(newVersion == null || oldVersion != null, "If new rev spec is specified then old rev spec is mandatory");
    final String leftRefSpec = fromNullable(oldVersion).or(Ref.HEAD);
    final String rightRefSpec = fromNullable(newVersion).or(cached ? Ref.STAGE_HEAD : Ref.WORK_HEAD);
    RevTree left = resolveTree(leftRefSpec);
    RevTree right = resolveTree(rightRefSpec);
    ObjectDatabase leftSource = resolveSafeDb(leftRefSpec);
    ObjectDatabase rightSource = resolveSafeDb(rightRefSpec);
    PreOrderDiffWalk visitor = new PreOrderDiffWalk(left, right, leftSource, rightSource);
    CoordinateReferenceSystem crs = resolveCrs();
    BoundsWalk walk = new BoundsWalk(crs, stagingDatabase());
    PreOrderDiffWalk.Consumer consumer = walk;
    if (!pathFilters.isEmpty()) {
        consumer = new PathFilteringDiffConsumer(pathFilters, walk);
    }
    visitor.walk(consumer);
    DiffSummary<BoundingBox, BoundingBox> diffBounds = walk.getResult();
    return diffBounds;
}
Also used : ObjectDatabase(org.locationtech.geogig.storage.ObjectDatabase) BoundingBox(org.opengis.geometry.BoundingBox) PreOrderDiffWalk(org.locationtech.geogig.api.plumbing.diff.PreOrderDiffWalk) CoordinateReferenceSystem(org.opengis.referencing.crs.CoordinateReferenceSystem) RevTree(org.locationtech.geogig.api.RevTree) PathFilteringDiffConsumer(org.locationtech.geogig.api.plumbing.diff.PathFilteringDiffConsumer)

Aggregations

BoundingBox (org.opengis.geometry.BoundingBox)11 CoordinateReferenceSystem (org.opengis.referencing.crs.CoordinateReferenceSystem)6 ReferencedEnvelope (org.geotools.geometry.jts.ReferencedEnvelope)5 Test (org.junit.Test)4 Feature (org.opengis.feature.Feature)2 Optional (com.google.common.base.Optional)1 Envelope (com.vividsolutions.jts.geom.Envelope)1 Geometry (com.vividsolutions.jts.geom.Geometry)1 Point (com.vividsolutions.jts.geom.Point)1 ConsoleReader (jline.console.ConsoleReader)1 DefaultProgressListener (org.locationtech.geogig.api.DefaultProgressListener)1 GeoGIG (org.locationtech.geogig.api.GeoGIG)1 Node (org.locationtech.geogig.api.Node)1 RevFeatureType (org.locationtech.geogig.api.RevFeatureType)1 RevTree (org.locationtech.geogig.api.RevTree)1 DiffBounds (org.locationtech.geogig.api.plumbing.DiffBounds)1 DiffCount (org.locationtech.geogig.api.plumbing.DiffCount)1 DiffEntry (org.locationtech.geogig.api.plumbing.diff.DiffEntry)1 DiffObjectCount (org.locationtech.geogig.api.plumbing.diff.DiffObjectCount)1 PathFilteringDiffConsumer (org.locationtech.geogig.api.plumbing.diff.PathFilteringDiffConsumer)1