Uploading Large Files to Mapbox Studio
Originally published at Digital Mapmaking, Victor Temprano's map-focused blog.
At Mapster (my little web mapping company), we're always dealing with pushing the edges in terms of what can be done with Mapbox. We have some great contacts there and we know a lot about how the platforms and libraries have changed over the years -- from the deprecation of beloved TileMill, to the move from open-source to paid for Mapbox GL JS (and development of MapLibre in response), to the new introduction of the Globe (!!) view.
One thing that we run into very often with clients are the file size limitations when it comes to Mapbox Studio. The online interface itself only allows up to 300 MB in size for files -- which, if you've worked with serious shapefiles or TIFFs before, isn't really that much when you're dealing with real-world data.
That being said, the actual file size limits are considerably more -- 10GB for TIFFs, for instance, or a whopping 25 GB for MBTile files. (On this note, you may be wondering how to convert other file formats into MBTiles -- if you are, leave a comment and we'll show you how).
But how do you get those files up into Mapbox if not through the online uploader? MTS is one option, but sometimes you need to just get those exact files up there. Mapbox has the answer, but it's rather annoying and a multi-step process; you have to generate S3 credentials, create uploads, monitor them, etc.
So what's a time-crunched, one-step-process-addicted dev to do? Well, Mapster's got you covered.
Mapster's Mapbox Upload CLI
https://github.com/mapstertech/mapbox-upload-cli
Check out the Mapster Mapbox Upload CLI -- a tool to quickly get you rolling with big uploads to Mapbox. Pull down the tool using Github or the ZIP download, and navigate to the folder in your console.
Drag or copy your tileset source (your TIFF, KML, MBTiles, or whatever) into the same folder as the Upload CLI. This will make it available to the CLI in the next step.
Once you're there, run npm start
. You'll need to enter your Mapbox username, and a Mapbox secret token with the appropriate permissions (uploads:write
, uploads:read
, and uploads:list
). Then, enter the name of the tileset you want to create.
You'll be given a list of files in the directory to choose from for your upload file. Select the right one, hit enter, and you're all good! Your file will be uploaded and you'll get ongoing progress updates as it happens.
Yay for convenience:)
@elastic man It’s great to see Mapster’s dedication to pushing the boundaries of web mapping with Mapbox. Your insights into the evolution of Mapbox platforms and libraries, from the transition to Mapbox GL JS to the introduction of new features like the Globe view, showcase your in-depth knowledge of the field.