Update of "OSM tools"
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: 49ca03ea630f3c48b886b388297e61eaf51150d0
Page Name:OSM tools
Date: 2014-11-13 15:47:10
Original User: sandro
Parent: 3e5b28728186b4c34e218b7d21373e3ffac22d41
Content

Few basic notices you must absolutely know about OSM datasets

Open Street Map (OSM) is a community-driven project aimed to produce a high-quality detailed map of the world.
OSM datasets are freely available under the Open Database license terms: two popular download sites are Geofabrik and CloudMade

OSM adopts a quasi-topological data model: map object are represented accordingly to the following object hierarchy:
All OSM map objects can be eventually qualified by a rich set of data attributes:
Usually OSM datasets are released as XML file: so the following XML snippet will probably help you to better understand the general OSM data model:
<node id="1001" lat="6.6" lon="7.7" version="1" changeset="2" user="eta" uid="6" timestamp="2005-02-28T17:45:15Z">
    <tag key="created_by" value="JOSM" />
    <tag key="tourism" value="camp_site" />
</node>
<way id="5000" version="1" changeset="2" user="eta" uid="6" timestamp="2005-02-28T17:45:15Z">
    <nd ref="1001" />
    <nd ref="1002" />
    <nd ref="1003" />
    <tag key="created_by" value="JOSM" />
    <tag key="tourism" value="camp_site" />
</way>
<relation id="9000" version="1" changeset="2" user="eta" uid="6" timestamp="2005-02-28T17:45:15Z">
    <member type="way" ref="5000" role="outer" />
    <member type="way" ref="5001" role="inner" />
    <tag key="created_by" value="JOSM" />
    <tag key="tourism" value="camp_site" />
<relation>

Usually OSM datasets can be downloaded in two different formats:

spatialite_osm_map

This tool is intended to parse a whole OSM dataset, thus creating the corresponding SpatiaLite's DB-file.
Geometries are reassembled in the canonical form of POINTs, LINESTRINGs and POLYGONs.
Maps objects are then aggregated by distinct omogeneous layers (aka tables in DBMS parlance) accordingly to declared tags.
The intended goal of this tool is the one to produce a DB-file suited to be immediately used with some appropriate GIS application (e.g. QGIS).
Want to learn more ? read a practical example

spatialite_osm_raw

Also this tool is intended to parse a whole OSM dataset, thus creating the corresponding SpatiaLite's DB-file; but in this case the generated DB-file will adopt a completely different data layout than in the previous scenario.
In this case will be adopted a data layout closely mapping OSM objects, their data attributes and their mutual relationships; fully preserving the original OSM data model, and carefully avoiding to introduce any unpleasant information suppression.
The intended goal of this tool is not at all to produce a DB-file usable by GIS applications: it's instead the one to get a DB-file you can use in order to gather statistical infos, to support some post-processing task and so on.
Want to learn more ? read a practical example

spatialite_osm_filter

This tool works the opposite way: a DB-file (one previously created by spatialite_osm_raw) will be processed so to create an OSM-XML file.
A mask (i.e. an arbitrary polygonal shape) will be used in order to spatially filter the map objects to be inserted into the output file. Any map object fully or partially overlapping the given mask will be exported; any other object will be silently ignored.
The intended goal of this tool is the one to produce selected datasets, to be further processed.
Want to learn more ? read a practical example

spatialite_osm_net

Yet again this tool will parse a whole OSM dataset, thus creating a corresponding SpatiaLite's DB-file.
In this specific case any possible effort will be done in order to extract from the OSM dataset a valid Road (or Railway) Network represented by Nodes and Arcs.
The intended goal of this tool is the one to produce a valid graph to be used in a later step in order to support the SpatiaLite's own Routing module (VirtualNetwork).
Want to learn more ? read a practical example, and get more detailed infos about OSM Networks and graphs

spatialite_osm_overpass

Yet another tool intended to support OSM datasets; coarsely speaking it could be considered a strict equivalent of spatialite_osm_raw, spatialite_osm_map and spatialite_osm_net altogether.
Anyway spatialite_osm_overpass is an advanced web client, and consequently it has the capability to directly query a remote server supporting the OSM Overpass API.
There is no need to preventively download any input file of the OSM-XML or ProtoBuf type; spatialite_osm_overpass will dynamically query the Overpass API server thus precisely extracting on the fly any required data.
And it will immediately perform any appropriate post-processing task so to create in a single pass a DB-file containing a selected OSM dataset.
Want to learn more ? read a practical example