-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
issue in Map.add_raster function #195
Comments
Hi Nick, I am afraid I am not a python guru. I normally use R but not that much advanced. I hope you got help. |
Hi Ambale, |
@giswqs Can you please share the |
@haseeb33 xarray-leaflet is buggy and difficult to make it work. I have switched to localtileserver. See |
@giswqs Thank you very much for the quick response. But I am disappointed to say that it's not showing expected results. The map's center shifts to the destination area but tiles aren't shown and there are no errors. Please guide to debug this issue. |
@haseeb33 Use the https://geemap.org/notebooks/44_cog_stac Checkout out this web page. You should be able to play with the COG layers interactively. It should also work if you run it locally. |
@giswqs Actually, I have local tiff files and I want to add those to the map. The above screenshot with |
Are you running the Jupyter instance in the cloud or is Jupyter installed locally? |
@giswqs I am running it on Linux server. Btw |
Are you using the server physically or virtually? This makes a difference when using |
@giswqs I am not using any cloud-based server. These are in-house servers installed by us. |
I understand, but where is Jupyter installed? On the same computer you are using or is it from a server (not the same computer where you are using leafmap)? If it is from a remote server, you need to add the following two lines to the beginning of a notebook. import os
os.environ['LOCALTILESERVER_CLIENT_PREFIX'] = f'{os.environ['JUPYTERHUB_SERVICE_PREFIX'].lstrip('/')}/proxy/{{port}}' |
@giswqs Everything is installed on the server. jupyter notebook, python, local raster files are also on the server. Just accessing jupyter notebook on my local computer(nothing else from the local computer interacts with note book). |
There is no Key
|
This is a localtileserver issue. Try the following example. If it does not work, then you can open an issue at https://github.com/banesullivan/localtileserver/issues @banesullivan https://github.com/banesullivan/localtileserver#-usage from localtileserver import get_leaflet_tile_layer, TileClient
from ipyleaflet import Map
# First, create a tile server from local raster file
tile_client = TileClient('path/to/geo.tif')
# Create ipyleaflet tile layer from that server
t = get_leaflet_tile_layer(tile_client)
m = Map(center=tile_client.center(), zoom=6)
m.add_child(t)
m |
@giswqs Thank you very much for all the help. |
What you described is the usage of a remote server. It does not matter if the server is in-house or hosted remotely somewhere else. I encourage you to install conda and try out the function on a local computer. |
Description
When I tried to run tutorial 25_load_rasters, this line of code `Map.add_raster(landsat, bands=[5,4,3], layer_name='Landsat') raised an TypeError, as detailed below.
where da = rioxarray.open_rasterio(image, masked=True)
What I Did
This tutorial ipynb file is intact, and I haven't edited it. According to the error message, the 'rgb_dim' parameter is not expected in da.leaflet.plot function and should be deleted. Is this bug caused by the updated dependency of rioxarray (version 0.1.1 in my case)?
The text was updated successfully, but these errors were encountered: