OSM parser. Create a new instance with the OpenLayers.Format.OSM constructor.
| OpenLayers. Format.OSM | OSM parser. |
| Properties | |
| checkTags | {Boolean} Should tags be checked to determine whether something should be treated as a seperate node. |
| interestingTagsExclude | {Array} List of tags to exclude from ‘interesting’ checks on nodes. |
| areaTags | {Array} List of tags indicating that something is an area. |
| Constructor | |
| OpenLayers. Format.OSM | Create a new parser for OSM. |
| Functions | |
| getNodes | Return the node items from a doc. |
| getWays | Return the way items from a doc. |
| getTags | Return the tags list attached to a specific DOM element. |
| isWayArea | Given a way object from getWays, check whether the tags and geometry indicate something is an area. |
| write | Takes a list of features, returns a serialized OSM format file for use in tools like JOSM. |
| createFeatureNodes | Takes a feature, returns a list of nodes from size 0->n. |
| createXML | Takes a feature, returns a list of nodes from size 0->n. |
| serializeTags | Given a feature, serialize the attributes onto the given node. |
| setState | OpenStreetMap has a convention that ‘state’ is stored for modification or deletion. |
getTags: function( dom_node, interesting_tags )
Return the tags list attached to a specific DOM element.
| node | {DOMElement} node to parse tags from |
| interesting_tags | {Boolean} whether the return from this function should return a boolean indicating that it has ‘interesting tags’ -- tags like attribution and source are ignored. (To change the list of tags, see interestingTagsExclude) |
| tags | {Object} hash of tags |
| interesting | {Boolean} if interesting_tags is passed, returns whether there are any interesting tags on this element. |
write: function( features )
Takes a list of features, returns a serialized OSM format file for use in tools like JOSM.
| features | {Array(OpenLayers.Feature.Vector)} |
createFeatureNodes: function( feature )
Takes a feature, returns a list of nodes from size 0->n. Will include all pieces of the serialization that are required which have not already been created. Calls out to createXML based on geometry type.
| feature | {OpenLayers.Feature.Vector} |
createXML:
Takes a feature, returns a list of nodes from size 0->n. Will include all pieces of the serialization that are required which have not already been created.
| feature | {OpenLayers.Feature.Vector} |
serializeTags: function( feature, node )
Given a feature, serialize the attributes onto the given node.
| feature | {OpenLayers.Feature.Vector} |
| node | {DOMNode} |
setState: function( feature, node )
OpenStreetMap has a convention that ‘state’ is stored for modification or deletion. This allows the file to be uploaded via JOSM or the bulk uploader tool.
| feature | {OpenLayers.Feature.Vector} |
| node | {DOMNode} |
Return the node items from a doc.
getNodes: function( doc )
Return the way items from a doc.
getWays: function( doc )
Return the tags list attached to a specific DOM element.
getTags: function( dom_node, interesting_tags )
Given a way object from getWays, check whether the tags and geometry indicate something is an area.
isWayArea: function( way )
Takes a list of features, returns a serialized OSM format file for use in tools like JOSM.
write: function( features )
Takes a feature, returns a list of nodes from size 0->n.
createFeatureNodes: function( feature )
Takes a feature, returns a list of nodes from size 0->n.
createXML:
Given a feature, serialize the attributes onto the given node.
serializeTags: function( feature, node )
OpenStreetMap has a convention that ‘state’ is stored for modification or deletion.
setState: function( feature, node )