投稿

2026の投稿を表示しています

Combination Streamlit and Folium in VS-code

イメージ
  I try to create the code using Streamlit and Folium(Steamlit_Folium) and to learn about publicizing the code on the WEB site of the Streamlit.  I think what kind of Application I will make. I decided to make a code like below. input the latitude and longitude at a point and a radius in our side bar Draw the circle that has an inputed coordinate and the center   I ask Gemini like below, in Japanese. Streamlitを使って、入力した緯度・経度の点とその点を中心とする半径から、Foliumの地図上に当該緯度経度の点をドットで表示したうえで、当該点を中心とする半径の円を描くPythonコードを書いてください。なお、緯度経度と半径の入力はサイドバーを使用したいです。 StreamlitとFoliumを組み合わせることで、サイドバーからインタラクティブに数値を変更し、地図上に反映させるアプリケーションを簡単に作成できます。 以下のコードは、 streamlit-folium というライブラリを使用して、Streamlit上にFoliumの地図を表示する実装例です。 実装コード Python import streamlit as st import folium from streamlit_folium import st_folium # ページの設定 st.set_page_config(page_title= "Map Circle Tool" , layout= "wide" ) st.title( "📍 緯度経度を中心とした円の描画" ) # --- サイドバーの設定 --- st.sidebar.header( "入力パラメータ" ) # 緯度の入力(デフ...