So completely changed my workflow and I have compact couchdb databases in a matter of seconds/minutes from mbtiles. Reduced Tilemill -> Couchdb rendering by days.
New workflow: Tilemill -> mbtiles -> cdbtiles -> couchdb
Using more of the great open-source software by MapBox et al (https://github.com/mapbox and mapbox.com)
Couple of gotchs to installing cdbtiles, at least for my PCBSD/FreeBSD 10.0 system. See: https://www.npmjs.org/package/cdbtiles or the github
npm install cdbtiles doesn't work, use git clone as below. Had to make ln -s python2 python for mbtiles install or fix the python env
Install - FreeBSD 10.0:
- install node
- install npm (separate in FreeBSD ports)
- setenv CXX clang++
- setenv CC clang
- install devel/gmake
- npm install tilelive -g
- git clone https://github.com/mapbox/node-mbtiles.git
- cd ..toto node-mbtiles dir
- npm install -g (gave me some grief, just fix errors - see above)
- git clone https://github.com/vsivsi/cdbtiles.git
- cd .. to cdbtiles dir
- npm install -g
see: https://www.npmjs.org/package/cdbtiles
Use cmd: /usr/local/lib/node_modules/tilelive/bin/copy -s pyramid --minzoom=10 --maxzoom=18 "mbtiles:///Users/user/maps/Columbus.mbtiles" "cdbtiles://127.0.0.1:5984/columbus_tiles/"
Obviously sorted for your parameters and system.
Yields CouchDB of tiles same size as mbtiles imput file after compaction.
Access tiles from ol3:
my_tiles_couchdbLayerXYZ = new ol.layer.Tile({
source: new ol.source.XYZ({url: "http://127.0.0.1:5984/xxxxx_cdbtiles
/tile_{z}_{x}_{y}/tile"
})
});