Skip to main content

Locally serve geospatial raster tiles in the Slippy Map standard.

Project description

tile-diagram

🌐 Local Tile Server for Geospatial Rasters

codecov PyPI conda

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 MyBinder

Documentation: https://localtileserver.banesullivan.com/

Built on rio-tiler

🌟 Highlights

  • Launch a tile server for large geospatial images
  • View local or remote* raster files with ipyleaflet or folium 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

ipyleaflet

ℹ️ 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.org/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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

localtileserver-0.10.6.tar.gz (17.1 MB view details)

Uploaded Source

Built Distribution

localtileserver-0.10.6-py3-none-any.whl (17.1 MB view details)

Uploaded Python 3

File details

Details for the file localtileserver-0.10.6.tar.gz.

File metadata

  • Download URL: localtileserver-0.10.6.tar.gz
  • Upload date:
  • Size: 17.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.11

File hashes

Hashes for localtileserver-0.10.6.tar.gz
Algorithm Hash digest
SHA256 7dbbd4d54e2bc9ec0f218e6891721dd6ef34da6557ee43d613bc8003967ac585
MD5 5461fa22fa700cf847f27165853f1206
BLAKE2b-256 c8f1c5d6c8ff435ae25bd4871058496ed458bf83bb10d4d590e6ac0582d7e272

See more details on using hashes here.

File details

Details for the file localtileserver-0.10.6-py3-none-any.whl.

File metadata

File hashes

Hashes for localtileserver-0.10.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b634c957b8c4c50aadecb465447c8fb1776a70251e85506b5b5e0fed23b2e0b8
MD5 864237c9513ce70e84c220b0ec36201b
BLAKE2b-256 e17609a8df7973821af8e0b4708f442b746e29d19fbcc60f42c34fb437c9d3cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page