# Balearic rental fleet count from DGT registry microdata

**Retrieved:** 2026-10-30. **Script:** `count_fleet.py` (Python 3 standard library).
**Output:** `results.csv`, aggregates only. No raw microdata is kept here, and no
single vehicle or owner appears in any published file.

## Sources

- Dataset page, "Microdatos de parque de vehículos (Anual)", last update stated
  by DGT 31/12/2025:
  https://www.dgt.es/menusecundario/dgt-en-cifras/dgt-en-cifras-resultados/dgt-en-cifras-detalle/Microdatos-de-parque-de-vehiculos-Anual/
- File list: https://www.dgt.es/menusecundario/dgt-en-cifras/matraba-listados/parque-vehiculos-anual.html
- Files: `https://www.dgt.es/microdatos/Parque/<year>/parque_consolidado_<year>.zip`, 2020 to 2025
- Record layout: https://www.dgt.es/export/sites/web-DGT/.galleries/downloads/dgt-en-cifras/matraba/Interfaz-de-Salida-Fichero-Parque-Anual.pdf
- Service codes: Royal Decree 2822/1998, Annex II.D, https://www.boe.es/buscar/act.php?id=BOE-A-1999-1826
- Municipality codes: INE, https://www.ine.es/daco/daco42/codmun/diccionario26.xlsx

SHA-256 of the ZIPs as downloaded:

| Year | SHA-256 |
|---|---|
| 2020 | `c5a9d20f1c51c351b6b1471b8c2bdd3441c32e83a6bce2068b08016be125765e` |
| 2021 | `a3a227d5dd7b03879b765051339f4d8250abd967b5acea9ead955451cd560992` |
| 2022 | `b0689cb3c0c4cc282ed84ce00850101adbdab869f4f106189fdbd2d4b29b5d38` |
| 2023 | `b238c368ac8c7321b4cf21a5e114976f47d78c066db271d246680f620e77a2ce` |
| 2024 | `2548c5d154f405b7a091e70a172d6c2346200a7c7b527ff86ff02112d63c2764` |
| 2025 | `12959c31c3debae2135142372bd3fc4c88fceac998eac5e5701d218ca3ad1c65` |

## Licence

The datos.gob.es record of this dataset names https://datos.gob.es/avisolegal as
its licence. That notice allows commercial and non-commercial reuse on condition
of citing the source, stating the last update date where the document gives one,
not distorting the meaning, and not implying the holder endorses the reuse. Its
wording names the Secretaría de Estado de Digitalización, not DGT. DGT's own
aviso legal covers the portal's intellectual property and does not address
datasets. There is no Creative Commons label on the dataset.

Citation: *Origen de los datos: Dirección General de Tráfico, Microdatos de parque
de vehículos (Anual), última actualización 31/12/2025. Elaboración propia.*

## Fields

| Field | Layout definition | Used for |
|---|---|---|
| `PROVINCIA` | Province where the vehicle is domiciled | `07` = Balearics, `28` = Madrid |
| `MUNICIPIO` | INE code of the municipality of domicile; blank below 10,000 residents | Island |
| `SERVICIO` | Service code | `A01` = public service, hire without driver |
| `TIPO_DGT` | Vehicle type | `TURISMOS` = cars; `MOTOCICLETAS` + `CICLOMOTORES` = two-wheelers; rest = other |
| `RENTING` | Renting flag, S/N, often blank | Balearic total only |
| `FECHA_MATR` | Registration date | Confirms each file's cut-off |

Each file is pipe-delimited with one row per vehicle and a header row. Column
positions come from the header, because the 2023 file names one column differently.

## Method

1. Stream each ZIP without unpacking it. Every year has 0 malformed rows.
2. Keep rows with `SERVICIO` = `A01`.
3. Count by province, then for province `07` by island from `MUNICIPIO`, using the
   explicit list of the 67 INE codes in the script. A blank goes to `Unallocated`.
4. Fold `TIPO_DGT` into cars, two-wheelers and other.

```
python3 -I count_fleet.py <dir-with-zips> <output-dir>
```

Runs in about 2 minutes on 4 cores. `raw_aggregates.json` holds municipality
cells, some small: it is a working file, do not publish it.

## Limits

- **Domicile, not location.** Fleets domiciled elsewhere are not counted.
- **Blank municipalities.** In 2025, 25 of 67 Balearic municipalities are named and
  7,640 of 48,428 vehicles have no municipality. Every island figure is a minimum.
  Mallorca is 18,765 at least and 26,405 at most, cars 12,804 to 18,527. Alaior is
  blank in 2023 and named in other years.
- **No circulating flag.** DGT's `FLG_CIRCULANTE` is not in the public file, so
  inactive vehicles cannot be removed. DGT's km methodology report gives 37,464,950
  records for the 2024 fleet; the public 2024 file has 37,862,492 rows. We did not
  reconcile the two.
- **A01 is not tourist rental alone.** It covers vans, lorries and trailers.
- **`RENTING` is unreliable over time.** Balearic A01 flagged S goes from 92 (2020)
  to 1,186 (2025), and 13,675 are blank in 2025.
- **Sant Josep de sa Talaia** doubles from 2,942 to 5,931 in 2025 and moves
  Ibiza's cars from 3,334 to 6,766. The data gives no cause.
