Skip to content

Guides

Converting extracts

Choose a format, a shape and the object types to convert.

bagkit convert reads one or more inputs and writes one output. Inputs can be the national ZIP, nested ZIPs, gzip or plain XML files, or directories of them, in any order. Directories are searched recursively; symbolic links that form a cycle are not supported.

bagkit convert <INPUTS>...
[--format sqlite|csv|parquet]
[--shape tables|addresses]
[--include TYPES] [--exclude TYPES]
[--date YYYY-MM-DD]
[--output PATH] [--force]
bagkit convert lvbag-extract-nl.zip --output bag.sqlite

One database file with indexes, the adressen view, a spatial index and GeoPackage registration. It is the only format that query and serve can use, and QGIS opens it directly.

Values mean the same in every format; see Tables for how each column is written.

  • tables (the default) writes one dataset per object type, linked by identificaties. See Tables.
  • addresses writes the adreslijst: one flat row per current adres, with its names and coordinates already joined. See Address lists.

--include and --exclude take comma-separated object types and apply to the tables shape:

Name What it covers
woonplaatsen Woonplaatsen
gemeenten Each woonplaats’s gemeente, and the names and provincies of gemeenten
openbare-ruimten Openbare ruimten
nummeraanduidingen Nummeraanduidingen
adresseerbare-objecten Verblijfsobjecten, ligplaatsen and standplaatsen
panden Panden
geometrie The vlakken of panden and adresseerbare objecten
# Everything except panden and geometrie.
bagkit convert lvbag-extract-nl.zip --format parquet --exclude panden,geometrie
# Only nummeraanduidingen and their adresseerbare objecten, with geometrie.
bagkit convert lvbag-extract-nl.zip --include nummeraanduidingen,adresseerbare-objecten,geometrie

Object types nobody selected are skipped without being read, so leaving out panden, the largest part of the extract, saves the most work.

What leaving types out means for the rest:

  • A reference is checked only when both sides were read. Without openbare-ruimten, a nummeraanduiding’s openbare_ruimte_identificatie is kept as the BAG records it, unverified.
  • Without adresseerbare-objecten, nummeraanduidingen have no object link, since that link comes from the objects.
  • The verblijfsobject_panden table needs both adresseerbare-objecten and panden.
  • A SQLite database always has every table, empty for the types that were not read, so its views and lookups keep working. The metadata lists the types that were read.

Every conversion selects the voorkomens that are current on one date, the peildatum, by default today’s. Use --date for another one:

bagkit convert lvbag-extract-nl.zip --date 2026-10-08

See Peildatum for what “current” means.

The default output is bag.sqlite, the directory bag, or adreslijst.csv/adreslijst.parquet. bagkit refuses to overwrite an existing output unless you pass --force. Either way the output is built beside its destination and only moved into place once it is complete, so a failed conversion never leaves a half-written file. See Keeping data current.