Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Time Slider with Varying MultiPolygon Size by Time Stamp

Offen
#1,750 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
jupyter-notebook, pandas, python

Rechercherichtung

Beginne mit script.txt und reproduziere das Problem in der Jupyter Notebook-Umgebung mit data.zip und dem im Issue gezeigten TimeSliderChoropleth-Setup. Untersuche, wie unterschiedlich geformte MultiPolygon-Geometrien über mehrere Zeitstempel hinweg dargestellt werden und wie der Slider zwischen ihnen übergeht. Das Ziel ist erreicht, wenn der anfängliche Zeitstempel nur seine eigenen Geometrien anzeigt und das Bewegen durch den Slider keine Daten früherer oder des letzten Zeitstempels als Overlay zurücklässt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
Python
Sterne
7.4k
Forks
2.3k
Ø Merge
17 Std. 22 Min.
Gemergte PRs (30 T.)
11

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus python-visualization/folium

Alle Issues in python-visualization/folium

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.