### Launch tileserver with example dataset Source: https://localtileserver.banesullivan.com/user-guide/web-app.html Use this command to start the web viewer with a built-in example dataset. Replace 'dem' with any of the available dataset names. ```bash python -m localtileserver dem ``` -------------------------------- ### Quick start: Create a TileClient and display with ipyleaflet Source: https://localtileserver.banesullivan.com/_sources/index.rst.txt This snippet demonstrates the basic usage of localtileserver in a Jupyter notebook. It imports localtileserver, gets example data, creates a TileClient, and displays it on an ipyleaflet map. The commented line shows how to open a local raster file instead of using example data. ```python import localtileserver as lts from localtileserver import examples from ipyleaflet import Map # Create a TileClient from a raster file # client = lts.open('path/to/geo.tif') client = examples.get_san_francisco() # use example data # Create ipyleaflet TileLayer from that server t = lts.get_leaflet_tile_layer(client) # Create ipyleaflet map, add tile layer, and display m = Map(center=client.center(), zoom=client.default_zoom) m.add(t) m ``` -------------------------------- ### Launch local tileserver web application Source: https://localtileserver.banesullivan.com/_sources/user-guide/web-app.rst.txt Launch the local tileserver web application from the command line. The first command starts the viewer for a specified raster file; the second starts it with the 'dem' example dataset. Other available dataset choices include 'blue_marble', 'virtual_earth', 'arcgis', and 'bahamas'. ```bash python -m localtileserver path/to/raster.tif ``` ```bash python -m localtileserver dem ``` -------------------------------- ### Install with pip Source: https://localtileserver.banesullivan.com/_sources/installation/index.rst.txt Alternative installation method using pip from PyPI. Installs localtileserver and ipyleaflet. ```bash pip install localtileserver ipyleaflet ``` -------------------------------- ### run_app Source: https://localtileserver.banesullivan.com/api/utilities.html Serves tiles from a raster file or example dataset, optionally starting a uvicorn server. ```APIDOC ## run_app ### Description Serve tiles from the raster at `filename`. You can also pass the name of one of the example datasets: `elevation`, `blue_marble`, `virtual_earth`, `arcgis` or `bahamas`. ### Method N/A (Python function) ### Endpoint N/A ### Parameters - **filename** (str or pathlib.Path) - Path to a raster file or the name of a built-in example dataset. - **port** (int, optional) - Port to bind the server to. `0` (default) picks an available port. - **debug** (bool, optional) - Run the server with verbose debug logging. - **browser** (bool, optional) - Open a web browser pointing to the viewer on startup. - **cesium_token** (str, optional) - Cesium Ion access token for the 3-D globe viewer. - **host** (str, optional) - Hostname to bind the server to. Default is `"127.0.0.1"`. - **cors_all** (bool, optional) - If `True`, enable permissive CORS headers allowing all origins. - **run** (bool, optional) - If `True` (default), start the uvicorn server. If `False`, return the app without running it. ### Returns - **fastapi.FastAPI** - The configured and (optionally running) FastAPI application. ``` -------------------------------- ### Install with conda Source: https://localtileserver.banesullivan.com/_sources/installation/index.rst.txt Recommended installation method using conda from conda-forge. Installs localtileserver and ipyleaflet. ```bash conda install -c conda-forge localtileserver ipyleaflet ``` -------------------------------- ### Install xarray and rioxarray directly Source: https://localtileserver.banesullivan.com/_sources/user-guide/xarray.rst.txt Alternative installation method for xarray and rioxarray dependencies. ```bash pip install xarray rioxarray ``` -------------------------------- ### Create a virtual mosaic with get_mosaic_tile and get_mosaic_preview Source: https://localtileserver.banesullivan.com/_sources/user-guide/mosaic.rst.txt Use the Python handler functions to create a virtual mosaic from a list of raster files. The default pixel selection method is 'first valid pixel wins'. The example shows how to get a thumbnail and a tile at a specific zoom and location. ```python from localtileserver.tiler.mosaic import get_mosaic_tile, get_mosaic_preview # List of raster files to mosaic files = [ 'path/to/scene_north.tif', 'path/to/scene_south.tif', ] # Get a mosaic thumbnail thumb = get_mosaic_preview(files, max_size=512) # Get a mosaic tile at a specific location tile = get_mosaic_tile(files, z=10, x=512, y=512) ``` -------------------------------- ### pip install localtileserver[helpers] Source: https://localtileserver.banesullivan.com/installation/index.html Installs optional dependencies for geometry helpers, specifically shapely for geometry conversion utilities. ```bash pip install localtileserver[helpers] ``` -------------------------------- ### pip install localtileserver[jupyter] Source: https://localtileserver.banesullivan.com/installation/index.html Installs optional dependencies for Jupyter widget integration. Adds ipyleaflet for inline map rendering; core install already includes jupyter-loopback proxy and comm bridge for tiles in JupyterLab/Hub/Binder, VS Code Jupyter, Google Colab, Shiny, Solara, and marimo. ```bash pip install localtileserver[jupyter] ``` -------------------------------- ### REST API endpoints for different output formats Source: https://localtileserver.banesullivan.com/_sources/user-guide/formats.rst.txt Lists example REST API URLs for requesting tiles and thumbnails in various formats (PNG, JPEG, WebP, GeoTIFF, NumPy) by changing the file extension. Includes thumbnail examples for WebP and GeoTIFF. ```bash # PNG tile (default) GET /api/tiles/10/163/395.png # JPEG tile GET /api/tiles/10/163/395.jpeg # WebP tile GET /api/tiles/10/163/395.webp # GeoTIFF tile GET /api/tiles/10/163/395.tif # NumPy array tile GET /api/tiles/10/163/395.npy # Thumbnails follow the same pattern GET /api/thumbnail.webp?filename=geo.tif GET /api/thumbnail.tif?filename=geo.tif ``` -------------------------------- ### pip install localtileserver[colormaps] Source: https://localtileserver.banesullivan.com/installation/index.html Installs optional dependencies for additional colormaps, specifically matplotlib, cmocean, and colorcet. ```bash pip install localtileserver[colormaps] ``` -------------------------------- ### Get PNG thumbnail (default) using encoding parameter Source: https://localtileserver.banesullivan.com/_sources/user-guide/formats.rst.txt Shows how to create a client from the San Francisco example dataset and request a PNG thumbnail, which is the default format. The encoding parameter is set to 'png'. ```python from localtileserver import examples client = examples.get_san_francisco() # Get a PNG thumbnail (default) client.thumbnail(encoding='png') ``` -------------------------------- ### pip install localtileserver[xarray] Source: https://localtileserver.banesullivan.com/installation/index.html Installs optional dependencies for xarray/DataArray support (NetCDF, Zarr tile serving). Adds xarray and rioxarray. ```bash pip install localtileserver[xarray] ``` -------------------------------- ### Install optional helpers dependency Source: https://localtileserver.banesullivan.com/_sources/installation/index.rst.txt Installs the helpers extra, which adds shapely for geometry conversion utilities. ```bash pip install localtileserver[helpers] ``` -------------------------------- ### Create TileClient and import modules Source: https://localtileserver.banesullivan.com/user-guide/rgb.html Imports localtileserver, ipyleaflet components, and creates a TileClient from an example Landsat file. ```python import localtileserver as lts from localtileserver import examples from ipyleaflet import Map, ScaleControl, FullScreenControl, SplitMapControl # First, create TileClient using example file client = examples.get_landsat() ``` -------------------------------- ### Install localtileserver with Jupyter extra Source: https://localtileserver.banesullivan.com/_sources/installation/remote-jupyter.rst.txt Install localtileserver with the jupyter extra to pull in jupyter-loopback, which provides the proxy extension and autodetect. Use this in remote Jupyter environments like JupyterHub, MyBinder, or JupyterLab behind HTTPS. ```bash pip install localtileserver[jupyter] ``` -------------------------------- ### Access the rasterio dataset of an example elevation client Source: https://localtileserver.banesullivan.com/_sources/user-guide/rasterio.rst.txt Loads an example elevation tile layer and accesses the underlying rasterio dataset. Shows that localtileserver keeps a reference to a rasterio.DatasetReader for all clients. ```python from localtileserver import examples # Load example tile layer from publicly available DEM source client = examples.get_elevation() client.dataset ``` -------------------------------- ### Open a raster and get default zoom Source: https://localtileserver.banesullivan.com/api/python-client.html Opens a raster file with localtileserver.open() and retrieves the default zoom level of the client. The example shows the typical usage pattern for creating a TileClient and accessing its properties. ```python >>> import localtileserver as lts >>> client = lts.open("path/to/raster.tif") >>> client.default_zoom ``` -------------------------------- ### STACClient.statistics() Source: https://localtileserver.banesullivan.com/api/python-client.html Get per-asset/band statistics. ```APIDOC ## STACClient.statistics() ### Description Get per-asset/band statistics. ### Method GET ### Endpoint STACClient.statistics() ### Parameters #### Query Parameters - **assets** (list of str) - Optional - Asset names to compute statistics for. Falls back to the default assets. - **kwargs** - Optional - Additional keyword arguments passed to the underlying statistics function. ### Returns - **dict** - Per-asset/band statistics. ### Response Example ```json { "asset_name": { "min": 0.0, "max": 1.0 } } ``` ``` -------------------------------- ### TileClient.info Source: https://localtileserver.banesullivan.com/api/python-client.html Get dataset info from the rio-tiler reader. ```APIDOC ## info ### Description Return dataset info from the rio-tiler reader. ### Method N/A (Python property) ### Endpoint TileClient.info ### Returns - **rio_tiler.models.Info** - Dataset information including CRS, bounds, and band details. ``` -------------------------------- ### Get a thumbnail preview Source: https://localtileserver.banesullivan.com/_sources/user-guide/index.rst.txt Generates a thumbnail preview of the tile server's data. ```python client.thumbnail() ``` -------------------------------- ### localtileserver.get_or_create_tile_client Source: https://localtileserver.banesullivan.com/_sources/api/python-client.rst.txt Function to get an existing tile client or create a new one. ```APIDOC ## localtileserver.get_or_create_tile_client ### Description Gets an existing tile client or creates a new one. ### Function `localtileserver.get_or_create_tile_client(...)` ### Usage ```python from localtileserver import get_or_create_tile_client client = get_or_create_tile_client(...) ``` ``` -------------------------------- ### TileClient.metadata Source: https://localtileserver.banesullivan.com/api/python-client.html Get metadata for the source dataset. ```APIDOC ## metadata ### Description Return metadata for the source dataset. ### Method N/A (Python property) ### Endpoint TileClient.metadata ### Returns - **dict** - A dictionary of dataset metadata including band descriptions, data types, and statistics. ``` -------------------------------- ### TileClient.dataset Source: https://localtileserver.banesullivan.com/api/python-client.html Get the underlying rasterio dataset. ```APIDOC ## dataset ### Description Return the underlying rasterio dataset. ### Method N/A (Python property) ### Endpoint TileClient.dataset ### Returns - **rasterio.io.DatasetReaderBase** - The opened rasterio dataset. ``` -------------------------------- ### TileClient.filename Source: https://localtileserver.banesullivan.com/api/python-client.html Get the file path or URI of the source dataset. ```APIDOC ## filename ### Description Return the file path or URI of the source dataset. ### Method N/A (Python property) ### Endpoint TileClient.filename ### Returns - **str** - The file path or URI string. ``` -------------------------------- ### STACClient.stac_info() Source: https://localtileserver.banesullivan.com/api/python-client.html Get STAC item metadata. ```APIDOC ## STACClient.stac_info() ### Description Get STAC item metadata. ### Method GET ### Endpoint STACClient.stac_info() ### Parameters #### Query Parameters - **assets** (list of str) - Optional - Asset names to query. Falls back to the default assets. ### Returns - **dict** - Dictionary mapping asset names to their metadata. ### Response Example ```json { "asset_name": { "key": "value" } } ``` ``` -------------------------------- ### GET /api/thumbnail.{fmt} Source: https://localtileserver.banesullivan.com/api/rest-api.html Serves a thumbnail preview of the entire raster. The format is determined by the {fmt} path parameter. ```APIDOC ## GET /api/thumbnail.{fmt} ### Description Serve a thumbnail preview of the entire raster. ### Method GET ### Endpoint /api/thumbnail.{fmt} ### Parameters #### Path Parameters - **fmt** (string) - Required - Output format (e.g., png, jpg) #### Query Parameters - **filename** (string) - Optional - Path or URL to the raster file. - **indexes** (string) - Optional - Comma-separated band indexes (e.g., `1,2,3`). - **colormap** (string) - Optional - Colormap name (e.g., `terrain`, `viridis`), or a JSON color definition. - **vmin** (number) - Optional - Minimum value for rescaling (comma-separated for per-band values). - **vmax** (number) - Optional - Maximum value for rescaling (comma-separated for per-band values). - **nodata** (number) - Optional - Override the file’s nodata value. - **expression** (string) - Optional - Band math expression (e.g., `(b4-b1)/(b4+b1)`). Mutually exclusive with `indexes`. - **stretch** (string) - Optional - Stretch mode: `none`, `minmax`, `linear`, `equalize`, `sqrt`, `log`. ### Response #### Success Response (200) Returns the thumbnail image in the requested format. ``` -------------------------------- ### TileClient.default_zoom Source: https://localtileserver.banesullivan.com/api/python-client.html Get the default zoom level for the dataset. ```APIDOC ## default_zoom ### Description Return the default zoom level for the dataset. This is set to `min_zoom`. ### Method N/A (Python property) ### Endpoint TileClient.default_zoom ### Returns - **int** - The default zoom level. ``` -------------------------------- ### TileClient.min_zoom Source: https://localtileserver.banesullivan.com/api/python-client.html Get the minimum zoom level for the dataset. ```APIDOC ## min_zoom ### Description Return the minimum zoom level for the dataset. ### Method N/A (Python property) ### Endpoint TileClient.min_zoom ### Returns - **int** - The minimum zoom level. ``` -------------------------------- ### TileClient.max_zoom Source: https://localtileserver.banesullivan.com/api/python-client.html Get the maximum zoom level for the dataset. ```APIDOC ## max_zoom ### Description Return the maximum zoom level for the dataset. ### Method N/A (Python property) ### Endpoint TileClient.max_zoom ### Returns - **int** - The maximum zoom level. ``` -------------------------------- ### TileClient.band_names Source: https://localtileserver.banesullivan.com/api/python-client.html Get the band names extracted from the dataset metadata. ```APIDOC ## band_names ### Description Returns band name strings extracted from the dataset metadata. ### Method N/A (Python property) ### Endpoint TileClient.band_names ### Returns - **list of str** - Band name strings. ``` -------------------------------- ### STACClient.get_tile_url() Source: https://localtileserver.banesullivan.com/api/python-client.html Get slippy maps tile URL for the STAC item. ```APIDOC ## STACClient.get_tile_url() ### Description Get slippy maps tile URL for the STAC item. ### Method GET ### Endpoint STACClient.get_tile_url() ### Parameters #### Query Parameters - **assets** (list of str) - Optional - Asset names to include. Falls back to the default assets. - **expression** (str) - Optional - Band math expression. Falls back to the default expression. - **client** (bool) - Optional - If `True`, build the URL using the client-facing host/port. - **kwargs** - Optional - Accepted for compatibility with widget helpers; ignored. ### Returns - **str** - The tile URL template with `{z}/{x}/{y}` placeholders. ### Response Example ```json { "tile_url": "http://localhost:8000/tiles/{z}/{x}/{y}.png" } ``` ``` -------------------------------- ### get_or_create_tile_client Source: https://localtileserver.banesullivan.com/api/python-client.html Gets an existing TileClient or creates a new one from a source, returning the client and a flag indicating whether it was internally created. ```APIDOC ## get_or_create_tile_client ### Description Get an existing TileClient or create a new one from a source. ### Method `get_or_create_tile_client(source, port='default', debug=False)` ### Parameters - **source** (Path | str | TileClient | DatasetReaderBase) - Required - The raster source. If already a `TileClient`, it is used directly. Otherwise, a new `TileClient` is created. - **port** (int | str) - Optional - The port on your host machine to use for the tile server. Defaults to `"default"` which selects an available port. - **debug** (bool) - Optional - Run the tile server in debug mode. Defaults to `False`. ### Returns - **source** (TileClient) - The tile client instance. - **_internally_created** (bool) - `True` if a new `TileClient` was created internally, `False` if the provided `source` was already a `TileClient`. ``` -------------------------------- ### STACClient.center() Source: https://localtileserver.banesullivan.com/api/python-client.html Get the center of the STAC item in (lat, lon) form. ```APIDOC ## STACClient.center() ### Description Get the center of the STAC item in `(lat, lon)` form. ### Method GET ### Endpoint STACClient.center() ### Parameters None ### Returns - **tuple of float** - A tuple of `(latitude, longitude)`. ### Response Example ```json { "latitude": 0.0, "longitude": 0.0 } ``` ``` -------------------------------- ### statistics(indexes=None, expression=None) Source: https://localtileserver.banesullivan.com/api/python-client.html Gets per-band statistics (min, max, mean, std, histogram). ```APIDOC ## statistics(indexes=None, expression=None) ### Description Gets per-band statistics (min, max, mean, std, histogram). ### Parameters - **indexes** (list of int, optional) - Band indexes to compute statistics for. - **expression** (str, optional) - Band math expression to compute statistics on. ### Returns - **dict** - Per-band statistics keyed by band name. ``` -------------------------------- ### get_leaflet_map(add_bounds=False, **kwargs) Source: https://localtileserver.banesullivan.com/api/python-client.html Gets an ipyleaflet Map centered and zoomed to the dataset bounds. ```APIDOC ## Method: get_leaflet_map ### Description Get an ipyleaflet Map centered and zoomed to the dataset bounds. ### Parameters - **add_bounds** (_bool_, optional) - If `True`, add a WKT boundary layer to the map. Requires `shapely`. Defaults to `False`. - ****kwargs** - Additional keyword arguments passed to `ipyleaflet.Map`. ### Returns - **ipyleaflet.Map** - A map widget centered on the dataset with the default zoom level. ``` -------------------------------- ### get_tile_url(indexes=None, colormap=None, vmin=None, vmax=None, nodata=None, client=False, expression=None, stretch=None) Source: https://localtileserver.banesullivan.com/api/python-client.html Gets a slippy maps tile URL template with placeholders for zoom, x, and y. ```APIDOC ## Method: get_tile_url ### Description Get slippy maps tile URL (e.g., `/zoom/x/y.png`). ### Parameters - **indexes** (_list of int_, optional) - The band(s) of the source raster to use (default if `None` is to show RGB if available). Band indexing starts at 1. This can also be a list of integers to set which 3 bands to use for RGB. - **colormap** (_str or Colormap or list of str_, optional) - The name of the matplotlib colormap, a `Colormap` instance, or a list of color strings to use when plotting a single band. Default is greyscale. - **vmin** (_float or list of float_, optional) - The minimum value to use when colormapping a single band. - **vmax** (_float or list of float_, optional) - The maximum value to use when colormapping a single band. - **nodata** (_int or float_, optional) - The value from the band to use to interpret as not valid data. - **client** (_bool_, optional) - If `True`, build the URL using the client-facing host and port. Defaults to `False`. - **expression** (_str_, optional) - Band math expression (e.g., `"(b4-b1)/(b4+b1)"`). Mutually exclusive with `indexes`. - **stretch** (_str_, optional) - Image stretch mode. One of `"none"`, `"minmax"`, `"linear"`, `"equalize"`, `"sqrt"`, or `"log"`. When set, overrides `vmin`/`vmax`. ### Returns - **str** - The tile URL template with `{z}/{x}/{y}` placeholders. ``` -------------------------------- ### open Source: https://localtileserver.banesullivan.com/api/python-client.html Opens a raster source as a TileClient, launching a background tile server and returning a client ready for visualization helpers. ```APIDOC ## open ### Description Open a raster source as a `TileClient`. Convenience entrypoint modeled after `rasterio.open` / `xarray.open_dataset`. Launches a background tile server for the given source and returns a client ready for use with `get_leaflet_tile_layer()`, `get_folium_tile_layer()`, and the other visualization helpers. If `source` is already a `TileClient` or `STACClient`, it is validated and returned unchanged. ### Method `open(source, port='default', debug=False, host='127.0.0.1', client_port=None, client_host=None, client_prefix=None, cors_all=False)` ### Parameters - **source** (Path | str | TileClient | STACClient | DatasetReaderBase) - Required - The raster source. A local path, a URL to a remote COG, a `rasterio.io.DatasetReader`, or an already-running client. - **port** (int | str) - Optional - Port on the host machine for the tile server. Defaults to `"default"`, which picks an available port. - **debug** (bool) - Optional - Run the tile server in debug mode. - **host** (str) - Optional - Host address to bind the tile server to. - **client_port** (int) - Optional - Port the client browser should use when fetching tiles. Useful when running in Docker with port forwarding. - **client_host** (str) - Optional - Host the client browser should use when fetching tiles. - **client_prefix** (str) - Optional - URL prefix for proxied access to the tile server. - **cors_all** (bool) - Optional - If `True`, enable CORS for all origins on the tile server. ### Returns - **TileClient or STACClient** - A running tile client for `source`. ### Example ```python >>> import localtileserver as lts >>> client = lts.open("path/to/raster.tif") >>> client.default_zoom ``` ``` -------------------------------- ### TileClient.center Source: https://localtileserver.banesullivan.com/api/python-client.html Get the center of the dataset as (y, x) coordinates. Optionally return a shapely point or WKT string. ```APIDOC ## center ### Description Get center in the form of (y , x ). ### Method N/A (Python method) ### Endpoint TileClient.center ### Parameters #### Path Parameters - **projection** (str) - The srs or projection as a Proj4 string of the returned coordinates. - **return_point** (bool, optional) - If true, returns a shapely.Point object. - **return_wkt** (bool, optional) - If true, returns a Well Known Text (WKT) string of center coordinates. ### Returns - **tuple of float** - A tuple of `(y, x)` (latitude, longitude) when neither `return_point` nor `return_wkt` is `True`. - **shapely.geometry.Point** - When `return_point` is `True`. - **str** - WKT string when `return_wkt` is `True`. ``` -------------------------------- ### Create an ipyleaflet tile layer and map Source: https://localtileserver.banesullivan.com/_sources/user-guide/index.rst.txt Creates a tile server from example data, creates an ipyleaflet tile layer, adds it to a map, and displays the map. ```python import localtileserver as lts from localtileserver import examples from ipyleaflet import Map # First, create a tile server from local raster file # client = lts.open('path/to/geo.tif') client = examples.get_elevation() # use example data # Create ipyleaflet tile layer from that server t = lts.get_leaflet_tile_layer(client, indexes=1, vmin=-5000, vmax=5000, opacity=0.65) # Create ipyleaflet map, add tile layer, and display m = Map(zoom=3) m.add(t) m ``` -------------------------------- ### Launch tileserver with a raster file Source: https://localtileserver.banesullivan.com/user-guide/web-app.html Use this command to start the local web application for viewing a raster file. Replace 'path/to/raster.tif' with the actual file path. ```bash python -m localtileserver path/to/raster.tif ``` -------------------------------- ### Display elevation DEM example with examples.get_elevation() Source: https://localtileserver.banesullivan.com/_sources/user-guide/example-data.rst.txt Loads the included global elevation dataset via examples.get_elevation() and displays it as an ipyleaflet tile layer with a plasma colormap, value range -500 to 5000, and 0.75 opacity. Use this to create high-resolution Digital Elevation Models (DEMs) of a local region. ```python import localtileserver as lts from localtileserver import examples from ipyleaflet import Map # Load example tile layer from publicly available DEM source client = examples.get_elevation() # Create ipyleaflet tile layer from that server t = lts.get_leaflet_tile_layer(client, indexes=1, vmin=-500, vmax=5000, colormap='plasma', opacity=0.75) m = Map(zoom=2) m.add(t) m ``` -------------------------------- ### server property Source: https://localtileserver.banesullivan.com/api/python-client.html Returns the background server instance. ```APIDOC ## Property: server ### Description Return the background server instance. ### Returns - **server_thread.ServerThread** - The managed server thread. ``` -------------------------------- ### One-liner to visualize a large geospatial image with ipyleaflet Source: https://localtileserver.banesullivan.com/_sources/user-guide/index.rst.txt Creates a tile server from example data and displays it in a Jupyter notebook using the TileClient's _ipython_display_ method. ```python import localtileserver as lts from localtileserver import examples # client = lts.open('path/to/geo.tif') client = examples.get_san_francisco() # use example data client ``` -------------------------------- ### Install optional xarray dependency Source: https://localtileserver.banesullivan.com/_sources/installation/index.rst.txt Installs the xarray extra, which adds xarray and rioxarray for serving tiles from xarray DataArrays. ```bash pip install localtileserver[xarray] ``` -------------------------------- ### TileServerMixin(port='default', debug=False, host='127.0.0.1', ...) Source: https://localtileserver.banesullivan.com/api/python-client.html Creates a TileServerMixin instance to serve tiles from a local raster file in a background thread. Accepts parameters for server configuration and CORS settings. ```APIDOC ## TileServerMixin(port='default', debug=False, host='127.0.0.1', ...) ### Description Creates a TileServerMixin instance to serve tiles from a local raster file in a background thread. Accepts parameters for server configuration and CORS settings. ### Method Constructor ### Parameters - **port** (int) - The port on your host machine to use for the tile server. This defaults to getting an available port. - **debug** (bool) - Run the tile server in debug mode. - **host** (str) - The host address to bind the tile server to. - **client_port** (int) - The port on your client browser to use for fetching tiles. This is useful when running in Docker and performing port forwarding. - **client_host** (str) - The host on which your client browser can access the server. - **client_prefix** (str) - The URL prefix used for proxied access to the tile server. - **cors_all** (bool) - If `True`, enable CORS for all origins on the tile server. ``` -------------------------------- ### GET /api/stac/statistics Source: https://localtileserver.banesullivan.com/_sources/api/rest-api.rst.txt Gets per-asset/band statistics for a STAC item. Accepts query parameters for specifying the STAC item and assets. ```APIDOC ## GET /api/stac/statistics ### Description Get per-asset/band statistics. ### Method GET ### Endpoint /api/stac/statistics ### Parameters #### Query Parameters - (Parameters not documented in source) ### Response #### Success Response (200) - Statistics per asset/band. #### Response Example { "asset1": {"min": 0, "max": 255} } ```