-
Notifications
You must be signed in to change notification settings - Fork 362
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
Fail to load raster layer: ImageOverlay #1145
Comments
Hi @hillsonghimire, As far as I know, most browsers cannot display tiff images directly. Without making changes to import io
import base64
import PIL.Image
# convert geotiff image to in-memory png
f = PIL.Image.open('/content/LC08_L1TP_126049_20200301_20200313_01_T1_B1.TIF')
png = io.BytesIO()
f.save(png, format='png')
png.seek(0)
# encode to base64 and get url
data = base64.b64encode(png.read()).decode('ascii')
url = "data:image/png;base64," + data
# visualize with ImageOverlay
overlay = ImageOverlay(url=url, bounds=((bottom, left), (top, right)))
I think adding bindings for |
It is recommended to add a raster dataset as a tile layer with localtileserver rather than using ImageOverlay. See this example: |
agreed. |
More examples: https://geoai.gishub.org/examples/dataviz/raster_viz |
I tried the following code to visualize a single band raster image form landsat 8, but the image cannot render over the map. The broken thumbnail appears over the map layer.
I am using google colab as notebook server.
The text was updated successfully, but these errors were encountered: