User Tools

Site Tools


gis_data

OpenStreetMap

OSM map data

Use OSM data with QGIS

Step 1: Download OSM data, e.g. an export from Geofabrik in the space-saving binary pbf-format

wget http://download.geofabrik.de/europe/austria-latest.osm.pbf

Step 2: Configure GDAL (which is used by QGIS to import OSM data) to import all attributes you are interested in

/usr/share/gdal/1.10/osmconf.ini

Step 3: Extract your area of interest and convert it into a SpatiaLite (SQLite) database - a format QGIS can handle easily. The -spat argument takes latitude / longitude in the following order: -spat minLon minLat maxLon maxLat

#ogr2ogr -f "SQLite" -spat minLon minLat maxLon maxLat snippet.db austria-latest.osm.pbf
ogr2ogr -f "SQLite" -spat 16.34 48.19 16.36 48.20 snippet.db austria-latest.osm.pbf

Alternative: use Osmosis to snip your area of interest (you could also use –write-xml to create an OSM XML file to e.g. open it in JOSM)

osmosis --read-pbf austria-latest.osm.pbf --bounding-box left=16.34 bottom=48.19 right=16.36 top=48.20 --write-pbf snippet.pbf

Step 4: Use pretty predefined styles to visualize the map.

Sources:
http://anitagraser.com/2014/05/31/a-guide-to-googlemaps-like-maps-with-osm-in-qgis
http://anitagraser.com/2014/06/07/toner-lite-styles-for-qgis/

OSM GPX planet

In April 2013, OSM announced a new dataset containing GPS tracks. Full dataset and extracts (e.g. for Europe) are available. The OSM wiki of course has more information for this dataset.

What's inside

Looking at a small excerpt - us-pacific.tar.xz, downloaded 2013-04-23 - the following can be said:

The compressed dataset has 16MB, the uncompressed has 340MB.

The metadata file contains an entry per track. Each entry has an id, a timestamp depending on the privacy setting,

The tracks are grouped in directories according to their visibility. Public, trackable and identifiable tracks are included. Private tracks are not contained within the dataset.

Uploaded GPX tracks must have a timestamp for each GPS positions. However the timestamps may be anonymised (e.g. by using JOSM.

The dataset may contain tracks that show obvious errors (e.g. spatial error and a track is located in the ocean).

gis_data.txt · Last modified: 2015/02/11 16:57 by mstraub