add more river examples

This commit is contained in:
Motiejus Jakštys 2021-04-20 18:21:07 +03:00
parent 6ba9fe9566
commit 250095cdbd
3 changed files with 60 additions and 26 deletions

View File

@ -23,9 +23,9 @@ FIGURES = \
selfcrossing-1-after
RIVERS = \
salvis-gdr10 \
salvis-gdr50 \
salvis-gdr250
salvis-25k \
salvis-50k \
salvis-250k
#################################
# The thesis, publishable version
@ -121,15 +121,17 @@ selfcrossing-1-after_1SELECT = wm_debug where name='selfcrossing-1' AND stage='d
selfcrossing-1-after_2SELECT = wm_debug where name='selfcrossing-1' AND stage='bbends' AND gen=1
selfcrossing-1-after_2LINESTYLE = invisible
salvis-gdr10_1SELECT = wm_rivers where name='Šalčia' OR name='Visinčia'
salvis-gdr10_WMCLIP = salcia-visincia:GDR10
salvis-25k_1SELECT = wm_rivers where name='Šalčia' OR name='Visinčia'
salvis-25k_WMCLIP = salcia-visincia:25k
salvis-25k_WIDTHDIV = 1
salvis-gdr50_1SELECT = wm_rivers where name='Šalčia' OR name='Visinčia'
salvis-gdr50_WMCLIP = salcia-visincia:GDR50
salvis-gdr250_1SELECT = wm_rivers where name='Šalčia' OR name='Visinčia'
salvis-gdr250_WMCLIP = salcia-visincia:GDR250
salvis-50k_WIDTHDIV = 2
salvis-50k_1SELECT = wm_rivers where name='Šalčia' OR name='Visinčia'
salvis-50k_WMCLIP = salcia-visincia:50k
salvis-250k_WIDTHDIV = 10
salvis-250k_1SELECT = wm_rivers where name='Šalčia' OR name='Visinčia'
salvis-250k_WMCLIP = salcia-visincia:250k
.faux_test-rivers: tests-rivers.sql wm.sql .faux_db
./db -f $<

View File

@ -17,9 +17,10 @@ PSQL_CREDS = "host=127.0.0.1 dbname=osm user=osm password=osm"
TEXTWIDTH_CM = 12.12364
SCALES = {
"GDR10": 10000,
"GDR50": 50000,
"GDR250": 250000,
"10k": 10000,
"25k": 25000,
"50k": 50000,
"250k": 250000,
}
def inch(cm):
@ -52,7 +53,7 @@ def parse_args():
parser.add_argument('--wmclip',
type=wm_clip,
help="Clip for scale. E.g. salcia-visincia:GDR10",
help="Clip for scale. E.g. salcia-visincia:10k",
)
parser.add_argument('--widthdiv',
default=1, type=float, help='Width divisor')

View File

@ -85,7 +85,7 @@ Current open-source line generalization solutions have their roots in
NOTICE: this value should be copied to layer2img.py:TEXTWIDTH, so dimensions
of inline images are reasonable.
textwidth in cm: {\printinunitsof{cm}\prntlen{\textwidth}}
Textwidth in cm: {\printinunitsof{cm}\prntlen{\textwidth}}
\fi
When creating small-scale maps, often the detail of the data source is greater
@ -129,7 +129,8 @@ different trade-offs.
\label{sec:literature-review}
A number of cartographic line generalization algorithms have been researched.
The "classical" ones are {\DP} and {\VW}.
The "classical" ones are {\DP} and {\VW} in combination with Chaikin's. There
are also modern ones.
\subsection{Available algorithms}
@ -150,13 +151,43 @@ Both algorithms are part of PostGIS, a free-software GIS suite:
\href{https://postgis.net/docs/ST_SimplifyVW.html}{PostGIS SimplifyVW}.
\end{itemize}
Examples of <TBD Chaikin and others>
It may be worthwhile to post-process those through a widely available Chaikin's
line smoothing algorithm \cite{chaikin1974algorithm} via
\href{https://postgis.net/docs/ST_ChaikinSmoothing.html}{PostGIS
ChaikinSmoothing}.
To use in generalization examples, we will use two rivers: Žeimena and Šalčia
(they flow into one). Figure~\onpage{fig:salvis-25} illustrates the original
two rivers without any processing (yet).
\begin{figure}[h]
\centering
\includegraphics[width=\textwidth]{salvis-25k}
\caption{Example rivers for visual tests (1:25000)}
\label{fig:salvis-25}
\end{figure}
Same rivers, unprocessed, but with higher density (scales 1:50000 and 1:250000)
are depicted in figure~\onpage{fig:salvis-50-250}. Some river features are so
compact that a reasonably thin line depicting them is overlapping with itself.
As can be seen in the article example, generalization is worthy.
\begin{figure}[h]
\centering
\begin{subfigure}[b]{.49\textwidth}
\includegraphics[width=\textwidth]{salvis-50k}
\caption{Example scaled 1:50000}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.49\textwidth}
\centering
\includegraphics[width=.2\textwidth]{salvis-250k}
\caption{Example scaled 1:250000}
\end{subfigure}
\caption{Down-scaled original river (1:50000 and 1:250000)}
\label{fig:salvis-50-250}
\end{figure}
\subsubsection{Modern approaches}
@ -359,12 +390,12 @@ when a single vertex is moved outwards the end of the bend.
\begin{figure}[h]
\centering
\begin{subfigure}[b]{.45\textwidth}
\begin{subfigure}[b]{.49\textwidth}
\includegraphics[width=\textwidth]{fig5-gentle-inflection-before}
\caption{Before applying the inflection rule}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.45\textwidth}
\begin{subfigure}[b]{.49\textwidth}
\includegraphics[width=\textwidth]{fig5-gentle-inflection-after}
\caption{After applying the inflection rule}
\end{subfigure}
@ -386,12 +417,12 @@ vertices to the next bend instead of one.
\begin{figure}[h]
\centering
\begin{subfigure}[b]{.45\textwidth}
\begin{subfigure}[b]{.49\textwidth}
\includegraphics[width=\textwidth]{inflection-1-gentle-inflection-before}
\caption{Before applying the inflection rule}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.45\textwidth}
\begin{subfigure}[b]{.49\textwidth}
\includegraphics[width=\textwidth]{inflection-1-gentle-inflection-after}
\caption{After applying the inflection rule}
\end{subfigure}
@ -427,12 +458,12 @@ following the rules of the article.
\begin{figure}[h]
\centering
\begin{subfigure}[b]{.45\textwidth}
\begin{subfigure}[b]{.49\textwidth}
\includegraphics[width=\textwidth]{fig6-selfcrossing-before}
\caption{Bend's baseline (dotted) is crossing a neighboring bend}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.45\textwidth}
\begin{subfigure}[b]{.49\textwidth}
\includegraphics[width=\textwidth]{fig6-selfcrossing-after}
\caption{Self-crossing removed following the algorithm}
\end{subfigure}
@ -447,12 +478,12 @@ figure~\onpage{fig:selfcrossing-1-non-neighbor}.
\begin{figure}[h]
\centering
\begin{subfigure}[b]{.45\textwidth}
\begin{subfigure}[b]{.49\textwidth}
\includegraphics[width=\textwidth]{selfcrossing-1-before}
\caption{Bend's baseline (dotted) is crossing a non-neighboring bend}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.45\textwidth}
\begin{subfigure}[b]{.49\textwidth}
\includegraphics[width=\textwidth]{selfcrossing-1-after}
\caption{Self-crossing removed following the algorithm}
\end{subfigure}