use of org.openstreetmap.osmosis.xml.v0_6.XmlChangeWriter in project GeoGig by boundlessgeo.
the class CreateOSMChangeset method runInternal.
/**
* Executes the command with the specified options.
*/
@Override
protected void runInternal(GeogigCLI cli) throws IOException {
checkParameter(refSpec.size() < 3, "Commit list is too long :" + refSpec);
GeoGIG geogig = cli.getGeogig();
CreateOSMChangesetOp op = geogig.command(CreateOSMChangesetOp.class);
String oldVersion = resolveOldVersion();
String newVersion = resolveNewVersion();
op.setOldVersion(oldVersion).setNewVersion(newVersion).setId(id);
Iterator<ChangeContainer> entries;
entries = op.setProgressListener(cli.getProgressListener()).call();
if (!entries.hasNext()) {
cli.getConsole().println("No differences found");
return;
}
BufferedWriter bufWriter = new BufferedWriter(new FileWriter(new File(file)));
XmlChangeWriter writer = new XmlChangeWriter(bufWriter);
while (entries.hasNext()) {
ChangeContainer change = entries.next();
writer.process(change);
}
writer.complete();
bufWriter.flush();
}
Aggregations