From: Sarah Hoffmann Date: Wed, 7 Aug 2019 20:38:43 +0000 (+0200) Subject: Merge pull request #1444 from lonvia/require-python-3 X-Git-Tag: v3.4.0~16 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/fb012504b2a4fbeb82461f3fa59b383bf43f8521?hp=7ed9ecf3504cece2e18ce606af11eb49292d9872 Merge pull request #1444 from lonvia/require-python-3 Require python 3 --- diff --git a/data-sources/us-tiger/README.md b/data-sources/us-tiger/README.md index e75a9efa..dfb44c5f 100644 --- a/data-sources/us-tiger/README.md +++ b/data-sources/us-tiger/README.md @@ -9,9 +9,7 @@ Replace '2018' with the current year throughout. 1. Install the GDAL library and python bindings and the unzip tool # Ubuntu: - sudo apt-get install python-gdal unzip - # CentOS: - sudo yum install gdal-python unzip + sudo apt-get install python3-gdal unzip 2. Get the TIGER 2018 data. You will need the EDGES files (3,233 zip files, 11GB total). @@ -22,8 +20,7 @@ Replace '2018' with the current year throughout. cd data-sources/us-tiger ./convert.sh - + 4. Maybe: package the created files - + tar -czf tiger2018-nominatim-preprocessed.tar.gz tiger - \ No newline at end of file diff --git a/data-sources/us-tiger/tiger_address_convert.py b/data-sources/us-tiger/tiger_address_convert.py index b1e2eb0c..ebe265ed 100755 --- a/data-sources/us-tiger/tiger_address_convert.py +++ b/data-sources/us-tiger/tiger_address_convert.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # Tiger road data to OSM conversion script # Creates Karlsruhe-style address ways beside the main way # based on the Massachusetts GIS script by christopher schmidt @@ -164,7 +164,7 @@ def parse_shp_for_geom_and_tags( filename ): if (statefp != None) and (countyfp != None): county_name = county_fips_data.get(statefp + '' + countyfp) if county_name: - tags["tiger:county"] = county_name.encode("utf-8") + tags["tiger:county"] = county_name # tlid = poFeature.GetField("TLID") # if tlid != None: diff --git a/docs/admin/Import-and-Update.md b/docs/admin/Import-and-Update.md index 257e5ebc..923891a4 100644 --- a/docs/admin/Import-and-Update.md +++ b/docs/admin/Import-and-Update.md @@ -220,14 +220,14 @@ For a list of other methods see the output of `./utils/update.php --help`. #### Installing the newest version of Pyosmium -It is recommended to install Pyosmium via pip. Run (as the same user who -will later run the updates): +It is recommended to install Pyosmium via pip. Make sure to use python3. +Run (as the same user who will later run the updates): ```sh -pip install --user osmium +pip3 install --user osmium ``` -Nominatim needs a tool called `pyosmium-get-updates`, which comes with +Nominatim needs a tool called `pyosmium-get-updates` which comes with Pyosmium. You need to tell Nominatim where to find it. Add the following line to your `settings/local.php`: diff --git a/docs/admin/Installation.md b/docs/admin/Installation.md index 5b7f8173..d0724927 100644 --- a/docs/admin/Installation.md +++ b/docs/admin/Installation.md @@ -50,7 +50,7 @@ For running Nominatim: For running continuous updates: - * [pyosmium](https://osmcode.org/pyosmium/) + * [pyosmium](https://osmcode.org/pyosmium/) (with Python 3) ### Hardware diff --git a/utils/check_server_for_updates.py b/utils/check_server_for_updates.py index 6e3beb83..05b69657 100755 --- a/utils/check_server_for_updates.py +++ b/utils/check_server_for_updates.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import sys from osmium.replication import server diff --git a/utils/osm_file_date.py b/utils/osm_file_date.py index 88d0a4c0..b8c54a7c 100755 --- a/utils/osm_file_date.py +++ b/utils/osm_file_date.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import osmium import sys