mapboxtippecanoe

Estimating Mapbox tile processing costs


We're using ogr2ogr and tippecanoe to generate MBTILES files and then uploading them to Mapbox. This incurs Mapbox's recent-ish tile processing and hosting costs.

We've been hit by a couple of surprise bills. We can work around this by following the advice on https://docs.mapbox.com/help/troubleshooting/manage-tileset-costs/#how-do-i-lower-my-tileset-processing-costs.

But there doesn't seem to be an obvious way to estimate tile processing costs before the upload occurs. I'd like to display the tileset's kilometers squared figure, resolution, and calculate a cost to show to our team before the upload occurs.

Does anyone know how this could be achieved?


Solution

  • Turns out Mapbox does have a tool for this, but it's not linked from any of their documentation.

    See https://github.com/mapbox/tilesets-cli/#estimate-area

    Example usage:

    # tilesets estimate-area tennis.json -p 30cm
    
    {"km2": "502912", "precision": "30cm", "pricing_docs": "For more information, visit https://www.mapbox.com/pricing/#tilesets"}