Skip to content

Hugi-R/wplace-archive-world-map

Repository files navigation

wplace-archive-world-map

A Go-based project for ingesting, transforming, and serving Wplace archives.

This is what's behind wplace.eralyon.net.

Features

  • 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.

Getting Started

Prerequisites

Build & Run

./build.sh
# ls bin
# import ingest  merger  tileserver

Import

Import 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=latest

To get one archive per day, as wplace.eralyon.net, run:

./bin/import -type=all

Then to update it every day:

./bin/import -type=daily

Ingest (advanced)

Ingest 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 16

Ingest 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 16

This 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)

Merge (advanced)

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 10

This 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)

Tileserver

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/tileserver

The server is available at http://localhost:8080.

Disclaimer

  • 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.

License

Code: MIT License. Images (test): wplace.live and its community.

About

Tools to create and serve a map from a Wplace archive

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages