Package org.h2gis.functions.io.osm

## Class OSMParser

- java.lang.Object
- - org.xml.sax.helpers.DefaultHandler
  - - org.h2gis.functions.io.osm.OSMParser

All Implemented Interfaces:
  `ContentHandler`, `DTDHandler`, `EntityResolver`, `ErrorHandler`

    public class OSMParser
    extends DefaultHandler

Parse an OSM file and store the elements into a database. The database model contains 10 tables.

Author:
  Erwan Bocher

### Constructor Summary

Constructors
`OSMParser​(Connection connection, File fileName, String encoding, boolean deleteTable)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `endDocument()`
`void` `endElement​(String uri, String localName, String qName)`
`String[]` `read​(String tableName, org.h2gis.api.ProgressVisitor progress)` Read the OSM file and create its corresponding tables.
`void` `startElement​(String uri, String localName, String qName, Attributes attributes)`

### Methods inherited from class org.xml.sax.helpers.DefaultHandler

`characters, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### OSMParser

    public OSMParser​(Connection connection,
                     File fileName,
                     String encoding,
                     boolean deleteTable)

### Method Detail

#### read

    public String[] read​(String tableName,
                         org.h2gis.api.ProgressVisitor progress)
                  throws SQLException

Read the OSM file and create its corresponding tables.

Parameters:
  `tableName` -
  `progress` -
Returns:
Throws:
  `SQLException`

#### startElement

    public void startElement​(String uri,
                             String localName,
                             String qName,
                             Attributes attributes)
                      throws SAXException

Specified by:
  `startElement` in interface `ContentHandler`
Overrides:
  `startElement` in class `DefaultHandler`
Throws:
  `SAXException`

#### endDocument

    public void endDocument()
                     throws SAXException

Specified by:
  `endDocument` in interface `ContentHandler`
Overrides:
  `endDocument` in class `DefaultHandler`
Throws:
  `SAXException`

#### endElement

    public void endElement​(String uri,
                           String localName,
                           String qName)
                    throws SAXException

Specified by:
  `endElement` in interface `ContentHandler`
Overrides:
  `endElement` in class `DefaultHandler`
Throws:
  `SAXException`