Localtileserver

Latest version: v0.10.2

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

Scan your dependencies

Page 1 of 3

0.10.0

This release marks a significant re-implementation of localtileserver. The backing tiler has been changed from large-image to [rio-tiler](https://github.com/cogeotiff/rio-tiler). The overall result is improved performance, simplified dependencies, improved compatibility with the rasterio ecosystem, and many bug/quirk fixes like #172, 159, 147

This release unfortunately has many breaking changes and some loss of features. The breaking changes are mostly around API renaming and some methods changing to properties. Otherwise, I stripped out features that are just better handled upstream or not needed here.

This may be a painful upgrade considering how much has changed. Highlights:

- `band` is now `indexes` to follow rio-tiler's implementation (deprecation warning is issued in parts of the API)
- `cmap` is now `colormap` (deprecation warning is issued in parts of the API)
- `palette` is now `colormap`
- Custom colormaps are no longer supported
- No more region of interest extraction
- Access to underlying `rasterio` dataset is now via the `.dataset` property
- COG validation no longer raises errors, but returns a True/False
- `metadata()` method is now a `metadata` property
- No more support for remote servers (niche feature)
- Some return values of things like bounds, metadata, etc may have changed now that they are fetched from rio-tiler


For those looking for more details, I recommend checking out the diff specifically for the test directory to see what has changed in 183

0.7.0

This release significantly changes in the dependencies of `localtileserver` (switching from GDAL to `rasterio`), focuses on geospatial applications by dropping non-geo support, includes optimizations to `TileClient` to avoid REST operations, and majorly refactors the internal code for future development.


What's Changed

* Switch to rasterio by banesullivan in https://github.com/banesullivan/localtileserver/pull/154
* Internal refactoring by banesullivan in https://github.com/banesullivan/localtileserver/pull/155
* An improved TileClient that avoids the REST interface where possible by banesullivan in https://github.com/banesullivan/localtileserver/pull/156


**Full Changelog**: https://github.com/banesullivan/localtileserver/compare/0.6.4...0.7.0

0.5.5

New features:
- Add COG validate helper (see 80)
- Enable `*` CORS by user choice
- Add `is_geospatial` property to `TileClient`
- Add `default_zoom` property to `TileClient` to determine starting zoom on map
- Handle tile serving in pixel coordinates for non-geospatial images

Niceties:
- Handle `large_image` source as input to `TileClient`
- Add `_ipython_display_` to `TileClient` to quickly display a map in Jupyter
- Add `_repr_png_` to `TileClient` to quickly show a thumbnail in Qt IPython
- Add URL form field to web app

Maintenance:
- Maintenance of Docker images
- Internal refactoring to utilize new [`server-thread`](https://github.com/banesullivan/server-thread) package (see #79)
- Documentation and examples improvements

0.5.3

- Style parameters can now be included as a JSON blob in the request body following the [format specified by large-image](https://girder.github.io/large_image/tilesource_options.html#style) or as a `dict` in the `syle` parameter in the Python client.
- `cmap` alias for `palette` in Python client (see 71)
- Better error handling
- Handle Dropbox URLs
- New `save_new_raster` helper method
- Bug fixes, cleanup, and other internal maintenance (see [diff](https://github.com/banesullivan/localtileserver/compare/0.4.2...0.5.3))

This release adds support for `rasterio` datasets so that users can easily visualize their data when working with `rasterio`:

py
import rasterio
from ipyleaflet import Map
from localtileserver import TileClient, get_leaflet_tile_layer

Open raster with rasterio
src = rasterio.open('path/to/geo.tif')

Pass rasterio source to localtileserver
client = TileClient(src)

t = get_leaflet_tile_layer(client)

m = Map(center=client.center(), zoom=8)
m.add_layer(t)
m

0.4.2

This release adds support for using localtileserver in remote Jupyter environments (e.g., MyBinder or JupyterHub) through `jupyter-server-proxy`. Included in this release is a new Docker image on GitHub's package registry for using localtileserver in Jupyter.

py
docker pull ghcr.io/banesullivan/localtileserver-jupyter:latest
docker run -p 8888:8888 ghcr.io/banesullivan/localtileserver-jupyter:latest


To configure this in your own set up, you must set the following environment variables

- `LOCALTILESERVER_CLIENT_PREFIX='proxy/{port}'` - Same for everyone using `jupyter-server-proxy`
- Optional:
- `LOCALTILESERVER_CLIENT_HOST=127.0.0.1` - The host on which you launch Jupyter (the URL/domain of the Jupyter instance if using MyBinder or JupyterHub)
- `LOCALTILESERVER_CLIENT_PORT=8888` - The port on which you launch Jupyter (leave blank if using MyBinder or JupyterHub)

There is a demo in https://github.com/banesullivan/localtileserver-demo that shows how this will work on MyBinder by setting the following at run-time:

py
Set host forwarding for MyBinder
import os
os.environ['LOCALTILESERVER_CLIENT_PREFIX'] = f"{os.environ['JUPYTERHUB_SERVICE_PREFIX'].lstrip('/')}/proxy/{{port}}"


Resolves 29, 66, and https://github.com/banesullivan/localtileserver-demo/issues/1

0.4.0

This release has one breaking change (breaking for a small minority of users) where the API endpoints were renamed to have the `api/` prefix where applicable (see 51). Other notes:

- Document style parameters for Thumbnail endpoint (see 7e27db045b7798ba191f0b4350928eda17625c15)
- Support custom, user-defined palettes (see 54)
- Cesium Split Viewer (see 47 and https://github.com/banesullivan/localtileserver/discussions/53)
- Cesium terrain model is now disabled by default (see fe1c2103aa13cbdc49eb5ec2e785e3a35b8907b8)

Standalone Docker Image - 57

Now you can easily pull a docker image for the latest release or for a specific Pull Request in the repository. Check out the tags for https://github.com/banesullivan/localtileserver/pkgs/container/localtileserver

This is particularly useful if you do not want to install GDAL on your system or want a dedicated service for tile serving.

To use the docker image:

bash
docker pull ghcr.io/banesullivan/localtileserver:latest
docker run -p 8000:8000 ghcr.io/banesullivan/localtileserver:latest


Then visit http://0.0.0.0:8000 in your browser. You can pass the `?filename=` argument in the URL params to access any URL/S3 file.

Note that you can mount your file system to access files locally. For example, I mount my Desktop by:

bash
docker run -p 8000:8000 -v /Users/bane/Desktop/:/data/ ghcr.io/banesullivan/localtileserver:latest


Then I can add the `?filename=` parameter to the URL to access the file `TC_NG_SFBay_US_Geo.tif` file on my desktop. Since this is mounted under `/data/` in the container, you must build the path as `/data/TC_NG_SFBay_US_Geo.tif`, such that the URL would be http://0.0.0.0:8000/?filename=/data/TC_NG_SFBay_US_Geo.tif (or http://0.0.0.0:8000/?filename=%2Fdata%2FTC_NG_SFBay_US_Geo.tif)

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.