2020-05-25 15:21:43 +03:00
|
|
|
|
\documentclass[a4paper]{article}
|
2020-05-26 11:39:18 +03:00
|
|
|
|
|
|
|
|
|
\iffalse
|
2020-05-21 11:25:14 +03:00
|
|
|
|
\usepackage[L7x,T1]{fontenc}
|
2020-05-26 11:39:18 +03:00
|
|
|
|
\usepackage[lithuanian]{babel}
|
|
|
|
|
\else
|
|
|
|
|
\usepackage[T1]{fontenc}
|
|
|
|
|
\usepackage[english]{babel}
|
|
|
|
|
\fi
|
|
|
|
|
|
2020-05-21 11:25:14 +03:00
|
|
|
|
\usepackage[utf8]{inputenc}
|
2020-05-21 22:01:57 +03:00
|
|
|
|
\usepackage{a4wide}
|
2020-05-21 11:25:14 +03:00
|
|
|
|
\usepackage{csquotes}
|
|
|
|
|
\usepackage[maxbibnames=99,style=authoryear]{biblatex}
|
2020-05-25 15:21:43 +03:00
|
|
|
|
\usepackage[pdfusetitle]{hyperref}
|
2020-05-25 17:37:58 +03:00
|
|
|
|
\usepackage{enumitem}
|
2020-05-27 11:39:03 +03:00
|
|
|
|
\usepackage[toc,page,title]{appendix}
|
2020-05-21 11:25:14 +03:00
|
|
|
|
\addbibresource{bib.bib}
|
|
|
|
|
\usepackage{caption}
|
|
|
|
|
\usepackage{subcaption}
|
|
|
|
|
\usepackage{gensymb}
|
|
|
|
|
\usepackage{varwidth}
|
2020-05-25 12:32:45 +03:00
|
|
|
|
\usepackage{tabularx}
|
2020-05-26 09:55:42 +03:00
|
|
|
|
\usepackage{float}
|
2020-05-21 11:25:14 +03:00
|
|
|
|
\usepackage{tikz}
|
2020-05-27 15:23:54 +03:00
|
|
|
|
\usepackage{minted}
|
2020-05-21 11:25:14 +03:00
|
|
|
|
\usetikzlibrary{er,positioning}
|
2020-05-28 17:53:51 +03:00
|
|
|
|
\definecolor{mypurple}{RGB}{117,112,179}
|
2020-05-22 10:19:17 +03:00
|
|
|
|
\input{version}
|
2020-05-21 11:25:14 +03:00
|
|
|
|
|
2020-05-25 17:37:58 +03:00
|
|
|
|
\newcommand{\DP}{Douglas \& Peucker}
|
2020-05-25 18:02:48 +03:00
|
|
|
|
\newcommand{\VW}{Visvalingam--Whyatt}
|
2020-05-26 07:42:43 +03:00
|
|
|
|
\newcommand{\WM}{Wang--M{\"u}ller}
|
2020-05-25 17:37:58 +03:00
|
|
|
|
|
2020-05-21 11:25:14 +03:00
|
|
|
|
\title{
|
2020-05-26 15:10:30 +03:00
|
|
|
|
Cartografic Generalization of Lines using free software \\
|
2020-05-21 11:40:20 +03:00
|
|
|
|
(example of rivers) \\ \vspace{4mm}
|
2020-05-21 11:25:14 +03:00
|
|
|
|
}
|
|
|
|
|
|
2020-05-21 22:01:57 +03:00
|
|
|
|
\iffalse
|
2020-05-25 11:40:16 +03:00
|
|
|
|
https://bost.ocks.org/mike/simplify/
|
2020-05-25 14:52:38 +03:00
|
|
|
|
http://bl.ocks.org/msbarry/9152218
|
2020-05-25 11:40:16 +03:00
|
|
|
|
|
2020-05-22 10:19:17 +03:00
|
|
|
|
small scale: 1:XXXXXX
|
|
|
|
|
large scale: 1:XXX
|
|
|
|
|
|
2020-05-21 22:01:57 +03:00
|
|
|
|
a4: 210x297mm
|
2020-05-26 16:10:54 +03:00
|
|
|
|
a5: 148x210mm
|
2020-05-21 22:01:57 +03:00
|
|
|
|
a6: 105x148xmm
|
|
|
|
|
a7: 74x105mm
|
|
|
|
|
a8: 52x74mm
|
2020-05-22 10:19:17 +03:00
|
|
|
|
|
2020-05-26 19:15:25 +03:00
|
|
|
|
Crossing:
|
2020-05-26 23:04:36 +03:00
|
|
|
|
Xmin: 623306
|
|
|
|
|
Ymin: 6109635
|
|
|
|
|
Xmax: 625526
|
|
|
|
|
Ymax: 6111210
|
|
|
|
|
623306 6109635 625526 6111210
|
|
|
|
|
Crossing wxh: 2220, 1575 (m)
|
2020-05-26 19:15:25 +03:00
|
|
|
|
|
|
|
|
|
|
2020-05-22 10:19:17 +03:00
|
|
|
|
connect rivers first to a single polylines:
|
|
|
|
|
- some algs can preserve connectivity, some not.
|
|
|
|
|
|
|
|
|
|
ideal hypothesis: mueller algorithm + topology may fully realize cartographic generalization tasks.
|
|
|
|
|
|
|
|
|
|
what scales and what distances?
|
2020-05-26 13:56:26 +03:00
|
|
|
|
|
|
|
|
|
= Intro: Aktualumas
|
|
|
|
|
FOSS nėra realizuotas tinkamas kartografinio realizavimo algoritmas (2–3 sakiniai). Kad kartografai turėtų
|
|
|
|
|
įrankį upių generalizavimui.
|
|
|
|
|
|
|
|
|
|
Bazė: imame tai, ką dabar turi kartografai įrankių paletėj.
|
|
|
|
|
|
|
|
|
|
Imti mažus upės vingius. Paimti mažas atkarpėles ir palyginti su originalia.
|
|
|
|
|
Todėl, kad nėra kilpų.
|
|
|
|
|
|
2020-05-26 19:15:25 +03:00
|
|
|
|
Zeimena extents: [606922,6097557,627230,6126362]
|
|
|
|
|
20308 x 28805 (w x h)
|
|
|
|
|
|
2020-05-21 22:01:57 +03:00
|
|
|
|
\fi
|
|
|
|
|
|
2020-05-21 11:25:14 +03:00
|
|
|
|
\author{Motiejus Jakštys}
|
|
|
|
|
|
2020-05-22 10:19:17 +03:00
|
|
|
|
\date{
|
|
|
|
|
\vspace{10mm}
|
|
|
|
|
Version: \VCDescribe \\ \vspace{4mm}
|
|
|
|
|
Generated At: \GeneratedAt
|
2020-05-27 10:26:59 +03:00
|
|
|
|
|
2020-05-22 10:19:17 +03:00
|
|
|
|
}
|
2020-05-21 11:25:14 +03:00
|
|
|
|
|
|
|
|
|
\begin{document}
|
|
|
|
|
\maketitle
|
|
|
|
|
|
2020-05-26 11:39:18 +03:00
|
|
|
|
\begin{abstract}
|
2020-05-21 11:25:14 +03:00
|
|
|
|
\label{sec:abstract}
|
2020-05-21 16:41:29 +03:00
|
|
|
|
Current open-source line generalization solutions have their roots in
|
2020-05-26 15:10:30 +03:00
|
|
|
|
mathematics and geometry, thus emit poor cartographic output. Therefore, if
|
|
|
|
|
one is using open-source technology to generalize cartographic objects,
|
|
|
|
|
their downscaled counterparts will be incorrectly scale-adjusted. This
|
|
|
|
|
paper explores the available down-scaling implementations, highlights some
|
|
|
|
|
of their deficiencies, and suggests a viable algorithm for an avid GIS
|
|
|
|
|
developer. Once the new algorithm becomes usable from within open-source
|
|
|
|
|
GIS software (e.g. QGIS or PostGIS), small-scale maps created by free
|
|
|
|
|
software will have a chance to be of higher quality.
|
2020-05-26 11:39:18 +03:00
|
|
|
|
\end{abstract}
|
|
|
|
|
|
|
|
|
|
\newpage
|
|
|
|
|
|
|
|
|
|
\tableofcontents
|
|
|
|
|
\listoffigures
|
2020-05-21 11:40:20 +03:00
|
|
|
|
|
2020-05-27 11:39:03 +03:00
|
|
|
|
\newpage
|
|
|
|
|
|
2020-05-21 11:25:14 +03:00
|
|
|
|
\section{Introduction}
|
|
|
|
|
\label{sec:introduction}
|
|
|
|
|
|
2020-05-25 11:40:16 +03:00
|
|
|
|
A number of cartographic line generalization algorithms have been researched,
|
|
|
|
|
which claim to better process cartographic objects like lines. These fall into
|
|
|
|
|
two rough categories:
|
|
|
|
|
\begin{itemize}
|
|
|
|
|
\item Cartographic knowledge was encoded to an algorithm (bottom-up
|
|
|
|
|
approach). One among these are \cite{wang1998line}.
|
|
|
|
|
\item Mathematical shape transformation which yields a more
|
|
|
|
|
cartographically suitable down-scaling. E.g. \cite{jiang2003line},
|
|
|
|
|
\cite{dyken2009simultaneous}, \cite{mustafa2006dynamic},
|
|
|
|
|
\cite{nollenburg2008morphing}.
|
|
|
|
|
\end{itemize}
|
|
|
|
|
|
2020-05-26 15:10:30 +03:00
|
|
|
|
During research for the mentioned articles, prototype code has been written for
|
|
|
|
|
most of the algorithms. However, none of them seem to be available for use
|
|
|
|
|
except for the two "classical" ones -- {\DP} and {\VW}.
|
|
|
|
|
|
2020-05-27 09:27:52 +03:00
|
|
|
|
\cite{wang1998line} is an algorithm specifically created for cartographic
|
|
|
|
|
generalization and available for general use, though it is only currently
|
|
|
|
|
available in a commercial product. This poses a problem for map creation in
|
|
|
|
|
open source software: there is not a similar high-quality simplification
|
|
|
|
|
algorithm to create down-scaled maps, so any cartographic work, which uses line
|
|
|
|
|
generalization as part of its processing, will be of sub-par quality.
|
|
|
|
|
We believe that availability of high-quality open-source tools is an important
|
|
|
|
|
foundation for future cartographic experimentation and development, thus it
|
|
|
|
|
it benefits the cartographic society as a whole.
|
2020-05-26 15:10:30 +03:00
|
|
|
|
|
|
|
|
|
This paper will be reviewing and comparing two widely available algorithms that
|
|
|
|
|
are often used for line generalization:
|
2020-05-25 11:40:16 +03:00
|
|
|
|
\begin{itemize}
|
|
|
|
|
\item \cite{douglas1973algorithms} via
|
|
|
|
|
\href{https://postgis.net/docs/ST_Simplify.html}{PostGIS Simplify}.
|
|
|
|
|
|
|
|
|
|
\item \cite{visvalingam1993line} via
|
|
|
|
|
\href{https://postgis.net/docs/ST_SimplifyVW.html}{PostGIS SimplifyVW}.
|
|
|
|
|
\end{itemize}
|
2020-05-21 13:31:18 +03:00
|
|
|
|
|
2020-05-26 15:10:30 +03:00
|
|
|
|
Review of the available algorithms will be followed by desiderata for a
|
|
|
|
|
possible open-source addition. In the end, we will issue a recommendation,
|
2020-05-26 15:54:16 +03:00
|
|
|
|
which algorithm can be picked up and implemented by an avid GIS developer.
|
2020-05-26 15:10:30 +03:00
|
|
|
|
|
2020-05-26 11:39:18 +03:00
|
|
|
|
\section{Visual comparison}
|
|
|
|
|
|
|
|
|
|
Lakaja and large part of Žeimena (see figure~\ref{fig:zeimena} on
|
2020-05-26 15:54:16 +03:00
|
|
|
|
page~\pageref{fig:zeimena}) will be used as inputs to the generalization
|
|
|
|
|
algorithms, because the river exhibits both both straight and curved shape, is
|
|
|
|
|
a combination of two curly rivers, and author's familiarity with the location.
|
|
|
|
|
|
2020-05-27 13:41:27 +03:00
|
|
|
|
Since the map area is large (approx. 20km by 28km, scale $1:300 000$), we will
|
2020-05-26 23:13:00 +03:00
|
|
|
|
also review a subset of the area of approx 2200m by 1575m. The zoomed-in
|
|
|
|
|
version will help explain some of the deficiencies in the reviewed algorithms.
|
2020-05-21 16:41:29 +03:00
|
|
|
|
|
2020-05-27 14:41:47 +03:00
|
|
|
|
\begin{figure}[H]
|
2020-05-21 16:41:29 +03:00
|
|
|
|
\centering
|
2020-05-27 11:22:44 +03:00
|
|
|
|
\includegraphics[width=67.5mm]{zeimena}
|
2020-05-27 13:41:27 +03:00
|
|
|
|
\caption{Lakaja and Žeimena, with marked river crossing area, $1:300 000$}
|
2020-05-21 18:20:44 +03:00
|
|
|
|
\label{fig:zeimena}
|
2020-05-21 16:41:29 +03:00
|
|
|
|
\end{figure}
|
|
|
|
|
|
2020-05-26 17:36:13 +03:00
|
|
|
|
\begin{figure}[h]
|
|
|
|
|
\centering
|
|
|
|
|
\includegraphics[width=74mm]{crossing}
|
2020-05-27 13:41:27 +03:00
|
|
|
|
\caption{River crossing area zoomed in, $1:30 000$}
|
2020-05-26 17:36:13 +03:00
|
|
|
|
\label{fig:crossing}
|
|
|
|
|
\end{figure}
|
|
|
|
|
|
2020-05-26 11:39:18 +03:00
|
|
|
|
To visually evaluate the Žeimena sample, examples for {\DP} and {\VW}
|
2020-05-25 18:02:48 +03:00
|
|
|
|
were created using the following parameters:
|
2020-05-25 17:37:58 +03:00
|
|
|
|
|
|
|
|
|
\begin{enumerate}[label=(\Roman*)]
|
|
|
|
|
\item {\DP} tolerance: $tolerance := 125 * 2^n, n = 0,1,...,5$.
|
|
|
|
|
\item {\VW} tolerance: $vwtolerance = tolerance ^ 2$\label{itm:2}.
|
|
|
|
|
\end{enumerate}
|
|
|
|
|
|
2020-05-26 11:39:18 +03:00
|
|
|
|
Parameter~\ref{itm:2} requires explanation. Tolerance for {\DP} is specified in
|
|
|
|
|
linear units, in this case, meters. Tolerance for {\VW} is specified in area
|
|
|
|
|
units $m^2$. As author was not able to locate formal comparisons between the
|
|
|
|
|
two (i.e. how to calculate one tolerance value from the other, so the results
|
|
|
|
|
are comparable?), {\DP} tolerance was arbitrarily squared and fed to {\VW}. To
|
|
|
|
|
author's eye, this provides comparable and reasonable results, though could be
|
|
|
|
|
researched.
|
2020-05-25 18:02:48 +03:00
|
|
|
|
|
2020-05-26 14:17:39 +03:00
|
|
|
|
As can be observed in table~\ref{tab:comparison-zeimena} on
|
|
|
|
|
page~\pageref{tab:comparison-zeimena}, both simplication algorithms convert
|
2020-05-27 13:41:27 +03:00
|
|
|
|
bends to chopped lines. This is especially visible in tolerances 256 and 512.
|
2020-05-26 14:17:39 +03:00
|
|
|
|
In a more robust simplification algorithm, the larger tolerance, the larger the
|
|
|
|
|
bends on the original map should be retained.
|
2020-05-25 18:02:48 +03:00
|
|
|
|
|
2020-05-27 14:41:47 +03:00
|
|
|
|
\begin{figure}[H]
|
2020-05-25 18:02:48 +03:00
|
|
|
|
\renewcommand{\tabularxcolumn}[1]{>{\center\small}m{#1}}
|
2020-05-26 14:07:28 +03:00
|
|
|
|
\begin{tabularx}{\textwidth}{ p{2.1cm} | X | X | }
|
|
|
|
|
Tolerance DP/VW &
|
|
|
|
|
Douglas \& Peucker &
|
|
|
|
|
Visvalingam-Whyatt \tabularnewline \hline
|
2020-05-25 18:02:48 +03:00
|
|
|
|
|
2020-05-27 13:09:52 +03:00
|
|
|
|
128/16384 &
|
2020-05-27 12:23:09 +03:00
|
|
|
|
\includegraphics[width=\linewidth]{zeimena-douglas-128} &
|
|
|
|
|
\includegraphics[width=\linewidth]{zeimena-visvalingam-128} \tabularnewline \hline
|
2020-05-25 18:02:48 +03:00
|
|
|
|
|
2020-05-27 13:09:52 +03:00
|
|
|
|
256/65536 &
|
2020-05-27 12:23:09 +03:00
|
|
|
|
\includegraphics[width=.5\linewidth]{zeimena-douglas-256} &
|
|
|
|
|
\includegraphics[width=.5\linewidth]{zeimena-visvalingam-256} \tabularnewline \hline
|
2020-05-25 18:02:48 +03:00
|
|
|
|
|
2020-05-27 13:41:27 +03:00
|
|
|
|
512/262144 &
|
2020-05-27 12:23:09 +03:00
|
|
|
|
\includegraphics[width=.25\linewidth]{zeimena-douglas-512} &
|
|
|
|
|
\includegraphics[width=.25\linewidth]{zeimena-visvalingam-512} \tabularnewline \hline
|
2020-05-25 18:02:48 +03:00
|
|
|
|
|
2020-05-27 13:09:52 +03:00
|
|
|
|
1024/1048576 &
|
2020-05-27 12:23:09 +03:00
|
|
|
|
\includegraphics[width=.125\linewidth]{zeimena-douglas-1024} &
|
|
|
|
|
\includegraphics[width=.125\linewidth]{zeimena-visvalingam-1024} \tabularnewline \hline
|
2020-05-25 18:02:48 +03:00
|
|
|
|
|
2020-05-27 13:09:52 +03:00
|
|
|
|
2048/4194304 &
|
2020-05-27 12:23:09 +03:00
|
|
|
|
\includegraphics[width=.0625\linewidth]{zeimena-douglas-2048} &
|
|
|
|
|
\includegraphics[width=.0625\linewidth]{zeimena-visvalingam-2048} \tabularnewline \hline
|
2020-05-25 18:02:48 +03:00
|
|
|
|
|
2020-05-27 13:09:52 +03:00
|
|
|
|
4096/16777216 &
|
2020-05-27 12:23:09 +03:00
|
|
|
|
\includegraphics[width=.0625\linewidth]{zeimena-douglas-4096} &
|
|
|
|
|
\includegraphics[width=.0625\linewidth]{zeimena-visvalingam-4096} \tabularnewline \hline
|
2020-05-25 18:02:48 +03:00
|
|
|
|
\end{tabularx}
|
2020-05-26 15:10:30 +03:00
|
|
|
|
\caption{{\DP} and {\VW} on Žeimena}
|
2020-05-26 14:17:39 +03:00
|
|
|
|
\label{tab:comparison-zeimena}
|
2020-05-25 18:02:48 +03:00
|
|
|
|
\end{figure}
|
2020-05-25 12:32:45 +03:00
|
|
|
|
|
2020-05-27 14:41:47 +03:00
|
|
|
|
To ease the discussion on shapes in the resulting output, it is useful to
|
|
|
|
|
define what a "blunt bend" is: it is a river bent that looks like a cutout from
|
|
|
|
|
a large circle, ilustrated in figure~\ref{fig:blunt-bent}.
|
2020-05-27 13:41:27 +03:00
|
|
|
|
|
|
|
|
|
\begin{figure}[h]
|
|
|
|
|
\centering
|
|
|
|
|
\begin{tikzpicture}
|
2020-05-28 17:53:51 +03:00
|
|
|
|
\draw[color=mypurple] (-5,0) -- (-3, 0) ;
|
|
|
|
|
\draw[color=mypurple] (0,0) arc (60:120:3) ;
|
|
|
|
|
\draw[color=mypurple] (0,0) -- (2, 0) ;
|
2020-05-27 13:41:27 +03:00
|
|
|
|
\end{tikzpicture}
|
|
|
|
|
\caption{Blunt bent}
|
|
|
|
|
\label{fig:blunt-bent}
|
|
|
|
|
\end{figure}
|
2020-05-27 12:01:03 +03:00
|
|
|
|
|
2020-05-27 14:41:47 +03:00
|
|
|
|
Once zoomed in to the river crossing area with {\DP} and {\VW} applied, it becomes apparent that both large
|
|
|
|
|
blunts are normalized to single lines, the shape becomes jagged and unpleasant
|
|
|
|
|
for the eye. See table~\ref{tab:comparison-crossing} on
|
|
|
|
|
page~\pageref{tab:comparison-crossing}.
|
|
|
|
|
|
2020-05-27 12:01:03 +03:00
|
|
|
|
\begin{figure}[h]
|
|
|
|
|
\renewcommand{\tabularxcolumn}[1]{>{\center\small}m{#1}}
|
2020-05-27 12:23:09 +03:00
|
|
|
|
\begin{tabularx}{\textwidth}{ p{2.1cm} | X | X | }
|
2020-05-27 12:35:20 +03:00
|
|
|
|
Tolerance DP/VW &
|
|
|
|
|
Douglas \& Peucker &
|
|
|
|
|
Visvalingam-Whyatt \tabularnewline \hline
|
2020-05-27 12:01:03 +03:00
|
|
|
|
|
2020-05-27 12:23:09 +03:00
|
|
|
|
64/4096 &
|
2020-05-27 12:34:32 +03:00
|
|
|
|
\includegraphics[width=\linewidth]{overlaid-zeimena-douglas-64} &
|
|
|
|
|
\includegraphics[width=\linewidth]{overlaid-zeimena-visvalingam-64} \tabularnewline \hline
|
2020-05-27 12:23:09 +03:00
|
|
|
|
|
2020-05-27 13:41:27 +03:00
|
|
|
|
128/16384 &
|
2020-05-27 12:35:20 +03:00
|
|
|
|
\includegraphics[width=\linewidth]{overlaid-zeimena-douglas-128} &
|
|
|
|
|
\includegraphics[width=\linewidth]{overlaid-zeimena-visvalingam-128} \tabularnewline \hline
|
2020-05-27 12:01:03 +03:00
|
|
|
|
|
2020-05-27 13:41:27 +03:00
|
|
|
|
256/65536 &
|
2020-05-27 12:35:20 +03:00
|
|
|
|
\includegraphics[width=\linewidth]{overlaid-zeimena-douglas-256} &
|
|
|
|
|
\includegraphics[width=\linewidth]{overlaid-zeimena-visvalingam-256} \tabularnewline \hline
|
2020-05-27 12:01:03 +03:00
|
|
|
|
|
|
|
|
|
\end{tabularx}
|
|
|
|
|
\caption{{\DP} and {\VW} on river crossing area}
|
2020-05-27 13:41:27 +03:00
|
|
|
|
\label{tab:comparison-crossing}
|
2020-05-27 12:01:03 +03:00
|
|
|
|
\end{figure}
|
|
|
|
|
|
2020-05-27 14:41:47 +03:00
|
|
|
|
There is another issue on the wishlist beyond jaggyness and loss of large bents
|
|
|
|
|
-- combining close bends to larger ones.
|
2020-05-26 11:39:18 +03:00
|
|
|
|
|
2020-05-26 13:56:26 +03:00
|
|
|
|
\subsection{Combining bends}
|
2020-05-26 07:42:43 +03:00
|
|
|
|
|
2020-05-26 11:39:18 +03:00
|
|
|
|
Imagine there are two small bends close to each other, similar to
|
2020-05-27 14:41:47 +03:00
|
|
|
|
figure~\ref{fig:sinewave2} on page~\pageref{fig:sinewave2}, and one needs to
|
2020-05-27 13:53:51 +03:00
|
|
|
|
generalize it. The bends are too large to ignore replace them with a straight
|
|
|
|
|
line, but too small to retain both and retain their complexity.
|
2020-05-26 11:39:18 +03:00
|
|
|
|
|
2020-05-27 14:41:47 +03:00
|
|
|
|
According to cartographic generalization rules
|
|
|
|
|
(\cite{miuller1995generalization}), consecutive small bends should be combined
|
|
|
|
|
into larger bends. {\WM} encoded this process to an algorithm.
|
|
|
|
|
|
2020-05-26 11:39:18 +03:00
|
|
|
|
\begin{figure}[h]
|
|
|
|
|
\centering
|
2020-05-27 13:56:37 +03:00
|
|
|
|
\includegraphics[width=52mm]{sinewave2}
|
2020-05-26 11:39:18 +03:00
|
|
|
|
\caption{Example river bend that should be generalized}
|
2020-05-27 13:56:37 +03:00
|
|
|
|
\label{fig:sinewave2}
|
2020-05-26 11:39:18 +03:00
|
|
|
|
\end{figure}
|
|
|
|
|
|
2020-05-27 13:56:37 +03:00
|
|
|
|
When one applies {\DP} to figure~\ref{fig:sinewave2}, either both bends remain,
|
2020-05-27 14:41:47 +03:00
|
|
|
|
or become a straight line, see table~\ref{tab:comparison-sinewave2} on
|
|
|
|
|
page~\pageref{tab:comparison-sinewave2}.
|
2020-05-26 11:39:18 +03:00
|
|
|
|
|
2020-05-27 14:49:22 +03:00
|
|
|
|
\begin{figure}[h]
|
2020-05-26 14:17:39 +03:00
|
|
|
|
\renewcommand{\tabularxcolumn}[1]{>{\center\small}m{#1}}
|
|
|
|
|
\begin{tabularx}{\textwidth}{ p{1.5cm} | X | X | }
|
2020-05-27 14:41:47 +03:00
|
|
|
|
Tolerance DP/VW &
|
|
|
|
|
Douglas \& Peucker &
|
|
|
|
|
Visvalingam-Whyatt \tabularnewline \hline
|
2020-05-26 14:17:39 +03:00
|
|
|
|
|
2020-05-27 14:41:47 +03:00
|
|
|
|
2/4 &
|
|
|
|
|
\includegraphics[width=\linewidth]{overlaid-sinewave2-douglas-2} &
|
|
|
|
|
\includegraphics[width=\linewidth]{overlaid-sinewave2-visvalingam-2} \tabularnewline \hline
|
2020-05-26 14:17:39 +03:00
|
|
|
|
|
2020-05-27 14:41:47 +03:00
|
|
|
|
16/256 &
|
|
|
|
|
\includegraphics[width=\linewidth]{overlaid-sinewave2-douglas-16} &
|
|
|
|
|
\includegraphics[width=\linewidth]{overlaid-sinewave2-visvalingam-16} \tabularnewline \hline
|
2020-05-26 14:17:39 +03:00
|
|
|
|
|
2020-05-27 13:09:52 +03:00
|
|
|
|
32/1024 &
|
2020-05-27 14:41:47 +03:00
|
|
|
|
\includegraphics[width=\linewidth]{overlaid-sinewave2-douglas-32} &
|
|
|
|
|
\includegraphics[width=\linewidth]{overlaid-sinewave2-visvalingam-32} \tabularnewline \hline
|
2020-05-26 14:17:39 +03:00
|
|
|
|
|
|
|
|
|
\end{tabularx}
|
|
|
|
|
\caption{{\DP} and {\VW} on example wave}
|
2020-05-27 14:41:47 +03:00
|
|
|
|
\label{tab:comparison-sinewave2}
|
2020-05-26 13:56:26 +03:00
|
|
|
|
\end{figure}
|
2020-05-21 11:25:14 +03:00
|
|
|
|
|
2020-05-27 14:41:47 +03:00
|
|
|
|
Ideally, the double-bend in figure~\ref{fig:sinewave2} should be normalized to
|
|
|
|
|
a larger single-bend, similar to figure~\ref{fig:sinewave1} on
|
2020-05-27 13:56:37 +03:00
|
|
|
|
page~\pageref{fig:sinewave2}.
|
|
|
|
|
|
|
|
|
|
\begin{figure}[h]
|
|
|
|
|
\centering
|
|
|
|
|
\includegraphics[width=52mm]{sinewave1}
|
2020-05-27 14:45:11 +03:00
|
|
|
|
\caption{Desired river bend generalization}
|
2020-05-27 13:56:37 +03:00
|
|
|
|
\label{fig:sinewave1}
|
|
|
|
|
\end{figure}
|
2020-05-27 13:53:51 +03:00
|
|
|
|
|
2020-05-27 14:41:47 +03:00
|
|
|
|
To recap, both {\VW} and {\DP} simplify the lines, but their cartographic
|
|
|
|
|
output, when zoomed in, looks poorly to the human eye. Can a better solution be
|
|
|
|
|
found?
|
|
|
|
|
|
|
|
|
|
\section{Recommendation}
|
|
|
|
|
\label{sec:recommendation}
|
|
|
|
|
|
|
|
|
|
So far, we have reviewed two widely available open-source generalization
|
|
|
|
|
algorithms {\DP} and {\VW}, and now can enumerate the shortcomings:
|
|
|
|
|
\begin{itemize}
|
|
|
|
|
\item Resulting generalized lines look jaggy and, when zoomed in,
|
|
|
|
|
unpleasant to the eye.
|
|
|
|
|
\item Blunt bends are generalized to straight lines, even though sometimes
|
|
|
|
|
they should remain blunt bends (or even exhagerated bends).
|
|
|
|
|
\item Consecutive small bends should be normalized into a larger bend.
|
|
|
|
|
\end{itemize}
|
|
|
|
|
|
|
|
|
|
According to \cite{wang1998line}, their algorithm fixes all 3 issues above. The
|
|
|
|
|
algorithm is relatively simple to understand for a non-expert cartographer
|
|
|
|
|
software developer, and thus should be feasible to implement in a few weeks.
|
|
|
|
|
|
|
|
|
|
\section{Conclusions}
|
|
|
|
|
\label{sec:conclusions}
|
|
|
|
|
|
|
|
|
|
We have evaluated two readily available line simplification algorithms using a
|
|
|
|
|
river sample and a synthetic bend: {\VW} and {\DP}. Once looking at the
|
|
|
|
|
examples, it is quite easy to see the most glaring deficiencies when applying
|
|
|
|
|
those two for comparing cartographic generalization.
|
|
|
|
|
|
|
|
|
|
We are suggesting to complement open-source list of
|
|
|
|
|
available algorithms with {\WM}, which was created for cartographic
|
|
|
|
|
generalization, and should fix the shortcomings identified in this paper.
|
|
|
|
|
|
2020-05-25 18:09:44 +03:00
|
|
|
|
\section{Related Work and future suggestions}
|
2020-05-21 11:25:14 +03:00
|
|
|
|
\label{sec:related_work}
|
|
|
|
|
|
2020-05-21 16:41:29 +03:00
|
|
|
|
\cite{stanislawski2012automated} studied different types of metric assessments,
|
|
|
|
|
such as Hausdorff distance, segment length, vector shift, surface displacement,
|
2020-05-25 11:40:16 +03:00
|
|
|
|
and tortuosity for the generalization of linear geographic elements. This
|
2020-05-21 16:41:29 +03:00
|
|
|
|
research can provide references to the appropriate settings of the line
|
|
|
|
|
generalization parameters for the maps at various scales.
|
|
|
|
|
|
2020-05-26 11:39:18 +03:00
|
|
|
|
As noted in parameter~\ref{itm:2} on page~\pageref{itm:2}, it would be useful
|
|
|
|
|
to have a formula mapping {\DP} tolerance to {\VW}. That way, visual
|
|
|
|
|
comparisons between line simplification algorithms could be more objective.
|
2020-05-25 18:09:44 +03:00
|
|
|
|
|
2020-05-21 11:25:14 +03:00
|
|
|
|
\printbibliography
|
|
|
|
|
|
2020-05-27 11:39:03 +03:00
|
|
|
|
\begin{appendices}
|
2020-05-27 15:23:54 +03:00
|
|
|
|
|
|
|
|
|
\section{Žeimena and Lakaja in context}
|
|
|
|
|
|
2020-05-27 11:39:03 +03:00
|
|
|
|
\begin{figure}[H]
|
|
|
|
|
\centering
|
|
|
|
|
\includegraphics[width=148mm]{zeimena-pretty}
|
|
|
|
|
\caption{Lakaja and Žeimena river in context}
|
|
|
|
|
\end{figure}
|
|
|
|
|
|
2020-05-27 15:23:54 +03:00
|
|
|
|
\section{Code listings}
|
|
|
|
|
|
|
|
|
|
For the curious users it may be useful to see how the analysis was executed.
|
|
|
|
|
Also, given the source listings, it should be relatively straightforward to
|
|
|
|
|
re-run the same analysis on a different area.
|
|
|
|
|
|
2020-05-27 15:31:51 +03:00
|
|
|
|
The input files outside of these listings are {\tt zeimena.gpkg}, which is a
|
|
|
|
|
manually created GeoPackage containing Žeimena and Lakaja rivers, and the
|
|
|
|
|
\LaTeX\ report itself.
|
|
|
|
|
|
2020-05-27 15:39:10 +03:00
|
|
|
|
The analysis was executed and report was generated on Ubuntu 20.04 with only
|
2020-05-28 17:22:37 +03:00
|
|
|
|
system packages. This should be sufficient: {\tt postgis gdal-bin biber
|
|
|
|
|
latexmk texlive-bibtex-extra python3-geopandas python3-pygments}.
|
2020-05-27 15:39:10 +03:00
|
|
|
|
|
2020-05-27 15:23:54 +03:00
|
|
|
|
\subsection{douglas.sql}
|
2020-05-27 15:41:05 +03:00
|
|
|
|
Transforms a layer ({\tt :src}) to {\DP} using $tolerance$ tolerance into
|
|
|
|
|
{\tt :tbl} table.
|
2020-05-27 15:23:54 +03:00
|
|
|
|
\inputminted[fontsize=\small]{sql}{douglas.sql}
|
|
|
|
|
|
|
|
|
|
\subsection{visvalingam.sql}
|
2020-05-27 15:41:05 +03:00
|
|
|
|
Transforms a layer ({\tt :src}) to {\VW} using $tolerance^2$ tolerance into
|
|
|
|
|
{\tt :tbl} table.
|
2020-05-27 15:23:54 +03:00
|
|
|
|
\inputminted[fontsize=\small]{sql}{visvalingam.sql}
|
|
|
|
|
|
|
|
|
|
\subsection{fig2layer.py}
|
|
|
|
|
Creates figures (square, sine wave) as geopackage files.
|
|
|
|
|
\inputminted[fontsize=\small]{python}{fig2layer.py}
|
|
|
|
|
|
|
|
|
|
\subsection{Makefile}
|
|
|
|
|
This file binds all the pieces together:
|
|
|
|
|
\begin{itemize}
|
|
|
|
|
\item Prepares the PostGIS database.
|
|
|
|
|
\item Generates helper figures (sine waves, squares).
|
|
|
|
|
\item Runs analysis on input files ({\DP} and {\VW}).
|
|
|
|
|
\item Invokes {\tt latexmk} as a final report generation step.
|
|
|
|
|
\end{itemize}
|
|
|
|
|
\inputminted[fontsize=\small]{make}{Makefile}
|
|
|
|
|
|
|
|
|
|
\subsection{layer2img.py}
|
|
|
|
|
This file accepts a layer (or two) and generates a PDF image suitable for embedding into the report.
|
|
|
|
|
\inputminted[fontsize=\small]{python}{layer2img.py}
|
|
|
|
|
|
2020-05-27 15:39:10 +03:00
|
|
|
|
\subsection{managedb}
|
|
|
|
|
Manages a PostGIS database in the project directory. That way, the database can
|
|
|
|
|
be torn down and re-created by automated tools like the {\tt Makefile} itself.
|
|
|
|
|
You may need to update the paths in this script to suit your environment.
|
|
|
|
|
\inputminted[fontsize=\small]{bash}{managedb}
|
|
|
|
|
|
2020-05-27 15:23:54 +03:00
|
|
|
|
\end{appendices}
|
2020-05-21 11:25:14 +03:00
|
|
|
|
\end{document}
|