BLOG

Galactus DB 2.2.0: the whole map of Great Britain in a 4 GB container

04/11/2026

Published

We loaded every road, building, wood, river and place name in Great Britain into Galactus DB 2.2.0, running in a container capped at 4 GB of memory. That is 16.1 million shapes from Ordnance Survey's VectorMap District, 12 GB of shapefiles. The load took six minutes and never used more than 1.7 GB. A map viewer now draws it straight from the spatial indexes, from a single street to the whole country, at 2 ms per tile.

What we loaded

OS VectorMap District is Ordnance Survey's open map of Great Britain, published as ESRI shapefiles in 55 folders of 100 km grid squares. It has 21 layers: buildings, roads, woodland, rivers and lakes, the coast, railways, administrative boundaries, place names and more.

Shapefiles945 files, 12.2 GB extracted (2.6 GB zipped)
Features16,134,472
Vertices282.6 million
CoordinatesBritish National Grid eastings and northings, in metres

The Lake District at 12 m per pixel: every stream, tarn, wood and fell name, drawn from Galactus DB

Each layer became a label with its own spatial index, and main roads got a second label so the national view can draw the trunk network on its own. That makes 22 spatial indexes in all. The shapes are stored as cartesian geometry in metres, exactly as they appear in the files.

Six minutes to load

We wrote the importer in Rust. It reads the .shp and .dbf files itself and sends the shapes to Galactus over Bolt as well-known binary, in batches of 2,000, on four connections. Polygons with several parts become a shape per part, and the largest coastlines and forests are cut into pieces of about a thousand vertices, which keeps every map tile small. The indexes were created first and kept up to date as the rows arrived.

Keeping 22 indexes up to date during the load costs about a sixth of the time. One 100 km square around Stoke-on-Trent and Shropshire, 733,017 shapes, loads in 13.7 s with its indexes and 11.4 s without them.

Seconds to load one 100 km square with and without its spatial indexes

1.7 GB at the busiest moment

The container had a hard 4 GB limit and no swap. Galactus started at 26 MB and averaged 1.2 GB while it loaded. The highest reading, near the end of the load, was 1.7 GB. Galactus sized its own page cache at 1 GB, half of its default memory budget, and stayed inside it.

Container memory before and while loading, against the 4 GB limit

Smaller than the files it came from

With all 22 spatial indexes, the database takes 9.5 GB on disk, against 12.2 GB for the shapefiles it was loaded from.

Size on disk of the shapefiles and of the Galactus DB database

A map that keeps up

The viewer is a desktop app, written in Rust like the importer. It cuts each layer into square tiles of the British National Grid, from 2 km for buildings to 64 km for the sea, and fetches each tile with one call:

CALL db.index.spatial.intersects('vmd_building',
  spatial.fromWKT('POLYGON((330000 330000,332000 330000,332000 332000,330000 332000,330000 330000))'))
YIELD node
RETURN node.shape

Eight connections fetch the tiles nearest the centre of the screen first. The viewer keeps fetched tiles on the graphics card, so panning and zooming never wait for the database.

Stoke-on-Trent at 3 m per pixel: buildings, roads by class, rivers and woodland

Westminster and St James's Park at 1.2 m per pixel

Its demo mode flies from place to place on its own, and the panel shows what Galactus is doing as it goes: tile queries in the last five seconds, their median and 95th percentile, shapes on screen and the database's own page cache.

The viewer in demo mode with its live statistics panel

We flew it twice round twelve places, from the Welsh border to Westminster, Skye and the whole of Great Britain, holding each one for a few seconds:

Tile query latency from the viewer, and single-tile medians by layer

What changed in 2.2.0

The shape index is now a multi-level grid. Each shape is filed once, in the grid cell sized to fit it, and a query reads only the cells around its own outline. A query's cost follows the shapes near it, however large the map grows. The cell sizes come from the coordinates, so metres, feet and degrees all work without configuration.

Galactus DB 2.2.0 is on Docker Hub now as ianknowles/galactus-db:2.2.0 and latest, for Linux AMD64 and ARM64.

How we measured

Contains OS data © Crown copyright and database right 2026.