You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-16
Original file line number
Diff line number
Diff line change
@@ -18,14 +18,14 @@ This package provides helpful utilities for researchers to easily download and r
18
18
19
19
*[Installation](#installation)
20
20
*[Quick start - A brief example of processing data of the "Greater London"](#quick-start)
21
-
*[*1.* Download data](#download-data)
22
-
*[*2.* Read/parse data](#read-parse-data)
23
-
*[*2.1* .osm.pbf](#pbf-data)
24
-
*[*2.2* .shp.zip / .shp](#shp-zip-data)
25
-
*[*3.* Import and retrieve data with a PostgreSQL server](#import-retrieve-data)
26
-
*[*3.1* Import the data to the database](#import-the-data-to-the-database)
27
-
*[*3.2* Retrieve data from the database](#retrieve-data-from-the-database)
28
-
*[*3.3* Import data of all subregions of a given (sub)region to the database](#import-data-of-all-subregions)
21
+
*[1. Download data](#download-data)
22
+
*[2. Read/parse data](#read-parse-data)
23
+
*[2.1 .osm.pbf](#pbf-data)
24
+
*[2.2 .shp.zip / .shp](#shp-zip-data)
25
+
*[3. Import and retrieve data with a PostgreSQL server](#import-retrieve-data)
26
+
*[3.1 Import the data to the database](#import-the-data-to-the-database)
27
+
*[3.2 Retrieve data from the database](#retrieve-data-from-the-database)
28
+
*[3.3 Import data of all subregions of a given (sub)region to the database](#import-data-of-all-subregions)
29
29
*[Copyright & License](#footnote)
30
30
31
31
---
@@ -72,7 +72,7 @@ For a quick start, some examples are provided below, which demonstrate a few cor
72
72
73
73
74
74
75
-
### *1.* Download data <aname="download-data"></a>
75
+
### 1. Download data <aname="download-data"></a>
76
76
77
77
To download the OSM data for a region (or rather, a subregion) of which the data extract is available, you need to specify the name of the region (e.g. "Greater London"):
78
78
@@ -124,13 +124,13 @@ The *.pbf* data file will then be saved to the `download_dir` as specified.
124
124
125
125
126
126
127
-
### *2.* Read/parse data <aname="read-parse-data"></a>
127
+
### 2. Read/parse data <aname="read-parse-data"></a>
128
128
129
129
The package can read/parse the OSM data extracts in both *.pbf* and *.shp.zip* (and *.shp*).
130
130
131
131
132
132
133
-
#### *2.1* .osm.pbf data <aname="pbf-data"></a>
133
+
#### 2.1 .osm.pbf data <aname="pbf-data"></a>
134
134
135
135
Parsing the *.pbf* data relies mainly on [GDAL/OGR](https://pypi.org/project/GDAL/), using `read_osm_pbf()` function.
136
136
@@ -169,7 +169,7 @@ If `update=False`, when you run `read_osm_pbf(subregion_name)` again, the functi
169
169
170
170
171
171
172
-
#### *2.2* .shp.zip / **.shp** data <aname="shp-zip-data"></a>
172
+
#### 2.2 .shp.zip / **.shp** data <aname="shp-zip-data"></a>
173
173
174
174
You can read the *.shp.zip* and *.shp* file of the above `subregion_name` (i.e. 'London') by using `read_shp_zip()`, which relies mainly on [GeoPandas](http://geopandas.org/):
175
175
@@ -219,7 +219,7 @@ print(default_fp_)
219
219
220
220
221
221
222
-
### *3.* Import and retrieve data with a PostgreSQL server <aname="import-retrieve-data"></a>
222
+
### 3. Import and retrieve data with a PostgreSQL server <aname="import-retrieve-data"></a>
223
223
224
224
The package provides a class, named "OSM", which communicates with [PostgreSQL](https://www.postgresql.org/) server.
225
225
@@ -243,7 +243,7 @@ If the database "osm_pbf_data_extracts" does not exist before the connection is
243
243
244
244
245
245
246
-
#### *3.1* Import the data to the database <aname="import-the-data-to-the-database"></a>
246
+
#### 3.1 Import the data to the database <aname="import-the-data-to-the-database"></a>
247
247
248
248
To import `greater_london` (i.e. the parsed .pbf data of "London") to the database, "osm_pbf_data_extracts":
249
249
@@ -257,7 +257,7 @@ Each element (i.e. layer) of `greater_london` will be stored in a different sche
257
257
258
258
259
259
260
-
#### *3.2* Retrieve data from the database <aname="retrieve-data-from-the-database"></a>
260
+
#### 3.2 Retrieve data from the database <aname="retrieve-data-from-the-database"></a>
#### *3.3* Import data of all subregions of a given (sub)region to the database <aname="import-data-of-all-subregions"></a>
294
+
#### 3.3 Import data of all subregions of a given (sub)region to the database <aname="import-data-of-all-subregions"></a>
295
295
296
296
Find all subregions (without sub-subregions) of a (sub)region. For example, to find [all subregions](https://download.geofabrik.de/central-america.html) of "Central America":
0 commit comments