Add a few DP, VW and Chaikins

This commit is contained in:
Motiejus Jakštys 2021-05-16 23:23:07 +03:00
parent 69711bb841
commit 76c799cf2b
3 changed files with 152 additions and 53 deletions

View File

@ -35,12 +35,12 @@ RIVERS = \
salvis-50k \ salvis-50k \
salvis-250k-10x \ salvis-250k-10x \
salvis-gdr250-2x \ salvis-gdr250-2x \
salvis-douglas-64-50k \ salvis-dp-64-50k \
salvis-visvalingam-64-50k \ salvis-vw-64-50k \
salvis-douglas-64-chaikin-50k \ salvis-dp-64-chaikin-50k \
salvis-visvalingam-64-chaikin-50k \ salvis-vw-64-chaikin-50k \
salvis-overlaid-douglas-64-chaikin-50k \ salvis-overlaid-dp-64-chaikin-50k \
salvis-overlaid-visvalingam-64-chaikin-50k \ salvis-overlaid-vw-64-chaikin-50k \
salvis-wm-250k-10x \ salvis-wm-250k-10x \
salvis-wm-250k-2x \ salvis-wm-250k-2x \
salvis-wm-50k \ salvis-wm-50k \
@ -49,7 +49,11 @@ RIVERS = \
salvis-wm-overlaid-250k-zoom \ salvis-wm-overlaid-250k-zoom \
salvis-wm-gdr50 \ salvis-wm-gdr50 \
salvis-wm-gdr50-ne \ salvis-wm-gdr50-ne \
salvis-wm-220 salvis-wm-220 \
salvis-wm-dp-50k \
salvis-wm-dp-chaikin-50k \
salvis-wm-vw-50k \
salvis-wm-vw-chaikin-50k
################################# #################################
# The thesis, publishable version # The thesis, publishable version
@ -183,29 +187,29 @@ salvis-250k-10x_WIDTHDIV = 10
salvis-gdr250-2x_1SELECT = wm_visuals where name='salvis-gdr250' salvis-gdr250-2x_1SELECT = wm_visuals where name='salvis-gdr250'
salvis-gdr250-2x_WIDTHDIV = 2 salvis-gdr250-2x_WIDTHDIV = 2
salvis-douglas-64-50k_1SELECT = wm_visuals where name='salvis-douglas-64' salvis-dp-64-50k_1SELECT = wm_visuals where name='salvis-dp-64'
salvis-douglas-64-50k_WIDTHDIV = 2 salvis-dp-64-50k_WIDTHDIV = 2
salvis-visvalingam-64-50k_1SELECT = wm_visuals where name='salvis-visvalingam-64' salvis-vw-64-50k_1SELECT = wm_visuals where name='salvis-vw-64'
salvis-visvalingam-64-50k_WIDTHDIV = 2 salvis-vw-64-50k_WIDTHDIV = 2
salvis-douglas-64-chaikin-50k_2SELECT = wm_visuals where name='salvis-douglas-64-chaikin' salvis-dp-64-chaikin-50k_2SELECT = wm_visuals where name='salvis-dp-64-chaikin'
salvis-douglas-64-chaikin-50k_WIDTHDIV = 2 salvis-dp-64-chaikin-50k_WIDTHDIV = 2
salvis-visvalingam-64-chaikin-50k_2SELECT = wm_visuals where name='salvis-visvalingam-64-chaikin' salvis-vw-64-chaikin-50k_2SELECT = wm_visuals where name='salvis-vw-64-chaikin'
salvis-visvalingam-64-chaikin-50k_WIDTHDIV = 2 salvis-vw-64-chaikin-50k_WIDTHDIV = 2
salvis-overlaid-douglas-64-chaikin-50k_1SELECT = wm_visuals where name='salvis-douglas-64-chaikin' salvis-overlaid-dp-64-chaikin-50k_1SELECT = wm_visuals where name='salvis-dp-64-chaikin'
salvis-overlaid-douglas-64-chaikin-50k_2SELECT = wm_visuals where name='salvis' salvis-overlaid-dp-64-chaikin-50k_2SELECT = wm_visuals where name='salvis'
salvis-overlaid-douglas-64-chaikin-50k_1COLOR = orange salvis-overlaid-dp-64-chaikin-50k_1COLOR = orange
salvis-overlaid-douglas-64-chaikin-50k_WIDTHDIV = 2 salvis-overlaid-dp-64-chaikin-50k_WIDTHDIV = 2
salvis-overlaid-douglas-64-chaikin-50k_QUADRANT = 1 salvis-overlaid-dp-64-chaikin-50k_QUADRANT = 1
salvis-overlaid-visvalingam-64-chaikin-50k_1SELECT = wm_visuals where name='salvis-visvalingam-64-chaikin' salvis-overlaid-vw-64-chaikin-50k_1SELECT = wm_visuals where name='salvis-vw-64-chaikin'
salvis-overlaid-visvalingam-64-chaikin-50k_2SELECT = wm_visuals where name='salvis' salvis-overlaid-vw-64-chaikin-50k_2SELECT = wm_visuals where name='salvis'
salvis-overlaid-visvalingam-64-chaikin-50k_1COLOR = orange salvis-overlaid-vw-64-chaikin-50k_1COLOR = orange
salvis-overlaid-visvalingam-64-chaikin-50k_WIDTHDIV = 2 salvis-overlaid-vw-64-chaikin-50k_WIDTHDIV = 2
salvis-overlaid-visvalingam-64-chaikin-50k_QUADRANT = 1 salvis-overlaid-vw-64-chaikin-50k_QUADRANT = 1
salvis-wm-250k-2x_1SELECT = wm_visuals where name='salvis-wm-220' salvis-wm-250k-2x_1SELECT = wm_visuals where name='salvis-wm-220'
salvis-wm-250k-2x_WIDTHDIV = 2 salvis-wm-250k-2x_WIDTHDIV = 2
@ -236,17 +240,52 @@ salvis-wm-gdr50_2SELECT = wm_visuals where name='salvis-gdr50'
salvis-wm-gdr50_3SELECT = wm_visuals where name='salvis' salvis-wm-gdr50_3SELECT = wm_visuals where name='salvis'
salvis-wm-gdr50_1COLOR = orange salvis-wm-gdr50_1COLOR = orange
salvis-wm-gdr50_2COLOR = green salvis-wm-gdr50_2COLOR = green
salvis-wm-gdr50_3LINESTYLE = dotted
salvis-wm-gdr50-ne_1SELECT = wm_visuals where name='salvis-wm-75' salvis-wm-gdr50-ne_1SELECT = wm_visuals where name='salvis-wm-75'
salvis-wm-gdr50-ne_2SELECT = wm_visuals where name='salvis-gdr50' salvis-wm-gdr50-ne_2SELECT = wm_visuals where name='salvis-gdr50'
salvis-wm-gdr50-ne_3SELECT = wm_visuals where name='salvis' salvis-wm-gdr50-ne_3SELECT = wm_visuals where name='salvis'
salvis-wm-gdr50-ne_1COLOR = orange salvis-wm-gdr50-ne_1COLOR = orange
salvis-wm-gdr50-ne_2COLOR = green salvis-wm-gdr50-ne_2COLOR = green
salvis-wm-gdr50-ne_3LINESTYLE = dotted
salvis-wm-gdr50-ne_QUADRANT = 1 salvis-wm-gdr50-ne_QUADRANT = 1
salvis-wm-220_1SELECT = wm_visuals where name='salvis-wm-220' salvis-wm-220_1SELECT = wm_visuals where name='salvis-wm-220'
salvis-wm-220_WIDTHDIV = 2 salvis-wm-220_WIDTHDIV = 2
salvis-wm-dp-50k_1SELECT = wm_visuals where name='salvis-dp-64'
salvis-wm-dp-50k_2SELECT = wm_visuals where name='salvis-wm-75'
salvis-wm-dp-50k_3SELECT = wm_visuals where name='salvis'
salvis-wm-dp-50k_1COLOR = green
salvis-wm-dp-50k_2COLOR = orange
salvis-wm-dp-50k_3LINESTYLE = dotted
salvis-wm-dp-chaikin-50k_1SELECT = wm_visuals where name='salvis-dp-64-chaikin'
salvis-wm-dp-chaikin-50k_2SELECT = wm_visuals where name='salvis-wm-75'
salvis-wm-dp-chaikin-50k_3SELECT = wm_visuals where name='salvis'
salvis-wm-dp-chaikin-50k_1COLOR = green
salvis-wm-dp-chaikin-50k_2COLOR = orange
salvis-wm-dp-chaikin-50k_3LINESTYLE = dotted
salvis-wm-vw-50k_1SELECT = wm_visuals where name='salvis-vw-64'
salvis-wm-vw-50k_2SELECT = wm_visuals where name='salvis-wm-75'
salvis-wm-vw-50k_3SELECT = wm_visuals where name='salvis'
salvis-wm-vw-50k_1COLOR = green
salvis-wm-vw-50k_2COLOR = orange
salvis-wm-vw-50k_3LINESTYLE = dotted
salvis-wm-vw-chaikin-50k_1SELECT = wm_visuals where name='salvis-vw-64-chaikin'
salvis-wm-vw-chaikin-50k_2SELECT = wm_visuals where name='salvis-wm-75'
salvis-wm-vw-chaikin-50k_3SELECT = wm_visuals where name='salvis'
salvis-wm-vw-chaikin-50k_1COLOR = green
salvis-wm-vw-chaikin-50k_2COLOR = orange
salvis-wm-vw-chaikin-50k_3LINESTYLE = dotted
salvis-wm-dp-chaikin-50k_1SELECT =
salvis-wm-vw-chaikin-50k_1SELECT =
.faux_db_pre: db init.sql .faux_db_pre: db init.sql
bash db start bash db start
bash db -f init.sql bash db -f init.sql

