Displaying many Hillshade tif's in Streamlit

Welcome to the community, Markus! Thanks for your thoughtful question and for sharing your learning journey so far. :blush: Displaying many Hillshade images in Streamlit, especially with split map comparison, is definitely possible, but there are a few important considerations.

It could be possible that using COG (Cloud Optimized GeoTIFF) Hillshades is a good approach for handling many DEM-derived images, as COGs are designed for efficient access and tiling, especially when zooming and panning. However, Streamlit itself won’t automatically detect or tile COGs for you—you’ll need to handle file selection and rendering logic in your app. For displaying raster data (like Hillshades), you can use libraries such as rasterio to read the files and folium or streamlit-folium to overlay them on interactive maps. For split map (side-by-side) comparison, folium’s plugins (like DualMap or SplitMap) can be integrated, but you’ll need to manage the layers and user selection yourself. There’s no explicit mention in the data sources about Streamlit natively supporting split map or automatic multi-resolution tiling, so you may need to preprocess your Hillshades at different resolutions or use a tiling server for best performance with large datasets. See discussions and code examples in the community for GeoTIFF/COG handling, folium overlays, and dynamic map updates.

If you’d like more detail, including a step-by-step code example or guidance on setting up the file structure and map comparison logic, just let me know! And if you have a minimum reproducible example or a repo, please share it so the community can jump in with more targeted help. Community members—feel free to chime in with your own experiences or code snippets!

Sources: