Etiner Database Converter  0.1.0
Database Converter from OpenStreetMap XML/PBF format
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OpenStreetMap XML input parser

The input parser interprets the XML format OSM database file and stores the information on the fly. It is necessary because of the size of input: I do not want to store hundreds of gigabytes in the memory.

  • Interpreter:
    The interpreter is written in yacc, and compiled by Bison. See the source file src/parser/xml-parser.y for details.
    The interpreter itself is simple: just interprets the XML tags and passes the content to the class XML_Handler.
    The functions XML_Handler::Open() and XML_Handler::Close() are called on the XML tags, respectively. See more details there.

  • XML Tags:
    All tags are interpreted: their name and content are passed to the function XML_Handler::Open(), see more details there.

  • Accepted input:
    The following input formats are accepted:
    • <name content>:
      Opens a named tag. The optional content can contain any number of var="value" assignments (see Content of Tags below).
      The function XML_Handler::Open() is called, see more information there.

    • </ name>:
      Close the tag and process the result. The function XML_Handler::Close() is called, see more information there.

    • <name content />:
      The above mentioned open and close in one line. This tag cannot have sub-tags.

    • Tag Recursion:
      The class XML_Content holds all the information of a tag: its name, content, and sub-tags.
      The sub-tags are handled by the class I_XML_Behavior, see the details there.

  • Content of Tags:
    The tags can have any number of such assignments:
        name = "value"
    where 'name' and 'value' are stored as strings.
        <node id="298884269" lat="54.0901746" lon="12.2482632">