Package org.openstreetmap.josm.data.osm

Examples of org.openstreetmap.josm.data.osm.Changeset


    protected void openNewChangeset() {
        // make sure the current changeset is removed from the upload dialog.
        //
        ChangesetCache.getInstance().update(changeset);
        Changeset newChangeSet = new Changeset();
        newChangeSet.setKeys(this.changeset.getKeys());
        this.changeset = newChangeSet;
    }
View Full Code Here


        if (parser.getAttributeValue(null, "id") != null) {
            id = getLong("id");
        }
        // Read changeset info if neither upload-changeset nor id are set, or if they are both set to the same value
        if (id == uploadChangesetId || (id != null && id.equals(uploadChangesetId))) {
            uploadChangeset = new Changeset(id != null ? id.intValue() : 0);
            while (true) {
                int event = parser.next();
                if (event == XMLStreamConstants.START_ELEMENT) {
                    if ("tag".equals(parser.getLocalName())) {
                        parseTag(uploadChangeset);
View Full Code Here

        if (id <= 0)
            throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' > 0 expected. Got ''{1}''.", "id", id));
        if (monitor == null) {
            monitor = NullProgressMonitor.INSTANCE;
        }
        Changeset result = null;
        try {
            monitor.beginTask(tr("Reading changeset {0} ...",id));
            StringBuilder sb = new StringBuilder();
            sb.append("changeset/").append(id);
            try (InputStream in = getInputStream(sb.toString(), monitor.createSubTaskMonitor(1, true))) {
View Full Code Here

                if (!("0.6".equals(v))) {
                    throwException(tr("Unsupported version: {0}", v));
                }
                break;
            case "changeset":
                current = new Changeset();
                parseChangesetAttributes(current, atts);
                break;
            case "tag":
                String key = atts.getValue("k");
                String value = atts.getValue("v");
View Full Code Here

     */
    static public void createDataSetOnServer(APIDataSet ds) throws OsmTransferException, CyclicUploadDependencyException {
        logger.info("creating data set on the server ...");
        ds.adjustRelationUploadOrder();
        OsmServerWriter writer = new OsmServerWriter();
        Changeset cs  = new Changeset();
        writer.uploadOsm(
                new UploadStrategySpecification().setStrategy(UploadStrategy.SINGLE_REQUEST_STRATEGY),
                ds.getPrimitives(), cs, NullProgressMonitor.INSTANCE);
        OsmApi.getOsmApi().closeChangeset(cs, NullProgressMonitor.INSTANCE);
    }
View Full Code Here

        primitives.addAll(testDataSet.getNodes());
        primitives.addAll(testDataSet.getWays());
        primitives.addAll(testDataSet.getRelations());

        OsmServerWriter writer = new OsmServerWriter();
        Changeset cs = new Changeset();
        writer.uploadOsm(new UploadStrategySpecification().setStrategy(UploadStrategy.SINGLE_REQUEST_STRATEGY), primitives,cs,NullProgressMonitor.INSTANCE);
        OsmApi.getOsmApi().closeChangeset(cs, NullProgressMonitor.INSTANCE);
    }
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.data.osm.Changeset

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.