Package org.locationtech.geogig.api

Examples of org.locationtech.geogig.api.GeoGIG


    }

    @Test
    public void testApplyDiff() throws Exception {
        // import and check
        GeoGIG geogig = cli.newGeoGIG();
        String filename = OSMImportOp.class.getResource("nodes_for_changeset2.xml").getFile();
        File file = new File(filename);
        cli.execute("osm", "import", file.getAbsolutePath());

        long unstaged = geogig.getRepository().workingTree().countUnstaged("node").count();
        assertTrue(unstaged > 0);
        Optional<RevFeature> revFeature = geogig.command(RevObjectParse.class)
                .setRefSpec("WORK_HEAD:node/2059114068").call(RevFeature.class);
        assertTrue(revFeature.isPresent());
        revFeature = geogig.command(RevObjectParse.class).setRefSpec("WORK_HEAD:node/507464865")
                .call(RevFeature.class);
        assertFalse(revFeature.isPresent());

        String changesetFilename = OSMImportOp.class.getResource("changeset.xml").getFile();
        File changesetFile = new File(changesetFilename);
        cli.execute("osm", "apply-diff", changesetFile.getAbsolutePath());

        revFeature = geogig.command(RevObjectParse.class).setRefSpec("WORK_HEAD:node/2059114068")
                .call(RevFeature.class);
        assertFalse(revFeature.isPresent());
        revFeature = geogig.command(RevObjectParse.class).setRefSpec("WORK_HEAD:node/507464865")
                .call(RevFeature.class);
        assertTrue(revFeature.isPresent());
        geogig.close();
    }
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.api.GeoGIG

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.