DuckDB is an embedded analytical database its CWI Amsterdam authors call "SQLite for analytics": a single `.duckdb` file, columnar storage, a vectorized engine, and the `ST_*` spatial function set via the spatial extension. Our exporter writes the selected OSM area into a `.duckdb` container where each map layer becomes its own table. To set expectations honestly: geometry is stored as WKT TEXT in a `geom_wkt` column rather than a native GEOMETRY type — to get real geometry you simply call `ST_GeomFromText(geom_wkt)` after `LOAD spatial`. Coordinates stay in WGS84 (EPSG:4326); spatial indexes and Hilbert sorting are not created — those are left to you.
Key Features
About DuckDB Format
DuckDB is an analytical database that lives in a single file and needs no server. It is often called the SQLite of analytics: columnar storage and a vectorized engine give fast aggregations and joins over millions of rows right on a laptop, while the spatial extension adds the familiar ST_ functions.
A map is exported to DuckDB when you need SQL but do not want to raise PostgreSQL with PostGIS: a one-off analysis in a notebook, an ETL script, a model in dbt, a prototype query before moving it into a big warehouse. The file can simply be handed to a colleague — they will open it with a single command.
The output is a single .duckdb file, where every map layer has become a separate table and OSM attributes have become columns; the export parameters lie in the service table _metadata. The geometry is written as WKT text into the geom_wkt column: that way the file reads even without the spatial extension, and real geometry is obtained by calling ST_GeomFromText after LOAD spatial. The coordinates are WGS84; spatial indexes are not created, that decision is left to you.
What Program Opens DuckDB Files
The following programs and applications can open, edit, and work with DuckDB Spatial Database (.duckdb) files exported from OSM2CDR:
Format specifications
- Proprietary format
- 2D only
- Lossless (no quality loss)
- Stores feature attributes
- Output: 1 file
- A single .duckdb file, one table per layer; geometry stored as WKT TEXT in geom_wkt (read via ST_GeomFromText after LOAD spatial), WGS84, no spatial index.
Who Uses DuckDB Maps
How to Export DuckDB
How to Open After Export
- DuckDB CLI — run duckdb map.duckdb and look around: SHOW TABLES lists the layers, DESCRIBE lists the columns of a particular table.
- Python — import duckdb, then con.execute("INSTALL spatial; LOAD spatial;") and ordinary queries; the result comes straight into pandas.
- Geometry — wrap the column in ST_GeomFromText(geom_wkt), otherwise it stays text: spatial functions do not work with text.
- Exporting further — COPY (SELECT ...) TO 'out.parquet' or 'out.geojson' converts a selection into another format right from SQL, with no intermediate tools.
- DBeaver — connects to the file as to an ordinary database, if you find a graphical client more convenient.
Popular maps in DuckDB
Get DuckDB Spatial Database map exports
Download professional DuckDB maps from OpenStreetMap. Instant generation, any area.