back to the <a tools</a> main page<br><br>
<h3>spatialite_osm_map</h3>

<table border="1"><tr><td><pre>
usage: spatialite_osm_map ARGLIST
==============================================================
-h or --help                    print this help message
-o or --osm-path pathname       the OSM-XML file path
                 both OSM-XML (*.osm) and OSM-ProtoBuf
                 (*.osm.pbf) are indifferenctly supported.
-d or --db-path  pathname       the SpatiaLite DB path

you can specify the following options as well
-cs or --cache-size    num      DB cache size (how many pages)
-m or --in-memory               using IN-MEMORY database
-n or --no-spatial-index        suppress R*Trees generation
-jo or --journal-off            unsafe (but faster) mode


<table border="1"><tr><td><pre>
$ spatialite_osm_map -o my_country.osm.pbf -d my_country.sqlite
SQLite version: 3.7.11
SpatiaLite version: 3.1.0
UNRESOLVED-NODE 114601792
....
UNRESOLVED-WAY 39764802
VACUUMing the DB ... wait please ...
        All done: OSM map was succesfully loaded
$

the above shown command must be invoked from the shell:<ul>
<li><b>-o my_country.osm.pbf</b> selects the OSM input file (in this case, of the OSM-protobuf format).</li>
<li><b>-d my_country.sqlite</b> selects the SpatiaLite's DB-file to be created and populated.</li>
<li>you can eventually add any other DB-related optimization switch, if you think it will be useful.<br>
Want to learn more ? read the <a optimization</a> short note
</li>
</ul><br>
<u>Please note:</u> the many or messages you'll eventually see simply are harmless warnings: very often OSM datasets does actually contain several missing / broken cross-references. Don't worry, it simply means that few Map Objects cannot be correctly reconstructed, and thus will be silently discarded.<br><br>
Once the command succesfully completes its execution, you'll find a brand new DB-file just created ...<br><br>
<img alt="db-map.png" border="1"><br>
... you can explore this DB-file e.g. using ...<br><br>
<img alt="osm-map.png" border="1"><br>
... or you can connect it to a most conventional desktop-GIS application (e.g. QGIS).
<br><br>back to the <a tools</a> main page