Changelogs » Localtileserver

PyUp Safety actively tracks 373,221 Python packages for vulnerabilities and notifies you when to upgrade.

Localtileserver

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.

0.2.3

Now included are some prebaked UI controls for ipyleaflet that let you easily extract ROIs. Take a look at the example in the README.
  
  https://user-images.githubusercontent.com/22067021/143311931-e19647d0-74bc-490a-821c-8046fc9c5dfa.mov

0.2.2

The default viewer in the included web app now uses CesiumJS!
  
  
  https://user-images.githubusercontent.com/22067021/143178656-12e6e0fa-b601-4746-aae9-726d6f109fee.mov