Il dataset OpenStreetMap

Questa pagina spiega come utilizzare il dataset di OpenStreetMap per il testing.

Schema del database

Lo schema del database è disponibile qui. Per importarlo:

mysqladmin create osm
cat osmdb06.sql | mysql osm

Per default, questo schema utilizza un misto di tabelle InnoDB e MyISAM. Per convertirle in Aria:

sed -i -e 's/InnoDB/Aria/gi' osmdb06.sql
sed -i -e 's/MyISAM/Aria/gi' osmdb06.sql

30 tabelle vengono create.

Data

I dati sono forniti come file XML (estensione .OSM) che possono essere caricati in MariaDB con il tool Osmosis. Esso è disponibile su dev.openstreetmap.org. E' noto che la versione 0.36 funziona.

Sono disponibili vari file .OSM, tra cui tutto il mondo (>200Gb unzippato) e i singoli stati.

I dati si possono caricare dalla riga di comando (l'esempio utilizza il file bulgaria.osm, lo si sostituisca con quello desiderato):

chmod +x bin/osmosis
bin/osmosis --read-xml file=bulgaria.osm --write-apidb dbType="mysql" host="localhost:port" validateSchemaVersion=no database="osm" user="root" password="<password-goes-here>"

I dati vengono inseriti in 19 tabelle, come si vede di seguito:

MariaDB [(none)]> use information_schema;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [information_schema]> select TABLE_NAME, TABLE_ROWS from TABLES
    -> where TABLE_ROWS > 0
    -> AND
    -> TABLE_SCHEMA='osm'
    -> ORDER BY TABLE_ROWS DESC;
+--------------------------+------------+
| TABLE_NAME               | TABLE_ROWS |
+--------------------------+------------+
| current_way_nodes        |    1559099 |
| way_nodes                |    1559099 |
| current_nodes            |    1477247 |
| nodes                    |    1477247 |
| node_tags                |     311751 |
| way_tags                 |     287585 |
| ways                     |     100007 |
| current_ways             |     100007 |
| changeset_tags           |      18738 |
| current_relation_members |      14560 |
| relation_members         |      14560 |
| changesets               |       9369 |
| relation_tags            |       3948 |
| current_relations        |        937 |
| relations                |        937 |
| users                    |        537 |
+--------------------------+------------+
16 rows in set (0.00 sec)

Commenti

Sto caricando i commenti......
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.