Automated edits/StopConsuming StartProducing

From OpenStreetMap Wiki
Jump to navigation Jump to search

This page documents planned automated edits by StopConsuming_StartProducing (Klaus: thunderbird (odd) office-dateien (even) de)

First documented mechanical edit of Titsa bus stops

(This mechanical update is intended to be a rehearsal for further and potentially larger mechanical edits.)

On Tenerife (island), bus stops used by the local operator Titsa (https://titsa.com) are tagged on OSM with "operator" = "Titsa" and a "ref" number identical to the bus stop number used internal by Titsa (e.g. "ref" = "1326" in the following example), see example: https://www.openstreetmap.org/node/1386852429

This internal ref number is for example visible in the route information of Titsa: https://titsa.com/index.php/tus-guaguas/lineas-y-horarios/linea-105 and it can be used to query the upcoming connections for that bus stop: https://titsa.com/movil/infoparada.php?IdParada=1326

However, some of these Titsa bus stops on Tenerife are outdated and not used anymore by Titsa. Therefore, I would like to tag them "disused:highway" and remove any "route_ref" tags using a Python script.

Intended update:

  • "highway" = "bus_stop" ⇒ "disabled:highway" = "bus_stop"
  • Remove "route_ref" if existent

Preparations

Before the next step I did some manual cleaning up, like identifying potential Titsa stops not tagged properly, tagging the operator properly (TITSA => Titsa), and such.

1) Identifying all Titsa bus stop on OSM:

// https://overpass-turbo.eu
// Find all bus stops on Tenerife that have a 'ref' key
[out:json][timeout:25];
// get Tenerife area by name
area["name"="Tenerife"]["boundary"="political"]->.searchArea;
// fetch nodes/ways/relations with the POI tag and the required key
(
  node["highway"="bus_stop"]["operator" = "Titsa"]["ref"](area.searchArea);
);
out center;

Result: ≈3,940


2) Checking whether these are used by Titsa (using the ref number):

https://titsa.com/ajax/xGetInfoParada.php?id_parada=$i

Result (not used by Titsa): 114


3) Checking these 114 again, but a different website of Titsa:

https://titsa.com/movil/infoparada.php?IdParada=$i

Result (not used by Titsa): 46


4) Checking whether they are still part of any relation (using the node ids):

https://api.openstreetmap.org/api/0.6/node/$i/relations.json

Result: 13


5) Treating these relation dependencies manually:

Result: 13


6) Nodes left to handle: 45

Proposed script and execution

Successful test runs (on https://master.apis.dev.openstreetmap.org):

Intended execution:

  • Execute in 1 bulk

Execution

n/a