Downloading data - OpenStreetMap Wiki
Downloading data
From OpenStreetMap Wiki
(Redirected from
Jump to navigation
Jump to search
Help
Downloading data
In other languages
Afrikaans
asturianu
azərbaycanca
Bahasa Indonesia
Bahasa Melayu
bosanski
brezhoneg
català
čeština
Crnogorski
dansk
eesti
Esperanto
euskara
Frysk
Gàidhlig
galego
hrvatski
Ido
interlingua
íslenska
italiano
Kreyòl ayisyen
kréyòl gwadloupéyen
kurdî
latviešu
Lëtzebuergesch
lietuvių
magyar
Nederlands
norsk
norsk nynorsk
occitan
polski
português
română
sardu
shqip
slovenčina
slovenščina
srpski (latinica)
suomi
svenska
Tagalog
Tiếng Việt
Türkçe
Zazaki
Ελληνικά
беларуская
български
македонски
монгол
русский
српски / srpski
українська
հայերեն
עברית
العربية
سرائیکی
فارسی
پنجابی
پښتو
नेपाली
मराठी
हिन्दी
বাংলা
ਪੰਜਾਬੀ
தமிழ்
മലയാളം
සිංහල
ไทย
မြန်မာဘာသာ
한국어
ქართული
ⵜⴰⵎⴰⵣⵉⵖⵜ
中文(简体)
中文(繁體)
粵語
Other languages...
It is possible to
download map data
from the OpenStreetMap dataset in a number of ways. The full dataset is available from the OpenStreetMap website
area. It is also possible to select smaller areas to download. Data normally comes in the form of
.osm
files in the
OSM XML
format. If you just want to use a "map" (e.g. for a GPS device) then you likely do not want to download this raw data, instead see
other OSM download options
Some things to consider:
The entire planet is a lot of data. Start with a regional extract to make sure your setup works properly. Common tools like
Osmosis
or various import tools for
database
imports and converters take hours or days to import data, depending largely on disk speed.
OpenStreetMap is a federative project. That means that a lot of essential resources are provided by third party providers. Be bold, try to download there first. The official
servers
aren't huge data centres and don't have ample resources. They are rather dedicated to keep the data flow in sync.
Some tools are OK only for small scale or specific use, for example
OSM editing API
must not be misused for bulk downloads
Contents
All data at once
Huge amounts of data
Small amounts of data
3.1
For mobile navigation devices
3.2
Dedicated tools
3.3
For editing
3.3.1
Choose your region
3.3.2
Construct a URL for the HTTP API
3.3.3
Download the data
See also
All data at once
Planet.osm
contains the entire planet. This is a snapshot of the current data, usually from last Wednesday. As of 2025 it is about 100 GB compressed or 2 TB uncompressed, and growing each day.
The
planet history
contains the history of almost all objects and is even bigger.
Probably the easiest and fastest way to download the whole planet file is using a
Bittorrent client
Alternatively, you can use the
download-osm
tool from the
OpenMapTiles
project to quickly download the entire planet from multiple mirrors at once, without overloading the primary server. The tool will ensure the download data is consistent with an MD5 hash. It can also be used to download and validate regional extracts from
Geofabrik
BBBike
, and
OSM.fr
The easiest way is to run the tool using
Docker
. For example, share the current directory and let the tool place your file there. Anything after the
--
is passed to
aria2c
. Here's an example Linux/macOS command. The one for Windows should be similar.
docker run --rm -it -v $PWD:/download openmaptiles/openmaptiles-tools \
download-osm planet -- -d /download
Use
download-osm --help
for documentation.
Huge amounts of data
Several
extract services
allow you to download more manageable file sizes, from an entire continent to parts of a country. Popular services include
Geofabrik
(multiple file formats),
OpenPlanetData
(daily planet snapshots in PBF and GOL format) and
SliceOSM
(arbitrary geographies). Tools like
Osmosis
osmconvert
, and
osmfilter
will assist you to extract specific data from these extracts.
Layercake
provides thematic layers of OSM in GeoParquet format.
Overpass API
and the
Export Tool
allow to download custom data sets like arbitrary bounding boxes, elements with specific tags, public transport networks or other features.
Small amounts of data
For mobile navigation devices
See
Processed data providers
, especially
BBBike.org's
custom extraction service.
Dedicated tools
Overpass API
, maybe using
Overpass Turbo
is a great tool here described in detail on its own pages.
One can
download all data in some small area
or make more
advanced filtering
Using the
export
tab, one can select a piece of the map and download the data in several formats, including OSM XML. This intentionally works only at high zoom levels.
For editing
main api
can be used to download data for editing.
A basic operation of the OpenStreetMap
API
, is the 'map' request. For the relevant API documentation see:
API v0.6#Retrieving map data by bounding box: GET /api/0.6/map
. Furthermore, the
main api
allows you to download the XML of single elements and the history of each of these elements. It is dedicated to editing, not downloads. Don't use this for mass requests, because this is resource intensive. Please use
Overpass API
instead.
JOSM
provides a useful interface for selecting the area you wish to download, and instant visualization of all the data you have downloaded. You can edit the data to re-upload it later. You can also save the data to
.osm
file (
JOSM file format
) for further processing. But because it employs the main API, it is not intended for downloading large quantities of data.
Note that use of the API (and especially bbox map data requests) is subject to our
API usage policy
. Heavy use (or large numbers of requests from
many
users) should use one of the above mentioned services instead.
Choose your region
The region is specified by a
bounding box
, which consists of a minimum and maximum latitude and longitude. Choose as small a region as will be useful to you, since larger regions will result in larger data files, longer download times, and heavier load on the server. The server may reject your region if it is larger than 1/4 degree in either dimension. When you're first starting out, choose a very small region so that you can figure things out quickly with small data sets.
There are several ways of finding latitude and longitude values. Since we are interested in a bounding box, perhaps the clearest way is to use the bounding box selection features of the 'export data' link. On the
homepage map
pan and zoom to roughly the right area, and then click the 'export data' (link on the left). This sidebar display includes the four values you need for a bounding box matching the extents of the viewport. Click 'Manually select a different area' and then drag a box to select exactly the region you want.
Construct a URL for the HTTP API
You must now construct an API request URL as specified in the
map request docs
. In the URL, a bounding box is expressed as four comma-separated numbers, in this order: left, bottom, right, top (min long, min lat, max long, max lat). Latitude and longitude are expressed in decimal degrees. North latitude is positive, south latitude is negative. West longitude is negative, east longitude is positive. The method described in the previous section will give you suitable values.
Example:
The API is limited to bounding boxes of about 0.5 degree by 0.5 degree and you should avoid using it for larger areas if possible.
Download the data
You can just type this URL into a browser if you want, but that may not work as well as you'd hope, especially if the data is large. If you know how to use them, command-line tools like
wget
and
curl
will do a better job.
If you've specified a region with a lot of data, you may have to wait a while before the HTTP response begins (the server is crunching your request). If your client times out, try setting options for a longer timeout, or choose a smaller region.
Here's an example command line for
wget
wget -O muenchen.osm "https://api.openstreetmap.org/api/0.6/map?bbox=11.54,48.14,11.543,48.145"
See also
Databases and data access APIs
Converting map data between formats
Planet.osm
Overpass API
GeoDownloader
Category:OSM processing
Processed data providers
A decision tree on different download tools and for which use-case they are most suited
(based on the viewpoint of the
ohsome
platform)
Retrieved from "
Categories
Technical guide
OSM API
OSM processing
Unix command examples
Hidden categories:
Pages unavailable in Italian
Pages unavailable in Dutch
Navigation menu