Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Time Slider with Varying MultiPolygon Size by Time Stamp

オープン
#1,750 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
jupyter-notebook, pandas, python

調査の方向性

script.txtから始め、issueに示されているdata.zipとTimeSliderChoroplethの設定を使って、Jupyter Notebook環境で問題を再現します。タイムスタンプ間で形状の異なるMultiPolygonがどのように表現されるか、またスライダーがそれらの間をどのように遷移するかを確認します。初期タイムスタンプにそのタイムスタンプ固有のジオメトリだけが表示され、スライダーを移動しても以前のタイムスタンプまたは最終タイムスタンプのデータがオーバーレイとして残らなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

I'm trying to create a time slider which varies by day, however, 1) all MultiPolygons are initially displayed at once for the first time stamp and 2) if I use the slider from the start to the end of the slider, all previous time steps are overlaid by the final time step.

Note: All MultiPolygons are not consistent in terms of shape/size. I think this is related to the issue.

Here's a screen capture of the issue:
image
There shouldn't be any overlapping lines on the map for the initial time stamp.

The final slide looks good:
image

However, once I scroll through all slides once, all data is overlaid by the final time stamp:
image

Here's the important part of the script:

#---create a style dictionary
styledata = {}
for i in range(allgpd.shape[0]):
subset = allgpd.iloc[i]
idxname = pd.Index([subset.times], dtype="U10")
df = pd.DataFrame({"color": allgpd['color'][i],"opacity": 1,},index=idxname,)
styledata[i] = df
#---reformat
styledict = {str(idx): data.to_dict(orient="index") for idx, data in styledata.items()}
#---create the folium slider
m = folium.Map(location=[qlat, qlon], zoom_start=6)
g = TimeSliderChoropleth(
allgpd.to_json(),
styledict=styledict,
control=True,
overlay=True, show=False).add_to(m)
m

I also attached my script in its entirety to this thread, as well (script.txt).

Environment details (Jupyter Notebook):
System: sys.version_info(major=3, minor=9, micro=12, releaselevel='final', serial=0)
Folium: 0.14.0
Branca: 0.6.0

I attached the data to this thread (data.zip).

data.zip
script.txt

主要言語
Python
スター
7.4k
フォーク
2.3k
平均マージ
17時間 22分
マージ済み PR(30日)
11

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

python-visualization/folium のほかの issue

python-visualization/folium の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。