Migrate to new Wikidata importer (#735)

* Use _resolve_wikidata in layer mapping.yaml

Mark all tables that should not be populated with the Wikidata
international labels with a special OMT-specific flag.

This should be ok to merge even before the new tools version
is used because imposm seems to ignore anything it doesn't understand.

The next tools version will remove it when generating imposm mapping file.

* Migrate to new Wikidata importer

Uses latest tools to populate the wd_names table
during the quickstart.  This can be merged already,
or we can wait for the next tools version.
This commit is contained in:
Yuri Astrakhan
2020-01-22 16:16:38 -05:00
committed by GitHub
parent 1bc3f138b4
commit 3449cecb22
5 changed files with 27 additions and 31 deletions

View File

@@ -106,16 +106,6 @@ docker-compose run import-lakelines
docker-compose run import-osmborder
```
**[Optional]**
Import latest Wikidata. If an OSM feature has [Key:wikidata](https://wiki.openstreetmap.org/wiki/Key:wikidata), OpenMapTiles check corresponding item in Wikidata and use its [labels](https://www.wikidata.org/wiki/Help:Label) for languages listed in [openmaptiles.yaml](openmaptiles.yaml). So the generated vector tiles includes multi-languages in name field.
Beware that current [Wikidata dump](https://dumps.wikimedia.org/wikidatawiki/entities/latest-all.json.gz) is more than 55GB, it takes time to download and import it. If you just want to have a quickstart on OpenMapTiles, just skip this step.
```bash
make download-wikidata
docker-compose run import-wikidata
```
[Download OpenStreetMap data extracts](http://download.geofabrik.de/) and store the PBF file in the `./data` directory.
```bash
@@ -130,6 +120,14 @@ wget http://download.geofabrik.de/europe/albania-latest.osm.pbf
docker-compose run import-osm
```
Import latest Wikidata. If an OSM feature has [Key:wikidata](https://wiki.openstreetmap.org/wiki/Key:wikidata), OpenMapTiles check corresponding item in Wikidata and use its [labels](https://www.wikidata.org/wiki/Help:Label) for languages listed in [openmaptiles.yaml](openmaptiles.yaml). So the generated vector tiles includes multi-languages in name field.
This step uses [Wikidata Query Service](https://query.wikidata.org) to download just the Wikidata IDs that already exist in the database.
```bash
make import-wikidata
```
### Work on Layers
Each time you modify layer SQL code run `make` and `make import-sql`.