Automated edits/FaSpaceFixer

From OpenStreetMap Wiki
Jump to navigation Jump to search

What

Output result of affected names...

This script looks for any farsi name tag with numbers in it but with forgoten space before or after the number. for example it will fix issue as follow.

Tags affected: name=*

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

name=بهار۱۰شرقی >>> name=بهار ۱۰ شرقی , etc...



Why

sometimes people forget to use an Space before or after numbers or they think its not necessary. This script will do semi-automatically fixes and will add need space.

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) , FaSpaceFixer python script will read from it. now the script will fix forgoten space 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. this script 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"~"^[\u0627-\u06cc]+[\u06f0-\u06f9].+|[\u06f0-\u06f9]+[\u0627-\u06cc].+$"](area.searchArea);
  way["name"~"^[\u0627-\u06cc]+[\u06f0-\u06f9].+|[\u06f0-\u06f9]+[\u0627-\u06cc].+$"](area.searchArea);
 );
(._;>;);
out meta;

it will look for any name tag which have farsi number in it which it doesn't have any space before or after it...

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: FaSpaceFixerBot

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/faspacefixer/tree/master/logs