Automated edits/atp2osm bot

From OpenStreetMap Wiki
Jump to navigation Jump to search

Automated edits/atp2osm_bot

First contact

Name: Gwenaël

OSM username: Hagatopaxi

Contact: atp2osm_bot@gwenael-leger.fr

Objectives

Gardening shops take a lot of times and could be difficult in some cases. This tool is a bridge between data from All The Places (ATP) and OSM.

It's only focused on the Metropolitan France area. That should be extended to DROM-COM (DOM-TOM) in later versions.

The tool only adds new tags that are missing in the actual points of view.

The tool never:

  • Adds new points on OSM
  • Removes points or tags on OSM
  • Updates existing points on OSM

How the automated edit works (high‑level description)

The tool follows these steps, some optional parameters can make variant in the executions.

  1. Setup ATP database: Download the latest ATP data, create indexes to queried ATP data.
  2. Setup OSM database: Create appropriate view and indexes to queried OSM data.
  3. Execute the query: Every matching points of view from ATP and OSM are returned (one pair by row).
  4. Compute the difference: For each matching pair, compute the tag difference. Filter out every equivalent points of view based on tag.
  5. Upload: With the OSM API v0.6 upload adding tags. Batch are grouped by french department area and brand.
  6. Save logs: A log file is created for each run (by french department).

The matching criteria

ATP and OSM points of view are matched based on those criteria

  • Distance between ATP and OSM position must be less than 500 meters.
  • At least one of the following tag must be strictly equal:
    • brand:wikidata
    • brand
    • name
    • website or contact:website
    • phone or contact:phone
    • email or contact:email

Consultation & discussion

Community forum thread (on the OSM-FR forum): https://forum.openstreetmap.fr/t/all-the-places-import-des-attributs-horaires-telephone-site-web-mail/39051

Source code: https://github.com/hagatopaxi/atp2osm-import. Published under license GPLv3.

Feedbacks are welcomed.

Changeset comment (what will appear in OSM history)

Each changeset created by the bot will contain a comment like: Importation des données ATP (dép. <number>; <brand_name>)

Comments are in French because this project is only updates french points of view and users will interact with will be French speaker.

Edits planning

TODO