New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiband support and MPL colormaps #28
Conversation
Codecov Report
@@ Coverage Diff @@
## main #28 +/- ##
==========================================
+ Coverage 76.51% 77.61% +1.10%
==========================================
Files 12 14 +2
Lines 545 630 +85
==========================================
+ Hits 417 489 +72
- Misses 128 141 +13 |
Also, @giswqs, what Landsat data is this? 7? 8? I'd like to use it for a demo and know which bands are what per something like: http://gsp.humboldt.edu/olm/Courses/GSP_216/lessons/composites.html So that I can make a false color image, etc. edit: this looks like LS8 to me |
This example was added to the README: 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 |
This is AWESOME! I can confirm that it works for both local raster datasets and remote pre-tiled COG. The sample dataset I provided is Landsat 7 image. from localtileserver import get_leaflet_tile_layer, TileClient
from ipyleaflet import Map
# First, create a tile server from local raster file
# tile_client = TileClient('./landsat7.tif')
url = 'https://opendata.digitalglobe.com/events/california-fire-2020/pre-event/2018-02-16/pine-gulch-fire20/1030010076004E00.tif'
tile_client = TileClient(url)
# Create ipyleaflet tile layer from that server
t = get_leaflet_tile_layer(tile_client, band=[3, 2, 1])
# Create ipyleaflet map, add tile layer, and display
m = Map(center=tile_client.center())
m.add_layer(t)
m |
Here is the dataset I used for the example above. |
I can reproduce that visual effect with the shared file on my end. I suspect there is an issue with the alpha channel on that particular image rather than a nodata issue or an issue with the tile serving |
Resolve #22
This all feels a bit hacky, but it works. @giswqs, would you please review/test.
Here is an example
or like the screenshots in #22:
To do: