Skip to content

Joining tilesets

manby join takes tile-join’s options, prints its messages, exits as it does, and makes the same tiles, with their features in the same order. It merges tilesets, joins attributes from a CSV file, filters and renames layers, filters features, overzooms, and converts between MBTiles, PMTiles and directories.

Terminal window
manby join -o merged.pmtiles roads.pmtiles places.mbtiles
manby join -c tracts.csv -o joined.pmtiles tracts.pmtiles

manby tile-join works too. Under the name tile-join, a link to it for example, manby is tile-join, so it can take its place.

Median of three runs, against tile-join 2.82.0. For every run the tiles decode to exactly what tile-join makes.

Seconds to join or copy each tilesetmanby jointile-join
Copy to PMTiles, macOS
0.63 s, 34.8x faster
21.9 s
Copy to PMTiles, Linux
1.05 s, 23.0x faster
24.2 s
Copy to MBTiles, macOS
1.19 s, 13.9x faster
16.6 s
Copy to MBTiles, Linux
1.28 s, 15.9x faster
20.4 s
Join a CSV, macOS
1.09 s, 20.7x faster
22.6 s
Join a CSV, Linux
1.92 s, 13.5x faster
25.9 s
Merge to PMTiles, macOS
0.38 s, 3.2x faster
1.2 s
Merge to PMTiles, Linux
0.68 s, 2.4x faster
1.62 s
Merge to MBTiles, macOS
0.4 s, 2.9x faster
1.15 s
Merge to MBTiles, Linux
0.69 s, 2.2x faster
1.51 s
Overzoom, macOS
0.39 s, 9.9x faster
3.87 s
Overzoom, Linux
0.72 s, 8.3x faster
5.99 s
The figures as a table
Benchmarktile-joinmanby joinSpeedup
Copy to PMTiles, macOS21.9 s0.63 s34.8x
Copy to PMTiles, Linux24.2 s1.05 s23.0x
Copy to MBTiles, macOS16.6 s1.19 s13.9x
Copy to MBTiles, Linux20.4 s1.28 s15.9x
Join a CSV, macOS22.6 s1.09 s20.7x
Join a CSV, Linux25.9 s1.92 s13.5x
Merge to PMTiles, macOS1.2 s0.38 s3.2x
Merge to PMTiles, Linux1.62 s0.68 s2.4x
Merge to MBTiles, macOS1.15 s0.4 s2.9x
Merge to MBTiles, Linux1.51 s0.69 s2.2x
Overzoom, macOS3.87 s0.39 s9.9x
Overzoom, Linux5.99 s0.72 s8.3x
Peak memory in MBmanby jointile-join
Copy to PMTiles, macOS
161 MB
589 MB
Copy to PMTiles, Linux
185 MB
461 MB
Copy to MBTiles, macOS
380 MB
560 MB
Copy to MBTiles, Linux
371 MB
463 MB
Join a CSV, macOS
296 MB
652 MB
Join a CSV, Linux
325 MB
556 MB
Merge to PMTiles, macOS
269 MB
701 MB
Merge to PMTiles, Linux
249 MB
573 MB
Merge to MBTiles, macOS
273 MB
707 MB
Merge to MBTiles, Linux
258 MB
567 MB
Overzoom, macOS
182 MB
592 MB
Overzoom, Linux
196 MB
440 MB
The figures as a table
Benchmarktile-joinmanby join
Copy to PMTiles, macOS589 MB161 MB
Copy to PMTiles, Linux461 MB185 MB
Copy to MBTiles, macOS560 MB380 MB
Copy to MBTiles, Linux463 MB371 MB
Join a CSV, macOS652 MB296 MB
Join a CSV, Linux556 MB325 MB
Merge to PMTiles, macOS701 MB269 MB
Merge to PMTiles, Linux573 MB249 MB
Merge to MBTiles, macOS707 MB273 MB
Merge to MBTiles, Linux567 MB258 MB
Overzoom, macOS592 MB182 MB
Overzoom, Linux440 MB196 MB

The copies take the census tracts at -z12 (312,073 tiles), and the CSV join joins them to a CSV keyed on GEOID. The merges take the 4 million points and the tracts, both at -zg. The overzoom takes counties at -z5 and tracts at -z9, with --overzoom. The benchmarks describe the machines.

The merges spend most of their time on a hundred tiles near the 500 KB limit, which manby join, like tile-join, has to compress with zlib to check their size.

tile-join decodes each tile into layers that each allocate a megabyte of hash tables, does its overzooming one tile at a time, compresses every tile with zlib, and writes PMTiles by way of a SQLite database. manby join keeps tile-join’s order of input tiles and its metadata, does the work on the tiles on every core without those tables, keeps the compression of tiles it does not change, and writes PMTiles directly.

Where several inputs have a tile at the same z/x/y, tile-join appends their features in the order of the tiles’ stored bytes. manby compresses most tiles with libdeflate, whose bytes sort differently from zlib’s, so for tilesets that manby made, manby join compares tiles by the bytes zlib makes of them, which are tippecanoe’s. So manby and then manby join make the tiles that tippecanoe and then tile-join make. tile-join itself, run on manby’s tilesets, can order the features of those shared tiles differently. Tilesets that manby made with --compression=zlib are joined the same way by both.