View File

@ -270,12 +270,12 @@ simplification for scale 1:\numprint{50000} and especially for
\begin{figure}[ht] \begin{figure}[ht]
\centering \centering
\begin{subfigure}[b]{.49\textwidth} \begin{subfigure}[b]{.49\textwidth}
\includegraphics[width=\textwidth]{salvis-douglas-64-50k} \includegraphics[width=\textwidth]{salvis-dp-64-50k}
\caption{Using {\DP}.} \caption{Using {\DP}.}
\end{subfigure} \end{subfigure}
\hfill \hfill
\begin{subfigure}[b]{.49\textwidth} \begin{subfigure}[b]{.49\textwidth}
\includegraphics[width=\textwidth]{salvis-visvalingam-64-50k} \includegraphics[width=\textwidth]{salvis-vw-64-50k}
\caption{Using {\VW}.} \caption{Using {\VW}.}
\end{subfigure} \end{subfigure}
\caption{Simplified using classical algorithms (1:\numprint{50000}).} \caption{Simplified using classical algorithms (1:\numprint{50000}).}
@ -291,15 +291,15 @@ generalization, illustrated in figure~\ref{fig:salvis-generalized-chaikin-50k}.
\begin{figure}[ht!] \begin{figure}[ht!]
\centering \centering
\begin{subfigure}[b]{.49\textwidth} \begin{subfigure}[b]{.49\textwidth}
\includegraphics[width=\textwidth]{salvis-douglas-64-chaikin-50k} \includegraphics[width=\textwidth]{salvis-dp-64-chaikin-50k}
\caption{{\DP} and Chaikin's.} \caption{{\DP} and Chaikin's.}
\label{fig:salvis-douglas-64-chaikin-50k} \label{fig:salvis-dp-64-chaikin-50k}
\end{subfigure} \end{subfigure}
\hfill \hfill
\begin{subfigure}[b]{.49\textwidth} \begin{subfigure}[b]{.49\textwidth}
\includegraphics[width=\textwidth]{salvis-visvalingam-64-chaikin-50k} \includegraphics[width=\textwidth]{salvis-vw-64-chaikin-50k}
\caption{{\VW} and Chaikin's.} \caption{{\VW} and Chaikin's.}
\label{fig:salvis-visvalingam-64-chaikin-50k} \label{fig:salvis-vw-64-chaikin-50k}
\end{subfigure} \end{subfigure}
\caption{Simplified and smoothened river (1:\numprint{50000}).} \caption{Simplified and smoothened river (1:\numprint{50000}).}
\label{fig:salvis-generalized-chaikin-50k} \label{fig:salvis-generalized-chaikin-50k}
@ -308,18 +308,18 @@ generalization, illustrated in figure~\ref{fig:salvis-generalized-chaikin-50k}.
\begin{figure}[ht!] \begin{figure}[ht!]
\centering \centering
\begin{subfigure}[b]{.49\textwidth} \begin{subfigure}[b]{.49\textwidth}
\includegraphics[width=\textwidth]{salvis-overlaid-douglas-64-chaikin-50k} \includegraphics[width=\textwidth]{salvis-overlaid-dp-64-chaikin-50k}
\caption{Original (fig.~\ref{fig:salvis-50k}) and simplified \caption{Original (fig.~\ref{fig:salvis-50k}) and simplified
(fig.~\ref{fig:salvis-douglas-64-chaikin-50k}).} (fig.~\ref{fig:salvis-dp-64-chaikin-50k}).}
\end{subfigure} \end{subfigure}
\hfill \hfill
\begin{subfigure}[b]{.49\textwidth} \begin{subfigure}[b]{.49\textwidth}
\includegraphics[width=\textwidth]{salvis-overlaid-visvalingam-64-chaikin-50k} \includegraphics[width=\textwidth]{salvis-overlaid-vw-64-chaikin-50k}
\caption{Original (fig.~\ref{fig:salvis-50k}) and simplified \caption{Original (fig.~\ref{fig:salvis-50k}) and simplified
(fig.~\ref{fig:salvis-visvalingam-64-chaikin-50k}.)} (fig.~\ref{fig:salvis-vw-64-chaikin-50k}.)}
\end{subfigure} \end{subfigure}
\caption{Zoomed-in simplified and smoothened river and original.} \caption{Zoomed-in simplified and smoothened river and original.}
@ -1361,19 +1361,34 @@ Figure~\ref{fig:isolated-1-exaggerated} illustrates an exaggerated bend using
\section{Results} \section{Results}
\label{sec:results} \label{sec:results}
This section visualizes the results, discusses robustness and issues of the
generalization, and suggests specific improvements.
One of our goals is to compare the generalized lines with the official
generalized dataset\cite{nzt}. Therefore, we have selected the target scales
that the official sources offer too: 1:\numprint{50000} and
1:\numprint{250000}. The \textsc{dhalfcircle} values for the subset are as
follows:
\begin{table}[ht]
\centering
\begin{tabular}{ c D{.}{.}{1} }
Scale & \multicolumn{1}{c}{$D(m)$} \\ \hline
1:\numprint{50000} & 75 \\
1:\numprint{250000} & 220 \\
\end{tabular}
\end{table}
Our generalized results are viewed from the following angles:
\begin{itemize}
\item Compare to the non-simplified originals.
\item Compare to the official datasets.
\item Compare to {\DP} and {\VW}.
\end{itemize}
\subsection{Generalization Results of Analyzed Rivers} \subsection{Generalization Results of Analyzed Rivers}
\label{sec:generalization-results-of-analyzed-rivers} \label{sec:generalization-results-of-analyzed-rivers}
Figures~\ref{fig:salvis-wm-50k} and~\ref{fig:salvis-wm-250k} visualize
the generalization result for Šalčia and Visinčia using {\WM} with the
\textsc{dhalfcircle} values from the
table~\ref{table:scale-halfcirlce-diameter}:
\begin{itemize}
\item 1:\numprint{50000}: 75.
\item 1:\numprint{250000}: 220.
\end{itemize}
\subsubsection{Medium-scale (1:\numprint{50000})} \subsubsection{Medium-scale (1:\numprint{50000})}
\label{sec:analyzed-medium-scale} \label{sec:analyzed-medium-scale}
@ -1468,7 +1483,7 @@ future research and improvement:
\end{itemize} \end{itemize}
\subsection{Comparing Generalized Result with National Spatial Datasets} \subsection{Comparison with National Spatial Datasets}
\subsubsection{Background} \subsubsection{Background}
@ -1504,7 +1519,7 @@ all three shapes: GDR50LT, {\WM}--simplified GDB10LT, and the original GDB10LT.
\includegraphics[width=\textwidth]{salvis-wm-gdr50} \includegraphics[width=\textwidth]{salvis-wm-gdr50}
\caption{2x zoomed-in GDR50LT (green), {\WM}--simplified GDB10LT (orange) \caption{2x zoomed-in GDR50LT (green), {\WM}--simplified GDB10LT (orange)
and original GDB10LT (black).} and original GDB10LT (dotted black).}
\label{fig:salvis-wm-gdr50} \label{fig:salvis-wm-gdr50}
\end{figure} \end{figure}
@ -1548,6 +1563,51 @@ desired in section~\ref{sec:future-suggestions}.
\end{figure} \end{figure}
\subsection{Comparison with {\DP} and {\VW}}
It is time to visually compare our implementation with the classical
algorithms: {\DP}, {\VW} and Chaikin. Since we have established more work is
needed for small-scale maps (1:\numprint{250000}), we will limit the comparison
in this section to 1:\numprint{50000}.
\begin{figure}[h!]
\includegraphics[width=\textwidth]{salvis-wm-dp-50k}
\caption{{\DP} (green), {\WM} (orange) and original (black dotted) at
1:\numprint{50000}.}
\label{fig:salvis-wm-dp-50k}
\end{figure}
\begin{figure}[h!]
\includegraphics[width=\textwidth]{salvis-wm-dp-chaikin-50k}
\caption{Chaikin--smoothened {\DP} (green), {\WM} (orange) and original
(black dotted) at 1:\numprint{50000}.}
\label{fig:salvis-wm-dp-chaikin-50k}
\end{figure}
\begin{figure}[h!]
\includegraphics[width=\textwidth]{salvis-wm-vw-50k}
\caption{{\VW} (green), {\WM} (orange) and original (black dotted) at
1:\numprint{50000}.}
\label{fig:salvis-wm-vw-50k}
\end{figure}
\begin{figure}[h!]
\includegraphics[width=\textwidth]{salvis-wm-vw-chaikin-50k}
\caption{Chaikin--smoothened {\VW} (green), {\WM} (orange) and original
(black dotted) at 1:\numprint{50000}.}
\label{fig:salvis-wm-vw-chaikin-50k}
\end{figure}
\subsection{Testing Results Online} \subsection{Testing Results Online}
\label{sec:testing-results-online} \label{sec:testing-results-online}
@ -1605,7 +1665,7 @@ implementation:
a exaggerated bends that became sharp and includes some future ideas. a exaggerated bends that became sharp and includes some future ideas.
\item What are the exaggeration limits when working with large scales? \item What are the exaggeration limits when working with large scales?
Section~\ref{sec:national-large-scales} discusses examples that some Section~\ref{sec:national-large-scale} discusses examples that some
limits are necessary. limits are necessary.
\item Research when bends should be marked as \textsc{isolated}. As is \item Research when bends should be marked as \textsc{isolated}. As is

