With all the tiles generated and optimized, they just need to be packaged in a tarball. Before creating them, we want to create some files with metadata about what was used to generate the tiles. The commit of the stylesheet and the timestamp of the planet file can be extracted with a couple of commands.
Not every user will want all the zooms, so I’m creating multiple tarballs, going from zoom 0 to zoom 6, 0 to 8, and 0 to 10. This duplicates data between the files, but makes them more useful since only one file needs downloading.
tar will pack all of the tiles into one file, and can optionally compress them. Compressing a png won’t normally save space, but compressing a bunch of PNGs, many of which are identical will save space.
1 2 3