Class: ChangesetApi
josm/api. ChangesetApi
Provides methods to open, close, get, update, etc. changesets on the OSM
API server.
Note: this class doesn't provide a constructor. Methods
and properties are
static.static.Provides methods to open, close, get, update, etc. changesets on the OSM API server.
// load the changeset api
import { ChangesetApi } from 'josm/api'
// create a new changeset on the server
const cs = ChangesetApi.open()
| Name | Type | Description |
|---|---|---|
changeset |
number | Changeset | the changeset to close |
import { ChangesetApi } from 'josm/api'
import * as util from 'josm/util'
const Changeset = Java.type('org.openstreetmap.josm.data.osm.Changeset')
// closs the changeset 12345
ChangesetApi.close(12345)
// open a new changeset with the tags given by the supplied changeset
const cs2 = new Changeset(12345)
cs2 = ChangesetApi.close(cs2)
util.assert(cs2.closed) // the changeset is now closed
| Name | Type | Description |
|---|---|---|
changeset |
number | Changeset | the changeset to get |
import { ChangesetApi } from 'josm/api'
const Changeset = Java.type('org.openstreetmap.josm.data.osm.Changeset')
// get the changeset with id 12345
const cs1 = ChangesetApi.get(12345)
// get the changeset with id 12345
lets cs2 = new Changeset(12345)
cs2 = ChangesetApi.get(cs2)
| Name | Type | Argument | Description |
|---|---|---|---|
changeset |
Changeset | object |
<optional> |
the changeset to open |
import { ChangesetApi } from 'josm/api'
const Changeset = Java.type('org.openstreetmap.josm.data.osm.Changeset')
// open a new changeset with no tags
const cs1 = ChangesetApi.open()
// open a new changeset with the tags given by the supplied changeset
const cs2 = new Changeset()
cs2.put('comment', 'a test comment')
cs2 = ChangesetApi.open(cs2)
// open a new changeset with the tags given by the object
const cs3 = ChangesetApi.open({comment: 'a test comment'})
| Name | Type | Description |
|---|---|---|
changeset |
Changeset | the changeset to update |
import { ChangesetApi } from 'josm/api'
const Changeset = Java.type('org.openstreetmap.josm.data.osm.Changeset')
// update the comment of a changeset
const cs2 = new Changeset(12345)
cs2.put('comment', 'an updated comment')
cs2 = ChangesetApi.update(cs2)