Locally serve geospatial raster tiles in the Slippy Map standard.
Project description
🌐 Local Tile Server for Geospatial Rasters
Need to visualize a rather large (gigabytes+) raster? This is for you.
A Python package for serving tiles from large raster files in
the Slippy Maps standard
(i.e., /zoom/x/y.png
) for visualization in Jupyter with ipyleaflet
or folium
.
Launch a demo on MyBinder
Documentation: https://localtileserver.banesullivan.com/
Under the hood, this is also a Flask blueprint/application for use as a standalone web app or in your own web deployments needing dynamic tile serving.
🌟 Highlights
- Launch a tile server for large geospatial images
- View local or remote* raster files with
ipyleaflet
orfolium
in Jupyter - View rasters with CesiumJS with the built-in web application
*remote raster files should be pre-tiled Cloud Optimized GeoTiffs
🚀 Usage
Usage details and examples can be found in the documentation: https://localtileserver.banesullivan.com/
The following is a minimal example to visualize a local raster file with
ipyleaflet
:
from localtileserver import get_leaflet_tile_layer, TileClient
from ipyleaflet import Map
# First, create a tile server from local raster file
client = TileClient('path/to/geo.tif')
# Create ipyleaflet tile layer from that server
t = get_leaflet_tile_layer(client)
m = Map(center=client.center(), zoom=client.default_zoom)
m.add(t)
m
ℹ️ Overview
The TileClient
class can be used to to launch a tile server in a background
thread which will serve raster imagery to a viewer (usually ipyleaflet
or
folium
in Jupyter notebooks).
This tile server can efficiently deliver varying resolutions of your raster imagery to your viewer; it helps to have pre-tiled, Cloud Optimized GeoTIFFs (COGs).
There is an included, standalone web viewer leveraging CesiumJS.
⬇️ Installation
Get started with localtileserver
to view rasters in Jupyter or deploy as your
own Flask application.
🐍 Installing with conda
Conda makes managing localtileserver
's dependencies across platforms quite
easy and this is the recommended method to install:
conda install -c conda-forge localtileserver
🎡 Installing with pip
If you prefer pip, then you can install from PyPI: https://pypi-hypernode.com/project/localtileserver/
pip install localtileserver
💭 Feedback
Please share your thoughts and questions on the Discussions board. If you would like to report any bugs or make feature requests, please open an issue.
If filing a bug report, please share a scooby Report
:
import localtileserver
print(localtileserver.Report())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for localtileserver-0.10.0rc1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0c1667ea96c599c9a8dd425b41b6bd585af63a7ffce83ff33cbd61400d986c9 |
|
MD5 | 153f36d4ef87c4eb7eff4fefff2cb2e4 |
|
BLAKE2b-256 | 1ba6e1716971c5684f44f154c8d145a450e47d59aaa2d7deed10a7a2f0c4d103 |
Hashes for localtileserver-0.10.0rc1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bac2bd7d2686a31b217369b7b8e58b21586b43898731dd86d2b589c21252c66d |
|
MD5 | 3cfad67534f9b5e48940d177a3ac37db |
|
BLAKE2b-256 | 2b4ded996160e4be9727311da5247748d3df80389408da5e3e1901955d44f357 |