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 Constructor Description OSMParser(Connection connection, File fileName, String encoding, boolean deleteTable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendDocument()voidendElement(String uri, String localName, String qName)String[]read(String tableName, org.h2gis.api.ProgressVisitor progress)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, warning
-
-
-
-
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:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
endDocument
public void endDocument() throws SAXException- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
-