Hi @Amira_RIAHI, welcome to the Streamlit community!
In this example, st.map only takes in a dataframe with lat/lon coordinates, whereas you are passing in a plot method. Did you mean to call st.pyplot(couche) instead?
Hi randyzwitch,
Thank you,
Yes i tried both st.map and st.pyplot since i need to add a plot with layers to my app
I find streamlit quite simple to use except when dealing with geopandas
Without seeing actual code or data, i can only guess.
Here is a simple example to load a geojson file with point data and show it on a streamlit app:
df = gpd.read_file('cities.geojson')
df['lon'] = df.geometry.x # extract longitude from geometry
df['lat'] = df.geometry.y # extract latitude from geometry
df = df[['lon','lat']] # only keep longitude and latitude
st.write(df.head()) # show on table for testing only
st.map(df) # show on map
Edit: Be aware that with st.map you can only show point data, for other geospatial data you have to use other libraries/elements for example plotly or pydeck and their corresponding streamlit elements:
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.