Localtileserver

Latest version: v0.10.3

Safety actively analyzes 638755 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

0.3.13

Bye-bye, Python 3.6! 👋🏻

This release introduces an override to `ipyleaflet.TileLayer` that constrains the region of requested tiles, per jupyter-widgets/ipyleaflet888. This significantly reduces the load on the tile server when viewing tiles in an `ipyleaflet.Map`

This change required dropping Python 3.6 and was good timing since Python 3.6's Security Support ended Dec 23, 2021 (4 days ago) (ref https://endoflife.date/python). Since `conda-forge` hasn't been building on Python 3.6 for some time, I'm hoping there is minimal impact here

0.3.12

The last few tags have been full of useful/nice to have features and clean up. The follow is a recap

- Multi-band support: create composite images from selected bands
- Automatically opens web browser when launching from command line
- Under the hood improvements and abstraction of the underlying flask app to a Blueprint
- Major UI improvements with color mapping options
- Support user provided CesiumIon tokens
- Support memcached
- Better handle bad filenames/URLs with 404 page
- Improvements to CesiumJS and GeoJS tile viewers
- Google Analytics support
- New pixel endpoint
- New Histogram endpoint
- New tile sources endpoint
- New colormaps listing endpoint

Swagger API Docs

There is now an `/swagger/` view with full API documentation:

| List | Tiles |
|---|---|
| <img width="1253" alt="Screen Shot 2021-12-20 at 12 41 12 AM" src="https://user-images.githubusercontent.com/22067021/146730341-1206cba6-6311-451a-bac9-6cb58bddf75c.png"> | <img width="1253" alt="Screen Shot 2021-12-20 at 12 41 27 AM" src="https://user-images.githubusercontent.com/22067021/146730346-7c8a0cfc-7a64-4349-b0f6-de64704c576b.png"> |

This introduced a new `flask-restx` dependency.

Docker Image

You can now pull a pre-built docker image from the packages of this repository


docker pull ghcr.io/banesullivan/localtileserver/localtileserver:latest


To run:

bash
docker run --rm -it -p 8000:8000 ghcr.io/banesullivan/localtileserver/localtileserver



If you want to serve/visualize tiles from files on your local system, simply mount the directory:
bash
docker run --rm -it -p 8000:8000 -v /path/to/mount/:/data ghcr.io/banesullivan/localtileserver/localtileserver


Then be sure to put the `?filename=/data/...` in the URL params

0.3.5

This release adds support for three new features:

- Choose which bands to use for RGB channels when tile serving
- Generate thumbnails with the same styling parameters as tile serving
- Use any Matplotlib colormap as a `palette` choice


Example

There is a new example in the README to demonstrate RGB channel selection:

py
from localtileserver import get_leaflet_tile_layer, TileClient
from ipyleaflet import Map, ScaleControl, FullScreenControl, SplitMapControl

First, create a tile server from local raster file
tile_client = TileClient('landsat.tif')

Create 2 tile layers from same raster viewing different bands
l = get_leaflet_tile_layer(tile_client, band=[7, 5, 4])
r = get_leaflet_tile_layer(tile_client, band=[5, 3, 2])

Make the ipyleaflet map
m = Map(center=tile_client.center(), zoom=12)
control = SplitMapControl(left_layer=l, right_layer=r)
m.add_control(control)
m.add_control(ScaleControl(position='bottomleft'))
m.add_control(FullScreenControl())
m


<img width="841" alt="ipyleaflet-multi-bands" src="https://user-images.githubusercontent.com/22067021/144772211-53c1d854-ecdd-4f19-9594-4843303e2b04.png">

Thumbnails

and you can also generate styled thumbnails with

py
tile_client.thumbnail(band=[5, 3, 2], output_path='thumbnail_styled.png')


![thumbnail](https://user-images.githubusercontent.com/22067021/144772263-66cc7e1a-195b-4791-ab56-bc498c976c04.png)

as opposed to the default channels:

py
tile_client.thumbnail(output_path='thumbnail_default.png')


![thumbnail](https://user-images.githubusercontent.com/22067021/144772326-a101b0b2-0b88-41de-a6b2-0ee6805fb7b9.png)


Matplotlib Colormaps

and you can plot any single band with a matplotlib colormap by:

py
l = get_leaflet_tile_layer(tile_client, band=7, palette='rainbow')


m = Map(center=tile_client.center(), zoom=10)
m.add_layer(l)
m

<img width="1159" alt="Screen Shot 2021-12-05 at 6 15 32 PM 1" src="https://user-images.githubusercontent.com/22067021/144772441-a4c656f9-76df-4900-bbc4-9a0939b0705d.png">

0.3.4

This adds support for serving tiles from remote raster files through GDAL's [Virtual Storage Interface](https://gdal.org/user/virtual_file_systems.html). 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.

py
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

<img width="808" alt="vsi-raster" src="https://user-images.githubusercontent.com/22067021/143668074-dac194ce-f602-4edc-b87d-6ae152951bfc.png">

0.3.2

Now you can easily create tile layers for viewing with Folium!

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

First, create a tile server from local raster file
tile_client = TileClient('~/Desktop/TC_NG_SFBay_US_Geo.tif')

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


https://user-images.githubusercontent.com/22067021/143659402-f1ee453c-4c56-4908-a7d7-1e34c83a3edf.mov

0.3.0

I decided to rename the package to `localtileserver` to simplify installation and have a name consistent with the scope of package.

Page 2 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.