Skip to content

error in loading local tif files: Map.add_raster(filename, band=[4, 1, 2], layer_name="Color infrared") #1960

Answered by giswqs
wondering516 asked this question in Q&A
Discussion options

You must be logged in to vote

This is localtileserver issue. Please try the following code with your own data. If it does not work, please open an issue on the localtileserver repo.

from localtileserver import TileClient, get_leaflet_tile_layer, examples
from ipyleaflet import Map

# Create a TileClient from a raster file
# client = TileClient('path/to/geo.tif')
client = examples.get_san_francisco()  # use example data

# Create ipyleaflet TileLayer from that server
t = 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

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@wondering516
Comment options

Answer selected by giswqs
Comment options

You must be logged in to vote
1 reply
@giswqs
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants