\n",
"Simplifaction: this operation consists to reduce the number of observations in track (while preserving time stamps and other information) to make it less bulky or more readable on a graphic.
\n",
"\n",
"We present, on this web page, 2 simplification methods applying to a track: Douglas & Peucker algorithm and Visvalingram simplification algorithm.\n",
"\n",
"The process \"Track simplification\" generally returns a new simplified track. Tolerance is in the unit of track observation coordinates."
]
},
{
"cell_type": "markdown",
"id": "37a16ed6",
"metadata": {},
"source": [
"## Let's start by defining our environment\n",
"\n",
"This task is only useful for the online notebook"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "4768010a",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import sys\n",
"\n",
"# Import de tracklib\n",
"module_path = os.path.abspath(os.path.join('../../..'))\n",
"if module_path not in sys.path:\n",
" sys.path.append(module_path)\n",
" \n",
"import tracklib as trk"
]
},
{
"cell_type": "markdown",
"id": "42393fbe",
"metadata": {},
"source": [
"## Simplifaction with Douglas-Peucker method\n",
"\n",
"The Douglas-Peucker algorithm reduce the number of a line by reducing the number of points. \n",
"The result should keep the original shape.\n",
"\n",
"
\n",
"Reference: David Douglas, Thomas Peucker: Algorithms for the\n",
" reduction of the number of points required to represent a digitized\n",
" line or its caricature. In Cartographica: The International Journal\n",
" for Geographic Information and Geovisualization.\n",
" Volume 10, Issue 2, Pages 112–122, 1973, https://utpjournals.press/doi/10.3138/FM57-6770-U75U-7727
\n",
"Reference: M. Visvalingam & J. D. Whyatt (1993) Line generalisation by repeated elimination of points, \n",
" The Cartographic Journal, 30:1, 46-51, DOI:\n",
" 10.1179/000870493786962263