Skip to content
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

GeoTIFF is not visible on map, add_raster #496

Closed
Flawks opened this issue Jul 18, 2023 · 4 comments
Closed

GeoTIFF is not visible on map, add_raster #496

Flawks opened this issue Jul 18, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@Flawks
Copy link

Flawks commented Jul 18, 2023

Environment Information

  • leafmap 0.22.0:
  • Python 3.10.12
  • Operating System: Google Colab

Description

I've been trying to run the example notebook with my image in Colab: https://leafmap.org/notebooks/05_load_raster/
The add_raster adds the image layer and the leafmap map zooms to the respective coordinates of the GeoTIFF file. However, the image is not visible.

What I Did

I added some changes to the original notebook:

  • added !pip install localtileserver line because otherwise the leafmap map returns the prompt about it failing to cache the image
  • added image = 'bogota.tif' line for the input image that can be obtained from bogota.tif

The command I used to add GeoTIFF image to the map:

m.add_raster(image)

The output of the lefmap map:
Screenshot_1

How it should look like (QGIS):

Screenshot_2

I also tried changing the layers opacity in the map GUI, but it didn't help.

@Flawks Flawks added the bug Something isn't working label Jul 18, 2023
@giswqs
Copy link
Member

giswqs commented Jul 18, 2023

Sounds like a Windows issue. See #492

@giswqs
Copy link
Member

giswqs commented Aug 31, 2023

It works fine on my Linux machine. Try installing localtileserver with conda rather than pip.

image

@giswqs giswqs closed this as completed Aug 31, 2023
@chjones2
Copy link

hello,
I am running into a similar problem. I am trying to run the nb example 91_raster_viz_gui.ipynb but the image is not plotted.

I installed leafmap in a linux machine running Ubuntu. I had some issues creating an environment but eventually it is not giving errors when importing leafmap:

conda create -n pyleafmap python=3.10
pip install leafmap
conda install ipykernel
python -m ipykernel install --user --name pyleafmap --display-name "Python (pyleafmap)"
pip install --find-links=https://girder.github.io/large_image_wheels --no-cache GDAL
conda install -c conda-forge xarray dask netCDF4 bottleneck
pip install rioxarray
pip install localtileserver
pip uninstall matplotlib
pip uninstall numpy
conda install -c conda-forge matplotlib
pip install numpy
pip uninstall leafmap
pip install leafmap

and here is the notebook:

2024-08-29_16-48-57

any ideas are greatly appreciated.

@giswqs
Copy link
Member

giswqs commented Aug 30, 2024

If you have conda, you should avoid using pip to install packages. Try creating a fresh conda env:

conda create -n geo python=3.11
conda activate geo
conda install -c conda-forge mamba
mamba install -c conda-forge leafmap localtileserver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants