A Go-based project for ingesting, transforming, and serving Wplace archives.
This is what's behind wplace.eralyon.net.
- Ingest and store map tiles from archives into an indexed SQLite DB.
- Incremental ingest, called
diff, to save on storage. - Merge and process tiles for various zoom levels.
- Serve tiles via an HTTP server using minimal CPU. wplace.eralyon.net runs on a single core of an Intel Celeron J4005.
- A simple map web page served by the tile server.
- Go 1.24+
- Docker (optional, for containerizing the tile server)
- Wplace archive can be found at murolem/wplace-archives (and previously at Jazza-231/wplace-scripts)
./build.sh
# ls bin
# import ingest merger tileserverImport is the tool used to update wplace.eralyon.net, it downloads, ingests, and merges an archive automatically.
Optional, configure path. These are the defaults:
export WPLACE_ARCHIVES_URL="https://github.com/murolem/wplace-archives/releases"
export WPLACE_WORK_FOLDER="./wplace-work"
export WPLACE_DONE_FOLDER="./wplace-done"To get the latest archive available, run:
./bin/import -type=latestTo get one archive per day, as wplace.eralyon.net, run:
./bin/import -type=allThen to update it every day:
./bin/import -type=dailyIngest an archive into a DB. PNGs are converted to the palette used by this project.
Supported archive types: tar.gz, 7zip, folder
The files inside the archive should be like */X/Y.png where X and Y are coordinates of the tile.
./bin/ingest --from wplace-archives/archive-1.tar.gz --out data/archive-1.db --workers 16Ingest can build an incremental DB containing only the changed pixels compared to a base DB:
./bin/ingest --base data/archive-1.db --from wplace-archives/archive-2.7z --out data/archive-2.db --workers 16This saves a lot of storage and speeds up ingest when few tiles change. When many tiles change, ingest can be slower due to the extra compute required for diffs.
KNOWN LIMITATION: Unchanged pixels are encoded as transparent pixels. This means that if a pixel in Wplace changed from a color to transparent, that change is lost in the diff. This behavior simplifies applying diffs at runtime (in the browser) but is not an accurate archival format.
| archive-1.db | archive-2.db | |
|---|---|---|
| Size | 5.5 GB | 385 MB |
| Time | 35 m | 16 m |
(Ran on an AMD Ryzen 7 5700X3D)
Create tiles for other zoom levels. Recursively merge and resize tiles (from level 10 to 0), keeping the majority pixel (ignoring transparent pixels). This significantly increases the size of the DB.
./bin/merge --target data/archive-1.db --workers 16 --initz 10This also works on diff'ed DBs, where the base should have been merged first:
./bin/merge --base data/archive-1.db --target data/archive-2.db --workers 16 --initz 10| archive-1.db | archive-2.db | |
|---|---|---|
| Size | 9.3 GB | 695 MB |
| Time | 16 m | 7 m |
(Ran on an AMD Ryzen 7 5700X3D)
The tileserver looks for an index.html.tmpl and DB files named vX_AAA.db. DBs with vX.Y are increments from vX.
The folder used by the tileserver is configured with the DATA_PATH environment variable.
cp index.html data/index.html.tmpl
mv data/tiles-1.db data/v1_2025-08-29H18.db
mv data/tiles-2.db data/v1.01_2025-08-30H00.db
DATA_PATH=./data ./bin/tileserverThe server is available at http://localhost:8080.
- This is a cleaned-up version of a bunch of experiments. Documentation and tests are sparse and will likely remain so.
- GenAI was used in parts of this project: for boilerplate Go code, and much of the HTML/CSS/JS.
Code: MIT License. Images (test): wplace.live and its community.