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)

Also read: https://wiki.openstreetmap.org/wiki/Automated_Edits_code_of_conduct

First documented automated edit of TITSA bus stops

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

Explanation of Geo situation

On Tenerife (island), bus stops used by the local operator Transportes Interurbanos de Tenerife (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-418 and it can be used to query the upcoming connections for that bus stop: https://titsa.com/movil/infoparada.php?IdParada=7140 (The latter website also includes the GPS coordinates of the stop in its source.) The almost identical website is also available under the following link: https://movil.titsa.com/infotransbordo.php?IdParada=1326

On the an official open data portal of Tenerife, you can also download the current detailed bus stop and route situation: https://datos.tenerife.es/es/datos/conjuntos-de-datos/informacion-sobre-el-sistema-de-transporte-de-titsa-en-tenerife They refer to the bus stop time table using the following link: http://www.titsa.com/correspondencias.php?idc=7140 (Also here you can find the GPS coordinates of the stop in the HTML source code.)

Furthermore, the TITSA website uses the following AJAX link to query in place bus stop information (incl. GPS): https://titsa.com/ajax/xGetInfoParada.php?id_parada=7140

Cause of and reason for automated edit

Cause

Some of these TITSA bus stops on Tenerife are outdated on OSM 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

Reason

Running a rehearsal for a larger automated edit.

Preparations

Before this I did some manual cleaning up on OSM, like identifying potential TITSA stops not tagged properly with an operator, tagging the operator properly (TITSA => Titsa), and such.

Finding outdated bus stops (round 1)

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"]["ref"](area.searchArea);
);
out skel;

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

Finding outdated bus stops (round 2)

  1. Again queried Overpass to identify nodes with ref on Tenerife.
  2. Removed nodes with non-TITSA operator.
  3. Imported current GTFS bus stop list: https://datos.tenerife.es/es/datos/conjuntos-de-datos/informacion-sobre-el-sistema-de-transporte-de-titsa-en-tenerife (ZIP => stops.txt)
  4. Identified 58 nodes not in the GTFS list. (Ignored the Los Cristianos stops with "-".)
  5. Compared these 58 against the previously identified 45. Result: Of the 58, 19 where not identified previously. Of the 45, 6 are not part of the nodes not in the GTFS list.
  6. It seems the AJAX feedback "{"success":true,"parada":false,"lineas":null}" is not sufficient to reject any nodes.
  7. Taking the nodes not in the GTFS list AND identified in the first round => 39.

Nodes left to handle: 39

Proposed script and execution

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

Intended execution:

  • Execute in 1 bulk

Execution

Date/time: 2026 / 06 / 06 - 21:30 CEST (UTC+2)

Changeset: https://api.openstreetmap.org/changeset/183753265

Result: Success

(Corrected nodes 4799055093 and https://www.openstreetmap.org/node/1975543653 1975543653] manually: https://www.openstreetmap.org/changeset/183754054 & https://www.openstreetmap.org/changeset/183754162)

Addition of missing TITSA bus stops

(This 2nd automated update is intended to be another rehearsal for further and potentially larger automated edits.)

Explanation of Geo situation

See above: #Explanation of Geo situation.

Cause of and reason for automated edit

Cause

According to the GTFS information (https://datos.tenerife.es/es/datos/conjuntos-de-datos/informacion-sobre-el-sistema-de-transporte-de-titsa-en-tenerife), there do exist bus stops in the TITSA network not yet on OSM.

Intended update:

  • Addition of bus stops with relevant ref number
  • Making sure there is not already a bus stop nearby which can be used

Reason

Running a rehearsal for a larger automated edit.

Preparations

n/a