<jupyter_start><jupyter_text>Visualise a Trajectory using LeafletVisualise trajectory positions for a file containing positions for a single flight.<jupyter_code>import pandas as pd
import folium

# print(folium.__version__)<jupyter_output><empty_output><jupyter_text>Get the positions filename from the userAsk for the positions filename and read the file into a pandas DataFrame<jupyter_code>filename = input('Enter a positions filename:')
points_df = pd.read_csv(filename)
len(points_df)
# Get the point coordinates as a nested list from the points_df dataframe
point_locations = points_df[['LAT','LON']].values.tolist()<jupyter_output><empty_output><jupyter_text>Plot the positionsCreate a folium map roughly over the centre of Europe.   'Cartodb Positron' is a tile collection that shows airports.<jupyter_code># Create the map
map_mb = folium.Map(location=[50.0, 10.0], zoom_start=5, tiles='Cartodb Positron')
BLACK = '#000000'

# Add a PolyLine to show point_locations
folium.PolyLine(
    locations=point_locations,
    color=BLACK,
    weight=4,
    tooltip='filename',
).add_to(map_mb)
# Display the map
map_mb<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08782608695652173, 'fraction_numerical': 0.01217391304347826, 'mean_word_length': 6.724832214765101, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '273060', 'license': 'MIT', 'n_tokens_mistral': 381, 'n_tokens_neox': 359, 'n_words': 108, 'path': 'notebooks/visualisation/Visualise a Trajectory using Leaflet.ipynb', 'repo_name': 'euctrl-pru/rt-python', 'size': '1150'}