Compares the population in OSM place nodes and boundary relations with Wikidata
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitattributes
LICENSE
README.md
WdOSMpop.py
example.html

README.md

Population in OSM and Wikidata

Summary

The Python script compares the population in OSM (place nodes and boundary relations) with Wikidata. Before you edit/add data in either database, please be sure you have some idea of the hierarchical model of the region and how it is represented in OSM and Wikidata.

Requires

Python 3.x with the following libraries:
SPARQLWrapper
overpass >= 0.6.0

Installation & first steps

  1. git clone https://github.com/ThomasBarris/populationWDvsOSM.git
  2. cd populationWDvsOSM.
  3. pip install SPARQLWrapper
  4. pip install overpass
  5. change location and name of the html output file in line 10 in WdOSMpop.py if necessary
  6. change to bounding box in line 13 in WdOSMpop.py. A tool that helps you to find the bbox can be found here
  7. python3 WdOSMpop.py

Output

Html Output

A file with the example output is >>> here <<<

Terminal output
Place Node
> name       :  Göppingen
> type       :  node
> id         :  240084735
> wikidata   :  Q4072
> population :  55846
> place      :  town
> boundary   :  
> WD Label   :  Göppingen
> WD Pop     :  55846
Boundary Relation
> name       :  Ottenbach
> type       :  relation
> id         :  2826029
> wikidata   :  Q80639
> population :  
> place      :  
> boundary   :  administrative
> WD Label   :  Ottenbach
> WD Pop     :  2442