Mapbox Vector Tiles with Ellipsis Drive

Daniel van der Maas
5 min readFeb 15, 2023

I have written quite a few articles on how to place vectors from your local machine into an Ellipsis Drive layer. The Ellipsis Drive layer plays the role of a repository in which you can place and fetch vectors.

If you add a vector to the layer, a new vector will be created. If you edit a vector it will result in a new version of an existing vector. And, of course, if you delete one, it will result in a trashed vector.

In this respect Ellipsis Drive contains both the most recent versions of all your vectors, as well as it’s complete history.

Ellipsis makes use of so called paged vector tiles in order to make sure that no matter how large the data set is, vectors can always be found at log(N) efficiency when searching for them by their extent or properties.

But even though searching vectors is log(N) efficient, using Paged Vector Tiles when visualizing vectors in a web app, is not optimal. This is because vectors are stored as ‘one’. That is to say, if you have the border of the USA as one vector on your local machine and you post it to a layer, it will be stored as 1 unit.

This is desirable as you might want to be able to retrieve this border at some later stage or you might want to post an update to it. But on the other hand, it has a very negative impact on the speed with which you can visualize it on a web map.

Imagine for example that we are on a web map and we are only looking at Florida. We would need to retrieve the full border of the USA in order to do that… For visualization of your dataset, you would be a lot better of if your original vectors would be processed. Meaning; cut into smaller pieces and simplified when possible.

Now this cutting up and simplification is exactly what Mapbox Vector Tiles do.

Processing of raw vectors to Mapbox Vector Tiles

This processing makes sure that you can render what you need, and only what you, need in a web map.

In short:

  • Paged Vector Tiles are great if you wish to be able to update your vectors or if you are looking at them form a data science perspective
  • Mapbox Vector Tiles are great if you wish to have performant visualization of your vectors.

Mind that the two techniques are not compatible. Processing the vectors makes updates hard, whereas not processing the vectors make visualization hard. So how can you still get both?

How does Ellipsis Drive support both Paged Vector tiles and Mapbox Vector Tiles?

Ellipsis Drive goes about this in the following way:

It always stores your vectors as Paged Vector Tiles, which allow you to query raw data and make updates quickly. At the same time it will calculate processed versions of your vectors as Mapbox Vector Tiles for fast rendering.

Each time you make an update in the layer it recalculates the new relevant tiles as Mapbox Vector Tiles.

This means that your data is always stored as Paged Vector Tiles, allowing you to interact with your raw vectors efficiently. At the same time it also creates Mapbox Vector Tiles after each update, so you have access to a highly performant visualization of your data as well! Mind that due to the compute, your Mapbox Vector Tiles visualization can be a few minutes behind the reality in your Paged Vector Tiles.

Ellipsis Drive workflow

Let’s test this behavior live in the Ellipsis Drive Viewer. I will open a layer in which I have a few building footprints and I choose to render them as Paged Vector Tiles.

Paged Vector Tile rendering of some buildings

Now I choose draw and I add an extra building (in orange)

Paged Vector tile rendering after adding the orange building

Now, when I switch to the Mapbox Vector Tile rendering I can see that the orange building is not (yet) there!

Mapbox Vector Tile rendering without the newly added building

However if I refresh the app after 15 seconds. I do see the building showing up!

Mapbox Vector Tile rendering with the newly added building!

Exporting the layer

If you wish to use the layer outside of the viewer (In some GIS software or in your own app) you can copy/paste the Mapbox Vector Tiles link from the layer details pane in the viewer.

Copy the link to use the vector tiles in your own app or GIS software

In conclusion

Mapbox Vector Tiles provide you with a way to render your data in a highly performant manner. However it comes with a cost: You can no longer easily update vectors and your raw data is lost. This is why Ellipsis Drive works with Paged Vector Tiles that do not have these drawbacks and creates Mapbox Vector Tiles on top of them for rendering purposes.

With Mapbox Vector Tiles you can render up to a few million of vectors without problems in a web browser!

2 million agricultural plots rendering in no time!

--

--

Daniel van der Maas

As CTO of Ellipsis Drive it's my mission to make spatial data useable for developers and data scientists. https://ellipsis-drive.com/