rio-rgbify
rio-rgbify copied to clipboard
Support 256 x 256 output tilesizes
In order to more easily stay under total and individual (tile) size limits, we should allow creation of mbtiles with 256x256 tiles in addition to 512x512.
Note that mapbox.terrain-rgb uses 256.
Note that mapbox.terrain-rgb uses 256.
While the default tile endpoint is indeed 256, the full size tiles (@2x) are retina resolution at 512x512 (same for all of our raster tiles: https://www.mapbox.com/api-documentation/#retrieve-tiles -- they are resized on-the-fly).
512: https://api.mapbox.com/v4/mapbox.terrain-rgb/11/334/[email protected]?access_token=<token>

256: https://api.mapbox.com/v4/mapbox.terrain-rgb/11/334/793.pngraw?access_token=<token>

I'd guess that for hillshading 512 is overkill, but 512 tiles work great for other uses in order to make fewer calls to the api, eg: https://www.mapbox.com/labs/terra/#15.1541/-25.3483/131.0368/31.8413/36
I think the default tileSize should be 512. As mapbox-gl-js uses 512 tiles, a 256 tile source would cause mapbox-gl-js request four 256-based tiles to compose a 512 tile. Not only more requests, but also the total size of tiles increase.