has anyone tried to add polylines on a folium map displayed on streamlit?

Viewed 209

I tried to display bus lines on a map (on streamlit) using folium.Polylines, but I keep getting the same error message : ValueError: could not convert string to float

here's my code:


trajet_bus_fields = data


mapish= folium.Map(location = [48.083328, -1.68333]) 

for index, row in trajet_bus_fields.iterrows():
    popup = row['idligne']
    my_PolyLine=folium.PolyLine(locations=row["coordinates_reversed"],weight=3, popup = popup, color= "red")
    mapish.add_child(my_PolyLine)

folium_static(mapish)

there is a step before this code that i used to invert the coordinates :

trajet_bus_fields["coordinates_reversed"]=np.empty((len(trajet_bus_fields), 0)).tolist()

here is a link to the .JSON File I used, that, of course I converted to .csv beforehand on google colab. (then i Dowloaded it to visual code where i'm launching streamlit) [1]:https://github.com/HOUDZZZ/project3/blob/7c2336a1537cbfe4d1d96852871b79ee388feba9/parcours-des-lignes-de-bus-du-reseau-star.json

As I said i Keep getting the same message Error although it works on Google colab.

Here is also a link to my Colab if it helps: [2]: https://colab.research.google.com/drive/1EWgKH-2S5HobWB-_Cex8aRjOC2PLR6dM?usp=sharing

Your Help will be very much appreciated, I looked for hours before posting my question

0 Answers
Related