Skip to content

Commit e4d44ff

Browse files
committed
Add more osm stuff
1 parent 7996696 commit e4d44ff

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

osm.qmd

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,40 @@ You may want to install the following packages for @sec-command-line:
3939
- [pyrosm](https://pyrosm.readthedocs.io/en/latest/)
4040
- [osm2streets](https://a-b-street.github.io/osm2streets/#1/0/0) (although this is currently mostly a web UI and does not have a command line interface)
4141

42+
We will get data representing case study areas:
43+
44+
-
45+
4246
# How and where to download OSM data {#sec-download}
4347

48+
There are two main ways to download OSM data:
49+
50+
- In small amounts, which you can get from osm.org directly, and from [services]() that host the Overpass API and provide free access.
51+
- In large amounts, which you can get from a smaller number of extract providers. Because the focus of this session is on large amounts of data, and because providers of small uncompressed datasets cannot scale to national or global datasets, we will focus on this second way of getting data, with key providers described below.
52+
53+
## Uncompressed OSM providers
54+
55+
Queries to Overpass API providers can be made directly from the [Overpass Turbo](https://overpass-turbo.eu/) web application, which has a convenient web interface that is ideal for exploring the data and writing queries iteratively.
56+
57+
Overpass users the [Overpass QL](https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL), an example of which is provided below.
58+
You can see the results of a query at this endpoint, for example: https://overpass-turbo.eu/?Q=%28%0A+++node%2851.249%2C7.148%2C51.251%2C7.152%29%3B%0A+++%3C%3B%0A%29%3B%0Aout+meta%3B
59+
60+
This can be written in Overpass QL as:
61+
62+
```overpass
63+
(
64+
node(51.249,7.148,51.251,7.152);
65+
<;
66+
);
67+
out meta;
68+
```
69+
70+
After saving this query as a file (e.g. called `query.txt`), you can download the data using the `curl` command line tool as follows:
71+
72+
```bash
73+
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d @query.txt https://overpass-api.de/api/interpreter > data.osm
74+
```
75+
4476
As outlined in the [`providers_comparison`](https://docs.ropensci.org/osmextract/articles/providers_comparisons.html) vignettte in the [`osmextract`](https://docs.ropensci.org/osmextract/) package, there are several providers of OSM data. The main ones that provide regular extracts without need for logins are:
4577

4678
- [geofabrik](https://download.geofabrik.de/)

0 commit comments

Comments
 (0)