Skip to content

Commit 80c1069

Browse files
committed
Updated README.md
1 parent e8074bf commit 80c1069

1 file changed

Lines changed: 16 additions & 25 deletions

File tree

README.md

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,15 @@ This package provides helpful utilities for researchers to easily download and r
1717
**<span style="font-size:larger;">Contents</span>**
1818

1919
* [Installation](#installation)
20-
2120
* [Quick start - A brief example of processing data of the "Greater London"](#quick-start)
22-
23-
1. [Download data](#download-data)
24-
25-
2. [Read/parse data](#read-parse-data)
26-
27-
2.1 [.osm.pbf](#pbf-data)
28-
29-
2.2 [.shp.zip / .shp](#shp-zip-data)
30-
31-
3. [Import and retrieve data with a PostgreSQL server](#import-retrieve-data)
32-
33-
3.1 [Import the data to the database](#import-the-data-to-the-database)
34-
35-
3.2 [Retrieve data from the database](#retrieve-data-from-the-database)
36-
37-
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)
3829
* [Copyright & License](#footnote)
3930

4031
---
@@ -81,7 +72,7 @@ For a quick start, some examples are provided below, which demonstrate a few cor
8172

8273

8374

84-
### 1. Download data <a name="download-data"></a>
75+
### *1.* Download data <a name="download-data"></a>
8576

8677
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"):
8778

@@ -133,13 +124,13 @@ The *.pbf* data file will then be saved to the `download_dir` as specified.
133124

134125

135126

136-
### 2. Read/parse data <a name="read-parse-data"></a>
127+
### *2.* Read/parse data <a name="read-parse-data"></a>
137128

138129
The package can read/parse the OSM data extracts in both *.pbf* and *.shp.zip* (and *.shp*).
139130

140131

141132

142-
#### 2.1 .osm.pbf data <a name="pbf-data"></a>
133+
#### *2.1* .osm.pbf data <a name="pbf-data"></a>
143134

144135
Parsing the *.pbf* data relies mainly on [GDAL/OGR](https://pypi.org/project/GDAL/), using `read_osm_pbf()` function.
145136

@@ -178,7 +169,7 @@ If `update=False`, when you run `read_osm_pbf(subregion_name)` again, the functi
178169

179170

180171

181-
#### 2.2 .shp.zip / **.shp** data <a name="shp-zip-data"></a>
172+
#### *2.2* .shp.zip / **.shp** data <a name="shp-zip-data"></a>
182173

183174
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/):
184175

@@ -228,7 +219,7 @@ print(default_fp_)
228219

229220

230221

231-
### 3. Import and retrieve data with a PostgreSQL server <a name="import-retrieve-data"></a>
222+
### *3.* Import and retrieve data with a PostgreSQL server <a name="import-retrieve-data"></a>
232223

233224
The package provides a class, named "OSM", which communicates with [PostgreSQL](https://www.postgresql.org/) server.
234225

@@ -252,7 +243,7 @@ If the database "osm_pbf_data_extracts" does not exist before the connection is
252243

253244

254245

255-
#### 3.1 Import the data to the database <a name="import-the-data-to-the-database"></a>
246+
#### *3.1* Import the data to the database <a name="import-the-data-to-the-database"></a>
256247

257248
To import `greater_london` (i.e. the parsed .pbf data of "London") to the database, "osm_pbf_data_extracts":
258249

@@ -266,7 +257,7 @@ Each element (i.e. layer) of `greater_london` will be stored in a different sche
266257

267258

268259

269-
#### 3.2 Retrieve data from the database <a name="retrieve-data-from-the-database"></a>
260+
#### *3.2* Retrieve data from the database <a name="retrieve-data-from-the-database"></a>
270261

271262
To retrieve the dumped data:
272263

@@ -300,7 +291,7 @@ london_lines_mul = osmdb.read_osm_pbf_data('london', 'lines', 'multilinestrings'
300291

301292

302293

303-
#### 3.3 Import data of all subregions of a given (sub)region to the database <a name="import-data-of-all-subregions"></a>
294+
#### *3.3* Import data of all subregions of a given (sub)region to the database <a name="import-data-of-all-subregions"></a>
304295

305296
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":
306297

0 commit comments

Comments
 (0)