View File

@ -125,14 +125,14 @@ declare
geom2 geometry; geom2 geometry;
geom3 geometry; geom3 geometry;
begin begin
foreach i in array array[16, 64, 256] loop foreach i in array array[16, 32, 64, 256] loop
geom1 = st_simplify((select way from wm_visuals where name='salvis'), i); geom1 = st_simplify((select way from wm_visuals where name='salvis'), i);
geom2 = st_simplifyvw((select way from wm_visuals where name='salvis'), i*i); geom2 = st_simplifyvw((select way from wm_visuals where name='salvis'), i*i);
insert into wm_visuals(name, way) values insert into wm_visuals(name, way) values
('salvis-douglas-' || i, geom1), ('salvis-dp-' || i, geom1),
('salvis-douglas-' || i || '-chaikin', st_chaikinsmoothing(geom1, 5)), ('salvis-dp-' || i || '-chaikin', st_chaikinsmoothing(geom1, 5)),
('salvis-visvalingam-' || i, geom2), ('salvis-vw-' || i, geom2),
('salvis-visvalingam-' || i || '-chaikin', st_chaikinsmoothing(geom2, 5)); ('salvis-vw-' || i || '-chaikin', st_chaikinsmoothing(geom2, 5));
end loop; end loop;
-- more than 220 doesn't work, because there is an exaggerated bend near -- more than 220 doesn't work, because there is an exaggerated bend near