Package org.h2gis.functions.io.osm

# Class OSMTablesFactory

java.lang.Object
org.h2gis.functions.io.osm.OSMTablesFactory

public class OSMTablesFactory extends Object
Class to create the tables to import osm data An OSM file is stored in 10 tables. (1) table_prefix + _node : table that contains all nodes, (2) table_prefix + _node_tag : table that contains a list of tags (key, value) for each node, (3) table_prefix + _way : table that contains all ways with their geometries, (4) table_prefix + _way_tag : table that contains a list of tags (key, value) for each way, (5) table_prefix + _way_node : table that contains the list of nodes used to represent a way, (6) table_prefix + _relation: table that contains all relations, (7) table_prefix + _relation_tag : table that contains a list of tags (key, value) for each relation, (8) table_prefix + _node_member : table that stores all nodes that are referenced into a relation, (9) table_prefix + _way_member : table that stores all ways that are referenced into a relation, (10) table_prefix + _relation_member : table that stores all relations that are referenced into a relation.

Author:
  Erwan Bocher

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`NODE`
`static final String`
`NODE_MEMBER`
`static final String`
`NODE_TAG`
`static final String`
`RELATION`
`static final String`
`RELATION_MEMBER`
`static final String`
`RELATION_TAG`
`static final String`
`WAY`
`static final String`
`WAY_MEMBER`
`static final String`
`WAY_NODE`
`static final String`
`WAY_TAG`

## Method Summary

Modifier and Type
Method
Description
`static PreparedStatement`
`createNodeMemberTable(Connection connection, String nodeMemberTable)`
Create the node members table
`static PreparedStatement`
`createNodeTable(Connection connection, String nodeTableName)`
Create the nodes table that will be used to import OSM nodes Example : `<node id="298884269" lat="54.0901746" lon="12.2482632" user="SvenHRO"` uid="46882" visible="true" version="1" changeset="676636" timestamp="2008-09-21T21:37:45Z"/>
`static PreparedStatement`
`createNodeTagTable(Connection connection, String nodeTagTableName)`
Create a table to store the node tags.
`static PreparedStatement`
`createRelationMemberTable(Connection connection, String relationMemberTable)`
Store all relation members
`static PreparedStatement`
`createRelationTable(Connection connection, String relationTable)`
Create the relation table.
`static PreparedStatement`
`createRelationTagTable(Connection connection, String relationTagTable)`
Create the relation tags table
`static PreparedStatement`
`createWayMemberTable(Connection connection, String wayMemberTable)`
Create a table to store all way members.
`static PreparedStatement`
`createWayNodeTable(Connection connection, String wayNodeTableName)`
Create a table to store the list of nodes for each way.
`static PreparedStatement`
`createWayTable(Connection connection, String wayTableName)`
Create the ways table that will be used to import OSM ways Example : `<way id="26659127" user="Masch" uid="55988" visible="true" version="5"` changeset="4142606" timestamp="2010-03-16T11:47:08Z">
`static PreparedStatement`
`createWayTagTable(Connection connection, String wayTagTableName)`
Create a table to store the way tags.
`static void`
`dropOSMTables(Connection connection, String tablePrefix)`
Drop the existing OSM tables used to store the imported OSM data

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

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

## Field Details

### NODE

public static final String NODE

See Also:
  - Constant Field Values

### WAY

public static final String WAY

See Also:
  - Constant Field Values

### NODE_TAG

public static final String NODE_TAG

See Also:
  - Constant Field Values

### WAY_TAG

public static final String WAY_TAG

See Also:
  - Constant Field Values

### WAY_NODE

public static final String WAY_NODE

See Also:
  - Constant Field Values

### RELATION

public static final String RELATION

See Also:
  - Constant Field Values

### RELATION_TAG

public static final String RELATION_TAG

See Also:
  - Constant Field Values

### NODE_MEMBER

public static final String NODE_MEMBER

See Also:
  - Constant Field Values

### WAY_MEMBER

public static final String WAY_MEMBER

See Also:
  - Constant Field Values

### RELATION_MEMBER

public static final String RELATION_MEMBER

See Also:
  - Constant Field Values

## Method Details

### createNodeTable

public static PreparedStatement createNodeTable(Connection connection, String nodeTableName) throws SQLException
Create the nodes table that will be used to import OSM nodes Example : `<node id="298884269" lat="54.0901746" lon="12.2482632" user="SvenHRO"` uid="46882" visible="true" version="1" changeset="676636" timestamp="2008-09-21T21:37:45Z"/>

Parameters:
  `connection` -
  `nodeTableName` -
Returns:
Throws:
  `SQLException`

### createNodeTagTable

public static PreparedStatement createNodeTagTable(Connection connection, String nodeTagTableName) throws SQLException
Create a table to store the node tags.

Parameters:
  `connection` -
  `nodeTagTableName` -
Returns:
Throws:
  `SQLException`

### createWayTable

public static PreparedStatement createWayTable(Connection connection, String wayTableName) throws SQLException
Create the ways table that will be used to import OSM ways Example : `<way id="26659127" user="Masch" uid="55988" visible="true" version="5"` changeset="4142606" timestamp="2010-03-16T11:47:08Z">

Parameters:
  `connection` -
  `wayTableName` -
Returns:
Throws:
  `SQLException`

### createWayTagTable

public static PreparedStatement createWayTagTable(Connection connection, String wayTagTableName) throws SQLException
Create a table to store the way tags.

Parameters:
  `connection` -
  `wayTagTableName` -
Returns:
Throws:
  `SQLException`

### createWayNodeTable

public static PreparedStatement createWayNodeTable(Connection connection, String wayNodeTableName) throws SQLException
Create a table to store the list of nodes for each way.

Parameters:
  `connection` -
  `wayNodeTableName` -
Returns:
Throws:
  `SQLException`

### createRelationTable

public static PreparedStatement createRelationTable(Connection connection, String relationTable) throws SQLException
Create the relation table.

Parameters:
  `connection` -
  `relationTable` -
Returns:
Throws:
  `SQLException`

### createRelationTagTable

public static PreparedStatement createRelationTagTable(Connection connection, String relationTagTable) throws SQLException
Create the relation tags table

Parameters:
  `connection` -
  `relationTagTable` -
Returns:
Throws:
  `SQLException`

### createNodeMemberTable

public static PreparedStatement createNodeMemberTable(Connection connection, String nodeMemberTable) throws SQLException
Create the node members table

Parameters:
  `connection` -
  `nodeMemberTable` -
Returns:
Throws:
  `SQLException`

### createWayMemberTable

public static PreparedStatement createWayMemberTable(Connection connection, String wayMemberTable) throws SQLException
Create a table to store all way members.

Parameters:
  `connection` -
  `wayMemberTable` -
Returns:
Throws:
  `SQLException`

### createRelationMemberTable

public static PreparedStatement createRelationMemberTable(Connection connection, String relationMemberTable) throws SQLException
Store all relation members

Parameters:
  `connection` -
  `relationMemberTable` -
Returns:
Throws:
  `SQLException`

### dropOSMTables

public static void dropOSMTables(Connection connection, String tablePrefix) throws SQLException
Drop the existing OSM tables used to store the imported OSM data

Parameters:
  `connection` -
  `tablePrefix` -
Throws:
  `SQLException`