Practice - Visualization Using OpenStreetMap Data
Practice - Visualization Using OpenStreetMap Data
on Using OpenStreetMa
p Data
Content
• Data Features
• Data Extractions
• Data Applications
OpenStreetMap Basics
• OpenStreetMap (OSM) is a collaborative project tha
t creates and distributes free geographic data for th
e world.
• Not “Open Street Maps”
• Created by Steve Coast in the UK in 2004
OSM homepage (https://www.openstreetmap.org/)
Data Features
• “Wikipedia of Maps” — it’s editable by anyone with
an account.
• It’s a prominent example of volunteered geographic
information.
• It’s a very large database of XML data.
• It changes and grows all the time.
• It’s data quality varies across the world.
Data Features
• It’s not a rendered map, rather than the map itself,
the data generated by the project is considered its
primary output.
• It’s not proprietary—anyone can use it for free as l
ong as they provide proper credit
• It’s not controlled by an authority—it is driven and
maintained by a large community of contributors a
nd data consumers
Mapping in Haiti
Mapping in Haiti
OSM Data Editing Tools
Web-based editor
• iD — default editor, html5
• Potlatch — old version, flash
More powerful desktop application, for advanced use
rs
• JOSM (Java OpenStreetMap, cross platform)
• Merkaartor
OSM iD Editor(recommended)
• OpenStreetMap uses a topological data structure,
with four core elements : node, way, relation and t
ag (also known as data primitives).
…
• Tags are key-value pairs. They are used to store met
adata about the map objects (such as their type, th
eir name and their physical properties). Tags are no
t free-standing, but are always attached to an objec
t: to a node, a way or a relation. A recommended o
ntology of map features (the meaning of tags) is ma
intained on wiki page of OSM.
• Relations are used for representing the relationship
of existing nodes and ways. Relations are ordered li
sts of nodes, ways and relations (together called "m
embers"), where each member can optionally have
a "role" (a string). Examples include bus routes, ad
ministrative boundaries and areas with holes.
Data Extractions
• The main copy of the OSM data is stored in OSM's
main database. The main database is a PostgreSQL
database with PostGIS extension, which has one tab
le for each data primitive, with individual objects st
ored as rows. All edits happen in this database, and
all other formats are created from it.
• For data transfer, several database dumps are creat
ed, which are available for download. The complete
dump (the OpenStreetMap data in one file, XML or
PBF format) includes all the nodes, ways and relatio
ns that make up the map. It is a big file about 1000
GB.
• There are also files called extracts which contain Op
enStreetMap data for individual continents, countri
es, and metropolitan areas.
• Homepage export tool
https://api.openstreetmap.
org/api/0.6/map?
bbox=114.3487900,
30.5275100, 114.3622000,
30.5340100
Get original XML file,
need further conversion
to be used in practice
• Planet OSM — Regularly updated copies of the co
mplete OpenStreetMap database
• Each week, a new and complete copy of all data in
OpenStreetMap is made available as both a compre
ssed XML file and a custom PBF format file. Also ava
ilable is the 'history' file which contains not only up-
to-date data but also older versions of data and del
eted data items.
Support shapefile,
size is reasonable
• QGIS
Work directly with
provided data
Commonly used
data format
Flexible extent
QuickOSM plugin, based on OverPass API, support key value query
• ArcGIS Editor for OpenStreetMap
• Overpass Turbo (recommended)
• A web-based data filtering tool for OpenStreetMap
• With Overpass Turbo you can run Overpass API que
ries and analyze the resulting OSM data interactivel
y on a map. There is an integrated Wizard which ma
kes creating queries easy.
• If you’d like to extract OpenStreetMap features pro
grammatically rather than with a user interface, you
can check out the Overpass API for more informatio
n.
input your query on the left, click ‘run’, features you queried will be highlighted in the map
• First, you need to find the proper tags for those feat
ures you want to download. You can do this by ope
ning OpenStreetMap and clicking a feature to find it
s tags or by searching the OpenStreetMap Map Fea
tures wiki. By searching the wiki you can find the ke
ys and values that most closely resemble the featur
es you want to query.
• When you first launch Overpass Turbo, it starts you
off with an example for querying drinking fountains.
Overpass Turbo uses a simplified version of the XQu
ery to query OpenStreetMap features.
• You must click Run for the results to be shown on t
he map. Once you’ve executed the query, Overpass
will highlight the features that meet the query cond
itions.
• Take a closer look at the structure of the query:
3. Use the “Wizard” menu option to search for map features, and automatically build queries
like this.
4. Run the queries, features you queried are highlighted in the map
5. Select the “Export” menu option, choose a file format for your data, your
data will be immediately downloaded
Process data
• Python server