'GeoTIFFOverlay not working (not showing image) in Dash Leaflet
I'm developing a dashboard using Dash Leaflet, and I want to use the function GeoTIFFOverlay, in order to display a TIFF image on the map: this is the code for testing purpose that I'm using:
import dash
import dash_leaflet as dl
from dash import Dash, html
app = dash.Dash()
tiff_path = 'assets/test-tiff.tif'
png_path = 'assets/test-png.png'
bounds_png = [[34.113362591, 4.379137166], [48.020394545, 20.420888158]]
bounds_tiff = [34.113362591, 4.379137166, 48.020394545, 20.420888158]
app = dash.Dash()
app.layout = html.Div(
[
dl.Map(
[
dl.LayersControl(
[
dl.Overlay(
[
# dl.ImageOverlay(url=png_path, bounds=bounds_png)
dl.GeoTIFFOverlay(
url=tiff_path, bounds=bounds_tiff)
],
name="Map", checked=True)
],
position="topleft"
),
dl.TileLayer()
],
bounds=bounds_png,
style={'width': '600px', 'height': '400px'}
)
]
)
if __name__ == '__main__':
app.run_server(debug=True, port=8090)
As you can see from the code, I tried with ImageOverlay and it works perfectly (with a png), and also with different bounds, while with the TIFF the image is not even shown.
Anyone have a solution?
Thanks in advance.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|