jp12
July 25, 2023, 1:37am
1
Hi, does anyone know why this happens?
I’m trying to plot data from a netcdf file to a leafmap/folium map using this tutorial
However, the data is not showing up on the map
My app:
https://test-app.streamlit.app/
The code:
import leafmap.foliumap as leafmap
import streamlit as st
st.header(‘Test’)
filename = ‘wind_global.nc’
geojson = ‘https://github.com/opengeos/leafmap/raw/master/examples/data/countries.geojson ’
m = leafmap.Map(layers_control=True)
m.add_basemap(‘CartoDB.DarkMatter’)
m.add_velocity(filename, zonal_speed=‘u_wind’, meridional_speed=‘v_wind’)
m.to_streamlit()
thanks !
Hi @jp12 ,
Without knowing the exact error message you’re getting or having access to the data file you’re using, it’s difficult to diagnose the issue precisely.
Can you please provide more information?
Thanks,
Charly
jp12
July 25, 2023, 9:58am
3
Hi @Charly_Wargnier ,
There are no console errors
The repository with the data and code for this app is here:
import leafmap.foliumap as leafmap
import streamlit as st
st.header('Test')
filename = 'wind_global.nc'
geojson = 'https://github.com/opengeos/leafmap/raw/master/examples/data/countries.geojson'
m = leafmap.Map(layers_control=True)
m.add_basemap('CartoDB.DarkMatter')
m.add_velocity(filename, zonal_speed='u_wind', meridional_speed='v_wind')
m.to_streamlit()
Thanks for your prompt feedback, @jp12 !
From what you shared, it seems that you’re attempting to load a local file, ‘wind_global.nc,’ but it’s unclear if that file is correctly uploaded and accessible from the Streamlit app.
If the file isn’t uploaded correctly or can’t be accessed, no data will be displayed.
Can you please confirm that this has indeed been uploaded?
Thanks,
Charly
jp12
July 25, 2023, 2:11pm
5
Hi @Charly_Wargnier , thanks !
You were correct, the filename was wrong.
Now, there’s a error on prompt
I’m not sure, but could you please check if the add_velocity
function is supported by the foliumap
backend of leafmap
?
Thanks,
Charly