Qiusheng Wu uses Streamlit to build a popular geospatial application

Learn how Qiusheng created Earth Engine web apps with geemap

Posted in Case study,
Qiusheng Wu uses Streamlit to build a popular geospatial application

In April 2020, Assistant Professor in the Department of Geography at the University of Tennessee Qiusheng Wu launched geemap, an open-source Python package for interactive mapping with Google Earth Engine and open-source mapping libraries (e.g., ipyleaflet, folium). It quickly became one of the most popular geospatial packages with over 2,000 GitHub stars.

https://i.imgur.com/7eyMcZQ.gif

“Before Google Earth Engine, generating a satellite timelapse like this could take hours or even days,” Qiusheng said. “You can now create satellite timelapses in minutes, but it can still take hundreds of lines of Earth Engine JavaScript.”

Jupyter environment wasn’t enough

Qiusheng wanted to apply geospatial big data, machine learning, and cloud computing to study environmental change (surface water, wetland inundation dynamics, etc.).

With geemap, users could explore large geospatial datasets, perform planetary-scale analysis, and create satellite timelapses with a few lines of code or a few clicks. But they still needed to install Python and run geemap in a Jupyter environment.

Qiusheng wanted his app to let anyone create satellite timelapses with no code. So he used Voilà for turning notebooks into standalone web apps and dashboards.

https://i.imgur.com/adwTxEo.png

To make the notebooks public, Qiusheng needed to host them on a server.

“I’ve been using ngrok to turn a local computer into a secure web server and connect it to the ngrok cloud service, which accepts traffic on a public address,” Qiusheng said. “It’s one of the easiest ways to turn a Jupyter notebook into an app and it’s great for demos. But the downside of using a local computer as a public server is that it might be hacked.”

He switched to hosting it on a Heroku cloud server. Soon after, the app became so popular, and it used up the free monthly dyno hours.

“I had to shut down the app when it exceeded the free limit and restart it at the beginning of each month, which was inconvenient,” Qiusheng said.

Discovering Streamlit

Qiusheng first discovered Streamlit in October 2021. It quickly became his favorite package for developing and deploying interactive web apps. He used it for geemap because:

  • It was free.
  • It was open-source.
  • It had similar functionality to ipywidgets but was much easier to use (no need for a callback function).
  • He could deploy unlimited public apps from GitHub to Streamlit Community Cloud for free (no need for a server).
  • Deployment was automatic, so he could focus on coding.
  • The apps were publicly accessible.

Streamlit powers the new version of geemap — and makes it available to anyone

Soon after Qiusheng released the Streamlit Geospatial app for creating satellite timelapse animations for any location in less than 60 seconds, it got widely circulated on social media (check out the blog post, the video tutorial, and the repo code).

People all over the world made animations of environmental changes: urban growth, land reclamation, river dynamics, vegetation dynamics, coastal erosion, and volcanic eruptions (use hashtags #streamlit on Twitter and #BigRiverAnimation on LinkedIn to see examples).

https://i.imgur.com/9qqk06V.png

There are now more than ten apps in Streamlit Geospatial, including the app for visualizing U.S. real estate data in 3D.

https://i.imgur.com/Y8tJ4CC.gif

There is even an app for creating maps of hurricane tracks built with Streamlit and Tropycal (check out the repo code here).

https://i.imgur.com/OCAb80v.png

To make it easier for users to make their own geospatial apps, Qiusheng created an app template based on Streamlit’s native support for multipage apps. Users can fork the repository and add more apps if needed. The app can be deployed to Streamlit Cloud, Heroku, or MyBinder (here is the repo code).

https://i.imgur.com/OdLT4yf.gif

Wrapping up

“I’m an advocate of open science and reproducible research,” Qiusheng said. “I love sharing Streamlit apps and making geospatial technologies more accessible to everyone. I have developed several open-source packages for geospatial analysis and interactive mapping (e.g., geemap, leafmap, geospatial, pygis, lidar). You can see my open-source projects on GitHub and video tutorials on my YouTube channel.”

Thank you for reading Qiusheng’s story! If you have any questions, please leave them below in the comments or reach out to Qiusheng on Twitter, LinkedIn, or YouTube.

Happy coding and learning! 🧑‍💻

Share this post

Comments

Continue the conversation in our forums →

Also in Case study...

View even more →