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
Parse an OSM file and store the elements into a database. The database model
contains 10 tables.
- Author:
- Erwan Bocher
-
Constructor Summary
ConstructorsConstructorDescriptionOSMParser(Connection connection, File fileName, String encoding, boolean deleteTable) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidendElement(String uri, String localName, String qName) String[]Read the OSM file and create its corresponding tables.voidstartElement(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, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
OSMParser
-
-
Method Details
-
read
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:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
endDocument
- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-