GeoParse Logo

GeoParse

All About Points No description has been provided for this image Lines No description has been provided for this image and Polygons No description has been provided for this image

HTML¶


Speedings¶

Binder

This notebook demonstrates how to visualize speeding events along a trajectory.


In [1]:
import os
import sys

sys.path.append(os.path.abspath("../geoparse/"))
import warnings

import pandas as pd

from geoparse import plp

warnings.filterwarnings("ignore")
In [2]:
# Reload all changed modules every time before executing a new line
%load_ext autoreload
%autoreload 2
In [3]:
df = pd.read_csv("https://geoparse.io/tutorials/data/trajectory.csv")
df.head()
Out[3]:
vin lat lon dt speed highway name ref speedlimit
0 13 52.504944 -1.837817 2023-11-19 01:16:35 65.554658 motorway NaN M6 70.0
1 13 52.505212 -1.833869 2023-11-19 01:16:45 57.476835 motorway NaN M6 70.0
2 13 52.505834 -1.830360 2023-11-19 01:16:55 51.884494 motorway NaN M6 70.0
3 13 52.506360 -1.826884 2023-11-19 01:17:05 54.680665 motorway NaN M6 70.0
4 13 52.506537 -1.823548 2023-11-19 01:17:15 49.709691 motorway NaN M6 70.0
In [4]:
len(df)
Out[4]:
758
In [5]:
plp(df)
Out[5]:
Make this Notebook Trusted to load map: File -> Trust Notebook
In [6]:
plp(df, antpath=True)
Out[6]:
Make this Notebook Trusted to load map: File -> Trust Notebook
In [7]:
plp(df, point_popup={"Time": "dt", "Speed": "speed", "Speed Limit": "speedlimit"})
Out[7]:
Make this Notebook Trusted to load map: File -> Trust Notebook
In [8]:
plp(df, point_color="speed", point_popup={"Speed": "speed", "Speed Limit": "speedlimit"})
Out[8]:
Make this Notebook Trusted to load map: File -> Trust Notebook
In [ ]: