I am working on a GIS web tool using Geemap and want to add an animation feature in the webtool using cartoee.get_image_collection_gif. I am sticking to this since I may need to add animations regarding pollutants etc as well. The code runs smoothly and the animation is downloaded in my C: drive when the app is run from a local server. When the same app is hosted on streamlit.io from github (https://github.com/NotnirwaN/Streamlit/blob/master/streamlit_mainmenu.py) the app runs but does not download anything. Not sure if it has anything to do with one of the variables defined in it. Here is the said part of the code: cartoee.get_image_collection_gif(
ee_ic=F_collection,
out_dir=os.path.expanduser(“~/Downloads/timelapse”),
out_gif=“animation.gif”,
vis_params=vizParams,
region=region,
fps=2,
mp4=True,
grid_interval=(1.0, 1.0),
plot_title=“Title”,
date_format=‘YYYY-MM-dd’,
fig_size=(10, 8),
dpi_plot=100,
file_format=“png”,
north_arrow_dict=north_arrow_dict,
scale_bar_dict=scale_bar_dict,
verbose=True
)
After running this function, please verify that the intended GIF file has been generated. Once it is generated, you can use st.image() along with the Image method from PIL to visualize the image (See the Docs page for more info st.image - Streamlit Docs).
Hi @dataprofessor ,
Sorry for the late response but the out_gif defines the format of the animation, while file_format downloads all the frames in a png format as well. As I mentioned earlier the code works perfectly fine when hosted on a local system but the animation doesn’t download when the same is hosted on GitHub.
Taking a look at your cloud version app (https://github.com/NotnirwaN/Streamlit/blob/master/streamlit_app_Cloud.py) it seems that you may not have provide the image as a binary format (currently it seems to be a string) and also not defining the mime parameter based on the following from your code: