Class: OverpassObject

OverpassObject()

Base class for representing map features.

Constructor

new OverpassObject()

Properties:
Name Type Description
id string ID of this object.
osm_id number Numeric id.
type string Type: 'node', 'way' or 'relation'.
tags object OpenStreetMap tags.
meta object OpenStreetMap meta information.
geometry object of the object
data object Data as loaded from Overpass API.
properties bit_array Which information about this object is known?
memberOf Array.<object> List of ways and relations where this object is member of.
Properties
Name Type Description
id string ID of the way or relation where this way is member of.
role string Role of this object in the relation.
sequence number This object is the nth member in the way resp. relation.
bounds BoundingBox Bounding box of this object.
center Point Centroid of the bounding box.
Source:

Methods

GeoJSON() → {object}

GeoJSON representation of this object
Source:
Returns:
Type
object

exportGeoJSON(object, function)

Export object as GeoJSON. Missing geometry will be loaded.
Parameters:
Name Type Description
object options Options
function callback Function which will be called with (err, result)
Source:

exportOSMJSON(object, object, function)

Export object (and members) as OpenStreetMap JSON
Parameters:
Name Type Description
object options Options
object elements All exported elements, include member objects. Pass an empty object. If a member element would be exported multiple times it will appear only once. For the final export, to be compatible to Overpass API, you should convert the object to an array via Object.values().
function callback Function which will be called with (err, result)
Source:

exportOSMXML(object, DOMNode, function)

Export object (and members) as OpenStreetMap XML
Parameters:
Name Type Description
object options Options
DOMNode parentNode a DOM Node where the object will be appended as child. Depending on object type and options, member objects will also be appended on the same level.
function callback Function which will be called with (err, dom node)
Source:

intersects(bbox) → {number}

Check whether this object intersects (or is within) the specified bounding box. Returns 0 if it does not match; 1 if the exact geometry is not known, but the object's bounding box matches; 2 exact match.
Parameters:
Name Type Description
bbox boundingbox:BoundingBox Bounding box
Source:
Returns:
Type
number

leafletFeature(optionsopt) → {L.layer}

return a leaflet feature for this object.
Parameters:
Name Type Attributes Description
options object <optional>
options Options will be passed to the leaflet function
Source:
Returns:
Type
L.layer

title() → {string}

Title of of this object (default: name, operator or ref or the id of the object)
Source:
Returns:
Type
string