Package org.locationtech.geogig.osm.internal

Examples of org.locationtech.geogig.osm.internal.OSMReport


    @Override
    protected void writeResultBody(XMLStreamWriter w, Optional<OSMReport> result)
            throws XMLStreamException {
        if (result.isPresent()) {
            OSMReport report = result.get();
            long latestChangeset = report.getLatestChangeset();
            long latestTimestamp = report.getLatestTimestamp();
            long processedEntities = report.getCount();
            long nodeCount = report.getNodeCount();
            long wayCount = report.getWayCount();
            long unpprocessedCount = report.getUnpprocessedCount();

            w.writeStartElement("OSMReport");
            element(w, "latestChangeset", latestChangeset);
            element(w, "latestTimestamp", latestTimestamp);
            element(w, "processedEntities", processedEntities);
View Full Code Here


            Optional<OSMReport> report = cli.getGeogig().command(OSMImportOp.class)
                    .setDataSource(importFile.getAbsolutePath()).setMapping(mapping)
                    .setMessage(message).setNoRaw(noRaw).setAdd(add)
                    .setProgressListener(cli.getProgressListener()).call();
            if (report.isPresent()) {
                OSMReport rep = report.get();
                String msg;
                if (rep.getUnpprocessedCount() > 0) {
                    msg = String
                            .format("\nSome elements returned by the specified filter could not be processed.\n"
                                    + "Processed entities: %,d.\nWrong or uncomplete elements: %,d.\nNodes: %,d.\nWays: %,d.\n",
                                    rep.getCount(), rep.getUnpprocessedCount(), rep.getNodeCount(),
                                    rep.getWayCount());
                } else {
                    msg = String.format("\nProcessed entities: %,d.\n Nodes: %,d.\n Ways: %,d\n",
                            rep.getCount(), rep.getNodeCount(), rep.getWayCount());
                }
                cli.getConsole().println(msg);
            }

        } catch (EmptyOSMDownloadException e) {
View Full Code Here

                throw new CommandFailedException(e.getMessage(), e);
            }
            throw e;
        }
        if (report.isPresent()) {
            OSMReport rep = report.get();
            String msg;
            if (rep.getUnpprocessedCount() > 0) {
                msg = String
                        .format("\nSome elements returned by the specified filter could not be processed.\n"
                                + "Processed entities: %,d.\nWrong or uncomplete elements: %,d.\nNodes: %,d.\nWays: %,d.\n",
                                rep.getCount(), rep.getUnpprocessedCount(), rep.getNodeCount(),
                                rep.getWayCount());
            } else {
                msg = String.format("\nProcessed entities: %,d.\n Nodes: %,d.\n Ways: %,d\n",
                        rep.getCount(), rep.getNodeCount(), rep.getWayCount());
            }
            cli.getConsole().println(msg);
        }
    }
View Full Code Here

        try {
            Optional<OSMReport> report = cli.getGeogig().command(OSMApplyDiffOp.class)
                    .setDiffFile(diffFile).setProgressListener(cli.getProgressListener()).call();
            if (report.isPresent()) {
                OSMReport rep = report.get();
                String msg;
                if (rep.getUnpprocessedCount() > 0) {
                    msg = String
                            .format("\nSome diffs from the specified file were not applied.\n"
                                    + "Processed entities: %,d.\n %,d.\nNodes: %,d.\nWays: %,d.\n Elements not applied:",
                                    rep.getCount(), rep.getUnpprocessedCount(), rep.getNodeCount(),
                                    rep.getWayCount());
                } else {
                    msg = String.format("\nProcessed entities: %,d.\n Nodes: %,d.\n Ways: %,d\n",
                            rep.getCount(), rep.getNodeCount(), rep.getWayCount());
                }
                cli.getConsole().println(msg);
            }

        } catch (RuntimeException e) {
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.osm.internal.OSMReport

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.