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. (11) table_prefix + _relation_member : table that stores all relations that are referenced into a relation.

Author:
  Erwan Bocher

### Field Summary

Fields
`static String` `NODE`
`static String` `NODE_MEMBER`
`static String` `NODE_TAG`
`static String` `RELATION`
`static String` `RELATION_MEMBER`
`static String` `RELATION_TAG`
`static String` `TAG`
`static String` `WAY`
`static String` `WAY_MEMBER`
`static String` `WAY_NODE`
`static String` `WAY_TAG`

### Method Summary

All Methods Static Methods Concrete Methods
`static PreparedStatement` `createNodeMemberTable(Connection connection, String nodeMemberTable)` Create the node members table
`static PreparedStatement` `createNodeTable(Connection connection, String nodeTableName, boolean isH2)` Create the nodes table that will be used to import OSM nodes Example :
`static PreparedStatement` `createNodeTagTable(Connection connection, String nodeTagTableName, String tagTableName)` 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, String tagTableName)` Create the relation tags table
`static PreparedStatement` `createTagTable(Connection connection, String tagTableName)` Create the tag table to store all key and value
`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, boolean isH2)` Create the ways table that will be used to import OSM ways Example :
`static PreparedStatement` `createWayTagTable(Connection connection, String wayTagTableName, String tagTableName)` Create a table to store the way tags.
`static void` `dropOSMTables(Connection connection, boolean isH2, 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 Detail

#### TAG

    public static final String TAG

See Also:
  Constant Field Values

#### 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 Detail

#### createTagTable

    public static PreparedStatement createTagTable(Connection connection,
                                                   String tagTableName)
                                            throws SQLException

Create the tag table to store all key and value

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

#### createNodeTable

    public static PreparedStatement createNodeTable(Connection connection,
                                                    String nodeTableName,
                                                    boolean isH2)
                                             throws SQLException

Create the nodes table that will be used to import OSM nodes Example :

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

#### createNodeTagTable

    public static PreparedStatement createNodeTagTable(Connection connection,
                                                       String nodeTagTableName,
                                                       String tagTableName)
                                                throws SQLException

Create a table to store the node tags.

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

#### createWayTable

    public static PreparedStatement createWayTable(Connection connection,
                                                   String wayTableName,
                                                   boolean isH2)
                                            throws SQLException

Create the ways table that will be used to import OSM ways Example :

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

#### createWayTagTable

    public static PreparedStatement createWayTagTable(Connection connection,
                                                      String wayTagTableName,
                                                      String tagTableName)
                                               throws SQLException

Create a table to store the way tags.

Parameters:
  `connection` -
  `wayTagTableName` -
  `tagTableName` -
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,
                                                           String tagTableName)
                                                    throws SQLException

Create the relation tags table

Parameters:
  `connection` -
  `tagTableName` -
  `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,
                                     boolean isH2,
                                     String tablePrefix)
                              throws SQLException

Drop the existing OSM tables used to store the imported OSM data

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