org.h2gis.drivers.osm
Class OSMParser

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.h2gis.drivers.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
OSMParser()
           
 
Method Summary
 void endDocument()
           
 void endElement(String uri, String localName, String qName)
           
 boolean read(Connection connection, String tableName, File inputFile, 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()
Method Detail

read

public boolean read(Connection connection,
                    String tableName,
                    File inputFile,
                    ProgressVisitor progress)
             throws SQLException
Read the OSM file and create its corresponding tables.

Parameters:
inputFile -
tableName -
connection -
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


Copyright © 2015 IRSTV CNRS-FR-2488. All Rights Reserved.