OSMRead
Signatures
Description
Reads a OSM file from path
and creates several tables prefixed by tableName
representing the file’s contents. If deleteTables
is equal to true
, existing tables (with the same prefix) are removed.
11 tables are produced.
- (1) table_prefix + _tag : table that contains all tag keys listed in the OSM file -> ID_TAG SERIAL PRIMARY KEY, TAG_KEY VARCHAR UNIQUE.
- (2) table_prefix + _node : table that contains all nodes -> ID_NODE BIGINT PRIMARY KEY, THE_GEOM POINT,ELE DOUBLE PRECISION,USER_NAME VARCHAR,UID BIGINT,VISIBLE BOOLEAN,VERSION INTEGER,CHANGESET INTEGER,LAST_UPDATE TIMESTAMP, NAME VARCHAR.
- (3) table_prefix + _node_tag : table that contains a list of tag keys (TAG_VALUE) for each node -> ID_NODE BIGINT, ID_TAG BIGINT,TAG_VALUE VARCHAR.
- (4) table_prefix + _way : table that contains all ways -> ID_WAY BIGINT PRIMARY KEY, USER_NAME VARCHAR, UID BIGINT, VISIBLE BOOLEAN, VERSION INTEGER, CHANGESET INTEGER, LAST_UPDATE TIMESTAMP, NAME VARCHAR.
- (5) table_prefix + _way_tag : table that contains a list of tag keys (TAG_VALUE) for each way -> ID_WAY BIGINT, ID_TAG BIGINT, VALUE VARCHAR.
- (6) table_prefix + _way_node : table that contains the list of nodes used to represent a way -> ID_WAY BIGINT, ID_NODE BIGINT, NODE_ORDER INT.
- (7) table_prefix + _relation: table that contains all relations -> ID_RELATION BIGINT PRIMARY KEY,USER_NAME VARCHAR, UID BIGINT,VISIBLE BOOLEAN,VERSION INTEGER,CHANGESET INTEGER,LAST_UPDATE TIMESTAMP.
- (8) table_prefix + _relation_tag : table that contains a list of tag keys (TAG_VALUE) for each relation -> ID_RELATION BIGINT, ID_TAG BIGINT, VALUE VARCHAR.
- (9) table_prefix + _node_member : table that stores all nodes that are referenced into a relation -> ID_RELATION BIGINT,ID_NODE BIGINT, ROLE VARCHAR, NODE_ORDER INT.
- (10) table_prefix + _way_member : table that stores all ways that are referenced into a relation -> ID_RELATION BIGINT, ID_WAY BIGINT, ROLE VARCHAR, WAY_ORDER INT.
- (11) table_prefix + _relation_member : table that stores all relations that are referenced into a relation -> ID_RELATION BIGINT, ID_SUB_RELATION BIGINT, ROLE VARCHAR, RELATION_ORDER INT.
By default, the tableName
is the filename given in path
without the extension.
The OSM driver supports the following zipped extension : osm.gz and osm.bz2.
Examples
Read OSM file:
Based on the created tables, the user can build other OSM data.
H2GIS extract buildings:
PostGIS extract buildings: