Automated edits/FaNumberFixer

From OpenStreetMap Wiki
Jump to navigation Jump to search

What

Output result of affected names...

This script looks for Eastern/Western Arabic digits (٠١٢٣٤٥٦٧٨٩/0123456789) and if tag-value is in Persian script, it converts them to Perso-Arabic or so-called Farsi digits (۰۱۲۳۴۵۶۷۸۹).

Tags affected: name=*

Example: name=بهار 10 >>> name=بهار ۱۰

Why

Normally signs with Farsi script have Farsi digits but are tagged with Eastern/Western Arabic digits and this script is supposed to fix them. There are lots of streets and other objects that tagged e.g. name=مریم 5 and should be name=مریم ۵. This script will do this semi-automatically.

Where

All over Iran.

How

I download required data using below overpass query with JOSM, then i save data to an OSM file (input.osm) and FaNumberFixer python script will read from it. now the script will fix number encoding issue in name tag (while it consider some safety stuff) and it gives us an output.osm file. now i open this file with JOSM. in new v4.2 of this script it produce changes.html with a nice table of changed name for easy verification... and finally upload the changes.

OverPass Query:

[out:xml][timeout:180];
{{geocodeArea:iran}}->.searchArea;
(
  node["name"!~"[a-z]+"]["name"!~"[A-Z]+"]["name"~"[0-9]|٦|٥|٤|ي|ك"](area.searchArea);
  way["name"!~"[a-z]+"]["name"!~"[A-Z]+"]["name"~"[0-9]|٦|٥|٤|ي|ك"](area.searchArea);
 );
(._;>;);
out meta;

Code on GitLab

Consultation

  • Public announcement on OSM Iran Telegram group before first run and a simple report with link to the changeset every time script runs.
  • Discussion thread on OpenStreetMap forum.

Who

Creator: OSM user Navid Hosseinzadeh, Email: fta.boy.n, “ат”gmail“ԁοт”com, Telegram: @NHosseinzadeh92

If you see any problems with this script please feel free and tell us on this Forum Topic.

Script dedicated account: FaNumberFixerBot

When

It supposed to be run every week or any time i have some free time.

Logs

Logs are available in GitLab logs folder:

https://gitlab.com/OSMIran/fanumberfixer/tree/master/logs