From 2fcd0abd88cb2382bac9177c5dc9124cdbb229ba Mon Sep 17 00:00:00 2001 From: Johannes Schriewer Date: Wed, 3 Jul 2019 13:00:33 +0200 Subject: [PATCH] Prepare 2.0 release --- README.md | 30 ++++++++++++++++++++++++------ example_setup.sh | 14 +++++++------- setup.py | 5 ++--- 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 81b4983..e063a68 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,31 @@ For formatting the addresses from the reverse geocoder the `worldwide.yml` from See `README.md` in the [repository](https://github.com/dunkelstern/osmgeocoder) for more information. +## Changelog + +### v1.0 + +- Initial release, reverse geocoding works, forward geocoding is slow + +### v2.0 + +**Warning:** DB Format changed, you'll have to re-import data + +- Fixed forward geocoding speed +- Fixed import scripts to be more resilient +- Made Openaddresses.io completely optional +- Restored compatability with older 3.x python versions +- Restored compatability with older PostgreSQL DB versions (9.5+ if you do no use openaddresses.io) +- Switched to `pipenv` + ## TODO - Return Attribution in API and in webservices ## "Quick" and dirty how-to +**Statistics uutdated, will be updated shortly** + 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): - Import of the Europe-Region of OpenStreetMap: @@ -68,13 +87,13 @@ pipenv sync 6. See below for importing openaddresses.io data if needed (this is completely optional) 7. Import some OpenStreetMap data into the DB (grab a coffee or two): ```bash -$ bin/prepare_osm.py --db postgresql://user:password@localhost/osmgeocoder --import-data osm.pbf --optimize +$ bin/prepare_osm.py --db postgresql://geocoder:password@localhost/osmgeocoder --import-data osm.pbf --optimize ``` 8. Modify configuration file to match your setup. The example config is in `osmgeocoder/data/config-example.json`. 9. Optionally install and start the postal machine learning address categorizer (see below) 10. Import the geocoding functions into the DB: ```bash -$ bin/finalize_geocoder.py --db postgresql://user:password@localhost/osmgeocoder +$ bin/finalize_geocoder.py --db postgresql://geocoder:password@localhost/osmgeocoder ``` 11. Geocode: ```bash @@ -102,7 +121,7 @@ The import is relatively slow as the data is contained in a big bunch of zipped ```bash wget https://s3.amazonaws.com/data.openaddresses.io/openaddr-collected-europe.zip # download openaddress.io data pipenv run bin/import_openaddress_data.py \ # run an import - --db postgresql://user:password@host/dbname \ + --db postgresql://geocoder:password@host/osmgeocoder \ --threads 4 \ --optimize \ openaddr-collected-europe.zip @@ -187,9 +206,8 @@ The file `geocoder_service.py` is a simple Flask app to present the geocoder as ### Installation ```bash -pipenv shell -pip install gunicorn -pip install flask +pipenv run pip install gunicorn +pipenv run pip install flask ``` You will need a working config file too. diff --git a/example_setup.sh b/example_setup.sh index 9196e5b..9938a15 100644 --- a/example_setup.sh +++ b/example_setup.sh @@ -53,9 +53,9 @@ pip install -r requirements.txt # create geocoding db psql <= 2.7', + 'psycopg2-binary >= 2.8', 'pyproj >= 1.9', 'Shapely >= 1.6', 'requests >= 2.18', - 'PyYAML >= 3.12', + 'PyYAML >= 5.0', 'pystache >= 0.5', 'python-geohash >= 0.8.5' ],