I'm playing around with an idea for reducing the size of my tilecache (inspired by this FOSS4G talk: http://vimeo.com/106873780.
The main idea is to define a set of tiles related to a bounding box, and I've made a small Python-script to calculate exactly what tiles I need (ie a list of tiles indexed by x, y and zoom), this can be found here: https://github.com/atlefren/ToPHR
Now: what I want to do is use TileMill to generate exactly the tiles i've found that I need, but I cannot find a way to throw a list of x,y,z at tilemill and make it render them.
I've looked at the command line export options: https://www.mapbox.com/tilemill/docs/manual/exporting/#exports-from-the-command-line, and I've even tried changing some of the code in tilelive (which actually does the rendering), but I cannot get this to work (I can limit what tiles are generated by editing a bunch of internals, but then the offsets in the resulting .mbtiles db seems to be off, probably related to metatiling, can provide examples here if wanted).
So: the question boils down to:
Is it possible, using some kind of parameter to index.js export, pass a list of x,y,z and render only those tiles? If not, how to go about forking tilemill and/or tilelive to make this possible.
Or, alternatively: how could I achieve this in a better way?
All suggestions are welcome, but I need a programmatic solution.