Generalizing trajectories¶

Binder IPYNB HTML

To reduce the size (number of points) of trajectory objects, we can generalize them, for example, using:

  • Spatial generalization, such as Douglas-Peucker algorithm
  • Temporal generalization by down-sampling, i.e. increasing the time interval between records
  • Spatiotemporal generalization, e.g. using Top-Down Time Ratio algorithm

Documentation

A closely related type of operation is trajectory smoothing which is coverd in a separate notebook.

In [1]:
import pandas as pd
import geopandas as gpd
import movingpandas as mpd
import shapely as shp
import hvplot.pandas 
import matplotlib.pyplot as plt

from geopandas import GeoDataFrame, read_file
from shapely.geometry import Point, LineString, Polygon
from datetime import datetime, timedelta
from holoviews import opts

import warnings
warnings.filterwarnings('ignore')

plot_defaults = {'linewidth':5, 'capstyle':'round', 'figsize':(9,3), 'legend':True}
opts.defaults(opts.Overlay(active_tools=['wheel_zoom'], frame_width=500, frame_height=400))

mpd.show_versions()