Class OSM::Callbacks
In: lib/OSM/StreamParser.rb
Parent: Object

Implements the callbacks called by OSM::StreamParser while parsing the OSM XML file.

To create your own behaviour, create a subclass of this class and (re)define the following methods:

  node(node) - see below
  way(way) - see below
  relation(relation) - see below

  start_document() - called once at start of document
  end_document() - called once at end of document

  result() - see below

Methods

node   relation   result   way  

Included Modules

REXML::SAX2Listener XML::SaxParser::Callbacks

Attributes

db  [RW]  the OSM::Database used to store objects in

Public Instance methods

Overwrite this in a derived class. The default behaviour is to do nothing but to store all node objects in a OSM::Database if one was supplied when creating the OSM::StreamParser object.

[Source]

    # File lib/OSM/StreamParser.rb, line 70
70:         def node(node)
71:             true
72:         end

Overwrite this in a derived class. The default behaviour is to do nothing but to store all relation objects in a OSM::Database if one was supplied when creating the OSM::StreamParser object.

[Source]

    # File lib/OSM/StreamParser.rb, line 84
84:         def relation(relation)
85:             true
86:         end

Overwrite this in a derived class. Whatever this method returns will be returned from the OSM::StreamParser#parse method.

[Source]

    # File lib/OSM/StreamParser.rb, line 90
90:         def result
91:         end

Overwrite this in a derived class. The default behaviour is to do nothing but to store all way objects in a OSM::Database if one was supplied when creating the OSM::StreamParser object.

[Source]

    # File lib/OSM/StreamParser.rb, line 77
77:         def way(way)
78:             true
79:         end

[Validate]