Automated edits/BenPortner

From OpenStreetMap Wiki
Jump to navigation Jump to search


Introduction

First of all, I must apologize because I performed the edits described here before consulting the community. This happened out of inexperience: I did only find the code of conduct for automated edits after I had done the editing. I hope, that my edits will be approved subsequently.

Problem statement (before edits)

I use OSM to search places in Poland based on addresses which use English name variants. Currently, when searching for places in Poland one can not include the English name of the County. Doing so will simply yield zero results. That's because most powiat entries do not have a name:en tag. For example: Searching for "pokrzywno chojnice" will not yield any result. Searching for "pokrzywno chojnicki" yields the expected result: a small Hamlet. According to Wikipedia, "Chojnice County" is the English translation for "powiat chojnicki". However, this information is currently not available in OSM. I wish to add it so that both queries yield the same result. Poland has 380 powiats, most of which do not currently have a name:en tag, and adding this information manually is cumbersome. Hence, I use a bot.

Method

I followed these steps:

  1. I retrieved a list of all powiats, their English name and their Polish name from Wikidata via SPARQL query
  2. I retrieved a list of all powiats, including their Wikidata ID from OSM via Overpass API
  3. I wrote a program that takes both lists and matches their entries using the Wikidata IDs AND the Polish names. Only if both match, the program will consider it a match. The program then filters entries where an English name is available from Wikidata but not yet in OSM. It then adds the English name to the OSM entry and uploads the result.
  4. Bonus: The program also adds name:pl tags if not yet present.

Source code

The plain text queries to Wikidata and OSM, the query result from Wikidata, and the source code can be found in my GitHub repository:

https://github.com/BenPortner/osm_powiats_add_tags

Changesets

The resulting change sets can be found here:

https://www.openstreetmap.org/changeset/83759481

https://www.openstreetmap.org/changeset/83759286