Skip to content

Support URL Rasters and Performance Improvements

Compare
Choose a tag to compare
@banesullivan banesullivan released this 27 Nov 04:34
· 414 commits to main since this release

This adds support for serving tiles from remote raster files through GDAL's Virtual Storage Interface. Simply pass your http<s>:// or s3:// URL to the TileClient. This will work quite well for pre-tiled Cloud Optimized GeoTiffs, but I do not recommend doing this with non-tiled raster formats.

Further, this release contains a few internal changes that dramatically improve the performance of the underlying tile server. Users can control whether the server is run in a multi-threaded or multi-process manner.

from localtileserver import get_folium_tile_layer
from localtileserver import TileClient
from folium import Map

# This is a ~3GiB image
url = 'https://opendata.digitalglobe.com/events/california-fire-2020/pre-event/2018-02-16/pine-gulch-fire20/1030010076004E00.tif'

# First, create a tile server from local raster file
tile_client = TileClient(url)

# Create folium tile layer from that server
t = get_folium_tile_layer(tile_client)

m = Map(location=tile_client.center())
m.add_child(t)
m

vsi-raster