Madrid taxi Import

From OpenStreetMap Wiki
(Redirected from Tag:comment=)
Jump to: navigation, search


The goal is to manually merge and import the taxi ranks and taxi ranks information from the Madrid city council database, see: Import_Ayuntamiento_Madrid (in spanish)

In Madrid there are 106 taxi ranks already in OSM. The dataset from the city council contains 424. It contains useful information like address and capacity.

Existing hand mapped information will not be replaced by the import without on-the-ground verification.


  1. October 16 2016: We started the preparation and the discussion. See the discussion in the talk-es list (in spanish)
  2. October 17 2016: Requested information about the taxi ranks with time restrictions to the City Council. We'll wait some time before starting the import.
  3. October ?: We start the import
  4. November ?: We finish doing the QA after the import
  5. November ?: Send a report to talk-es and the city council

Import Data

Data description

The original dataset uses the xls format. It includes a total of 424 spots. 3 mappers checked some known ranks and the locations are correct.

We'll use the xls file for processing. You can download the data here.


ODbL Compliance verified: YES

The license can be consulted here (in Spanish). It requires attribution of the source, so all nodes and the changeset will include source=Ayuntamiento de Madrid. The Madrid City Council (Ayuntamiento de Madrid) is already on the contributors list.

After sending the report with the problems and errors found during the drinking water import, including a section about the license, got a response from the "Subdirección General de Transparencia del Ayuntamiento de Madrid" (the data owner), and they confirmed me that we comply with their attribution clause using their data in OSM if we clearly specify the source and the source:date, the way it was done on the Madrid_Drinking_Water_Import. And they do like the work we are doing :) Kresp0 (talk) 13:30, 16 October 2016 (UTC)

Compatibility with the ODbL was already discussed in the imports and talk-es mailing lists.

Cumplimiento de la cláusula de atribución de los datos abiertos del Ayto. de Madrid en OSM.pdf

Import Type

The import will be done manually, using the Tasks Manager, so it can be assigned to different volunteers. JOSM will be used to edit the data.

Data Preparation

Data Reduction & Simplification

Some of the fields aren't relevant and will be ignored.

Tagging Plans

Here are the original fields, their meaning and how they will be converted to the resulting OSM file:

Tagging Conversion
Original Fields Meaning OSM tag Comments
Gis_X EPSG:23030 X X coordinate Reprojection to EPSG:4326 needed
Gis_Y EPSG:23030 Y Y coordinate Reprojection to EPSG:4326 needed
Distrito District Not used
Barrio Suburb Not used
Calle Street addr:street=*
Nº Finca housenumber Not used
Nº Plazas Capacity capacity=*

We added the following tags:

Changeset Tags

We will use the following changeset tags:

Data Transformation

Data is in xls format. We already:

  • Converted to the OSM format following this steps:
  • 1.- Open the xls using LibreOffice calc
  • 2.- Delete the first row
  • 3.- Save as reserva_paradas_taxis.csv using semicolon (;) as field separator and quotes (") as text separator.
# 4.- Extrae los campos a usar y añade FIXME a la dirección:
  awk -F ';' '{print $1";"$2";FIXME "$5";"$6";"$7}' reserva_paradas_taxis.csv | perl -pe 's/;FIXME Calle;/;Calle;/g' > r ; mv r reserva_paradas_taxis.csv

# 5.- Descarga y descomprime la rejilla para cambio de Datum entre ED50 y ETRS89 para la península del Instituto Geográfico Nacional:

# 6.- Prepara la reproyección de EPSG:23030 a EPSG:4326 con la rejilla:
echo '<OGRVRTDataSource>
  <OGRVRTLayer name="reserva_paradas_taxis">
  <LayerSRS>+init=epsg:23030 +nadgrids=./PENR2009.gsb +wktext</LayerSRS> 
  <GeometryField encoding="PointFromColumns" x="Gis_X" y="Gis_Y"/>
  <Field name="addr:street" src="Calle" />
  <Field name="capacity" src="Nº Plazas" />
  </OGRVRTDataSource>' > paradas-taxi-23030.vrt

# 7.- Reproyecta usando ogr2ogr
  ogr2ogr -lco GEOMETRY=AS_XY -overwrite -f CSV -t_srs EPSG:4326 paradas-taxi.csv paradas-taxi-23030.vrt

# 8.- Prepara la conversión a shapefile
  echo '<OGRVRTDataSource>
  <OGRVRTLayer name="Paradas_taxi_Madrid">
  <SrcDataSource relativeToVRT="1">.</SrcDataSource>
  <GeometryField encoding="PointFromColumns" x="x" y="y"/>
  </OGRVRTDataSource>' > paradas-taxi.vrt

# 9.- Convierte a shapefile
  ogr2ogr -f "ESRI Shapefile" . paradas-taxi.csv && ogr2ogr -f "ESRI Shapefile" . paradas-taxi.vrt
  • 10.- Open the shp with JOSM (opendata plugin needed)
  • 11.- Save as "Paradas_taxi_Madrid.osm" and close JOSM
# 12.- Transforma, añade y quita etiquetas:
  grep -v "'Y'" Paradas_taxi_Madrid.osm | grep -v "'X'" | perl -pe 's/addr_stree/addr:street/g' | grep -v 'S/N' | perl -pe "s/  <\/node>/    <tag k=\'amenity\' v=\'taxi\'\/>\n  <\/node>/g" | perl -pe "s/  <\/node>/    <tag k=\'operator\' v=\'Ayuntamiento de Madrid\'\/>\n  <\/node>/g" | perl -pe "s/  <\/node>/    <tag k=\'source\' v=\'Ayuntamiento de Madrid\'\/>\n  <\/node>/g" | perl -pe "s/  <\/node>/    <tag k=\'source:date\' v=\'2015-08-05\'\/>\n  <\/node>/g" > r ; mv r Paradas_taxi_Madrid.osm

  • 13.- Manually drawn the working area using JOSM: create new layer, draw the area and save as geojson
  • 14.- Upload the working area to the TM
  • 15.- Split the osm file to have one file for each task on the TM using the osmboxes script
  • 16.- Upload the splitted files to some webserver
  • 17.- Add the special link (see the osmboxes README) to the per task instructions on the TM

Data Import Workflow

Team Approach

Import will be undertaken by experienced OSM volunteers, following a strict workflow.


This manual import will be discussed in the Talk-Es list


As most (if not all) of the volunteers will be Spanish speaking, they can follow the detailed workflow in Spanish language on the TM.

The workflow will be as follows:

  • 1. Install the TODO list JOSM plugin if the volunteer don't have it.
  • 2. Create, if we don't have one yet, an import specific user account, like username_madrid_taxi_import (you will need a different email address from the account you used for your regular OSM account). Change the OSM username to that specific account in the JOSM preferences.
  • 3. Configure JOSM to allow remote access.
  • 4. Login into the Tasks Manager.
  • 5 Select one square to work on.
  • 6 Open the OSM data and the taxi ranks data by clicking on the JOSM button and the link on the extra instructions.
  • 7 Select all nodes on the taxi ranks layer and add them to the ToDo list. For each node we'll:
    • Edit the addr:street=*, fix the name to match the current OSM street name
    • Conflate the node data with the taxi rank area/node if there is already one or create a new one if not. Don't replace existing hand mapped information without on-the-ground verification.
  • 8. After the import is done, there will be a review process using the TM.


Each year I'll download the dataset, do a diff and update the data to OSM manually. Until I get bored or automate it. Kresp0 (talk) 20:44, 16 October 2016 (UTC)

Reverse plan

In case of any trouble, JOSM reverter will be used.