mactrem / com-tiles

Streamable and read optimized file archive for hosting map tiles at global scale on a cloud object storage
MIT License
94 stars 12 forks source link
cloud-native geospatial gis map

Cloud Optimized Map Tiles (COMTiles)

Based on the ideas of Cloud Optimized GeoTIFF and extended for the usage of raster and in particular vector map tilesets. COMTiles are a streamable and read optimized file archive for hosting map tiles at global scale on a cloud object storage. Currently most geospatial data formats (like MBTiles, Shapefiles, KML, ...) were developed only with the POSIX filesystem access in mind. COMTiles in contrast is designed to be hosted on a cloud object storage like AWS S3 or Azure Blob Storage without the need for a database or tile server on the backend side. The map tiles can be accessed directly from a browser via HTTP GET range requests. Via COMTiles an object storage can be used as a spatial database regarding the visualization of map tiles. COMTiles aims to be a MBTiles database for the cloud. The main focus of COMTiles is to significantly reduce costs and simplify the hosting of large raster and vector tilesets at global scale in the cloud, as no dedicated tile backend is required.

For the basic concepts of COMTiles have a look at the lightning talk at the OGC Cloud-Native Geospatial Outreach Event. For a detailed description of the format have a look at the specification.

📝 For a more in-depth exploration of further optimizing COMTiles, please refer to the recent published paper called COMTILES: A CASE STUDY OF A CLOUD OPTIMIZED TILE ARCHIVE FORMAT FOR DEPLOYING PLANET-SCALE TILSETS IN THE CLOUD. The POC discussed in the paper is not yet integrated into this repository but can be found in the com-tiles-evaluation repository.

Tools

Demo

In the following examples the europe tileset is based on a MBTiles database from MapTiler and converted to a COMTiles archive with the @comt/mbtiles-converter. The index for zoom level 0 to 10 is part of the initial fetch when the page is loaded. For zoom 11 to 14 the index fragments with a size of 37kb are lazy loaded. For exploring a city like munich and surroundings only one additional HTTP request per zoom level is needed.

Europe tileset hosted on a AWS S3 standard storage with a disabled browser cache. COMTiles YouTube video

Europe tileset hosted on a local MinIO storage with a disabled browser cache. COMTiles YouTube video

In the following example the tile requests are batched resulting in only 2 to 3 tile requests for a specific zoom level compared to up to 15 requests with the standard approach (tile by tile) on an HD display. COMTiles YouTube video

In the following example a planet scale tileset is hosted on an AWS S3 and accessed from an AWS CloudFront CDN.
The index for zoom 0 to 7 is downloaded with the first initial fetch.
For zoom 8 to 14 one pre-fetch per zoom level for the specific index fragment is needed, but this only takes about 30 milliseconds.
COMTiles YouTube video

COMTiles archive vs directly hosting the map tiles

Advantages of COMTiles

Advantages of directly hosting the map tiles

Similar formats

Cloud Optimized GeoTiff

A Cloud Optimized GeoTIFF (COG) is a regular GeoTIFF file with an internal organization that let clients ask for just the portions of a file that they need via HTTP GET range requests. A COG is limited to raster data.

FlatGeobuf

A performant binary encoding for geographic data based on flatbuffers that can hold a collection of Simple Features including circular interpolations as defined by SQL-MM Part 3.

PMTiles

PMTiles is a single-file archive format for directories of map tiles. The index of a PMTiles archive is structured in directories compared to the fragment based approach of a COMTiles archive.

Use Cases

Repository structure

References