Module: josm/ds

Provides utitly methods for data sets
Source:

Classes

DataSetUtil
Build an utility object wrapping the dataset ds

Methods


<static> buildId(args)

Creates an ID for an OSM primitive. Signatures
buildId(id, type)
Replies an object given by its unique numeric id and a type. The type is either a string node, way, or relation, or one of the symbols OsmPrimitiveType.NODE, OsmPrimitiveType.WAY, or OsmPrimitiveType.RELATION.
buildId(id)
Replies an object given an ID. id is either an instance of PrimitiveId or an object with the properties id and type, i.e. {id: 1234, type: 'node'}.
Parameters:
Name Type Description
args see description
Source:
Example
import { buildId, OsmPrimitiveType} from 'josm/ds'

// build a node id
const id1 = buildId(1234, 'node')

// build a way id
const id2 = buildId(3333, OsmPrimitiveType.WAY)

// build a relation id
const id3 = buildId({id: 5423, type: 'relation'})