Skip to content

Commit 2fcd0ab

Browse files
committed
Prepare 2.0 release
1 parent 2fe7dd0 commit 2fcd0ab

3 files changed

Lines changed: 33 additions & 16 deletions

File tree

README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,31 @@ For formatting the addresses from the reverse geocoder the `worldwide.yml` from
1414

1515
See `README.md` in the [repository](https://github.com/dunkelstern/osmgeocoder) for more information.
1616

17+
## Changelog
18+
19+
### v1.0
20+
21+
- Initial release, reverse geocoding works, forward geocoding is slow
22+
23+
### v2.0
24+
25+
**Warning:** DB Format changed, you'll have to re-import data
26+
27+
- Fixed forward geocoding speed
28+
- Fixed import scripts to be more resilient
29+
- Made Openaddresses.io completely optional
30+
- Restored compatability with older 3.x python versions
31+
- Restored compatability with older PostgreSQL DB versions (9.5+ if you do no use openaddresses.io)
32+
- Switched to `pipenv`
33+
1734
## TODO
1835

1936
- Return Attribution in API and in webservices
2037

2138
## "Quick" and dirty how-to
2239

40+
**Statistics uutdated, will be updated shortly**
41+
2342
Just for your information, this process takes a lot of time for a big import. Example figures on a machine with a Core i7-7700K on 4.2 GHz with a Samsung (SATA-)SSD and 32GB of RAM (and some tuned buffer sizes for Postgres):
2443

2544
- Import of the Europe-Region of OpenStreetMap:
@@ -68,13 +87,13 @@ pipenv sync
6887
6. See below for importing openaddresses.io data if needed (this is completely optional)
6988
7. Import some OpenStreetMap data into the DB (grab a coffee or two):
7089
```bash
71-
$ bin/prepare_osm.py --db postgresql://user:password@localhost/osmgeocoder --import-data osm.pbf --optimize
90+
$ bin/prepare_osm.py --db postgresql://geocoder:password@localhost/osmgeocoder --import-data osm.pbf --optimize
7291
```
7392
8. Modify configuration file to match your setup. The example config is in `osmgeocoder/data/config-example.json`.
7493
9. Optionally install and start the postal machine learning address categorizer (see below)
7594
10. Import the geocoding functions into the DB:
7695
```bash
77-
$ bin/finalize_geocoder.py --db postgresql://user:password@localhost/osmgeocoder
96+
$ bin/finalize_geocoder.py --db postgresql://geocoder:password@localhost/osmgeocoder
7897
```
7998
11. Geocode:
8099
```bash
@@ -102,7 +121,7 @@ The import is relatively slow as the data is contained in a big bunch of zipped
102121
```bash
103122
wget https://s3.amazonaws.com/data.openaddresses.io/openaddr-collected-europe.zip # download openaddress.io data
104123
pipenv run bin/import_openaddress_data.py \ # run an import
105-
--db postgresql://user:password@host/dbname \
124+
--db postgresql://geocoder:password@host/osmgeocoder \
106125
--threads 4 \
107126
--optimize \
108127
openaddr-collected-europe.zip
@@ -187,9 +206,8 @@ The file `geocoder_service.py` is a simple Flask app to present the geocoder as
187206
### Installation
188207

189208
```bash
190-
pipenv shell
191-
pip install gunicorn
192-
pip install flask
209+
pipenv run pip install gunicorn
210+
pipenv run pip install flask
193211
```
194212

195213
You will need a working config file too.

example_setup.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ pip install -r requirements.txt
5353
# create geocoding db
5454
psql <<EOF
5555
CREATE ROLE geocoder WITH LOGIN PASSWORD '$geocoder_password';
56-
CREATE DATABASE geocoder;
57-
ALTER DATABASE geocoder OWNER TO geocoder;
58-
\c geocoder
56+
CREATE DATABASE osmgeocoder;
57+
ALTER DATABASE osmgeocoder OWNER TO geocoder;
58+
\c osmgeocoder
5959
CREATE SCHEMA gis; -- isolate postgis into its own schema for easier development
6060
ALTER SCHEMA gis OWNER TO geocoder;
6161
CREATE EXTENSION postgis WITH SCHEMA gis; -- put postgis into gis schema
@@ -71,12 +71,12 @@ EOF
7171

7272
# import openaddresses.io data
7373
for item in ../*.zip ; do
74-
./bin/import_openaddress_data.py --db postgres://geocoder:$geocoder_password@localhost/geocoder --threads 8 --fast $(realpath $item)
74+
./bin/import_openaddress_data.py --db postgres://geocoder:$geocoder_password@localhost/osmgeocoder --threads 8 --fast $(realpath $item)
7575
done
76-
./bin/import_openaddress_data.py --db postgres://geocoder:$geocoder_password@localhost/geocoder --threads 8 --optimize
76+
./bin/import_openaddress_data.py --db postgres://geocoder:$geocoder_password@localhost/osmgeocoder --threads 8 --optimize
7777

7878
# import osm data
79-
./bin/prepare_osm.py --db postgres://geocoder:$geocoder_password@localhost/geocoder --import-data $(dirname $(pwd))/europe-latest.osm.pbf --optimize --tmpdir $(dirname $(pwd))/imposm_tmp
79+
./bin/prepare_osm.py --db postgres://geocoder:$geocoder_password@localhost/osmgeocoder --import-data $(dirname $(pwd))/europe-latest.osm.pbf --optimize --tmpdir $(dirname $(pwd))/imposm_tmp
8080

8181
# run geocoder prepare scripts
82-
./bin/finalize_geocoder.py --db postgres://geocoder:$geocoder_password@localhost/geocoder
82+
./bin/finalize_geocoder.py --db postgres://geocoder:$geocoder_password@localhost/osmgeocoder

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
'License :: OSI Approved :: BSD License',
3636
'Programming Language :: Python',
3737
'Programming Language :: Python :: 3',
38-
'Programming Language :: Python :: 3.4',
3938
'Programming Language :: Python :: 3.5',
4039
'Programming Language :: Python :: 3.6',
4140
'Programming Language :: Python :: 3.7',
@@ -53,11 +52,11 @@
5352
'bin/finalize_geocoder.py'
5453
],
5554
install_requires=[
56-
'psycopg2-binary >= 2.7',
55+
'psycopg2-binary >= 2.8',
5756
'pyproj >= 1.9',
5857
'Shapely >= 1.6',
5958
'requests >= 2.18',
60-
'PyYAML >= 3.12',
59+
'PyYAML >= 5.0',
6160
'pystache >= 0.5',
6261
'python-geohash >= 0.8.5'
6362
],

0 commit comments

Comments
 (0)