From 28b6752e0a0e2ea2fd53bfaf79bd49d9e586f133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 27 May 2020 12:01:03 +0300 Subject: [PATCH] crossing with overlays --- II/Referatas/Makefile | 24 +++++++++++++++++------- II/Referatas/mj-referatas.tex | 28 ++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/II/Referatas/Makefile b/II/Referatas/Makefile index dd5e181..65aed88 100644 --- a/II/Referatas/Makefile +++ b/II/Referatas/Makefile @@ -1,14 +1,19 @@ CROSSING=622916 6109267 626066 6111487 # xmin ymin xmax ymax ZEIMENA_TOLERANCES = 100 125 250 500 1000 2000 4000 SINEWAVE_TOLERANCES = 1 20 30 40 -GEN = $(addsuffix .pdf, \ +CROSSING_TOLERANCES = 125 250 500 +GEN1 = $(addsuffix .pdf, \ $(addprefix sinewave-douglas-,$(SINEWAVE_TOLERANCES)) \ $(addprefix sinewave-visvalingam-,$(SINEWAVE_TOLERANCES)) \ $(addprefix zeimena-douglas-,$(ZEIMENA_TOLERANCES)) \ $(addprefix zeimena-visvalingam-,$(ZEIMENA_TOLERANCES))) +GEN2 = $(addsuffix .pdf, \ + $(addprefix crossing-zeimena-douglas-,$(CROSSING_TOLERANCES)) \ + $(addprefix crossing-zeimena-visvalingam-,$(CROSSING_TOLERANCES))) + mj-referatas.pdf: mj-referatas.tex version.tex bib.bib zeimena.pdf \ - sinewave.pdf crossing.pdf $(GEN) + sinewave.pdf crossing.pdf $(GEN1) $(GEN2) latexmk -g -pdf $< define algo2img @@ -17,8 +22,11 @@ db/.faux_$(1)-$(2)-%: $(2).sql db/.faux_ready touch $$@ $(1)-$(2)-%.pdf: layer2img.py db/.faux_$(1)-$(2)-% ./layer2img.py --table=$(1)_$(2)_$$* --size=$(3) --outfile $$@ +endef + +define algo2overlay crossing-$(1)-$(2)-%.pdf: layer2img.py db/.faux_$(1)-$(2)-% - ./layer2img.py --clip $(CROSSING) --table=$(1)_$(2)_$$* --size=$(3) --outfile $$@ + ./layer2img.py $(3) --table=$(1)_$(2)_$$* --overlay-table=$(1) --outfile $$@ endef define gpkg2pdf @@ -26,13 +34,15 @@ $(1): $(2) ./layer2img.py ./layer2img.py $(3) --infile=$$< --outfile $(1) endef -$(eval $(call algo2img,sinewave,douglas,30x12)) -$(eval $(call algo2img,sinewave,visvalingam,30x12)) -$(eval $(call algo2img,zeimena,douglas,52x74)) -$(eval $(call algo2img,zeimena,visvalingam,52x74)) +$(eval $(call algo2img,sinewave,douglas,60x24)) +$(eval $(call algo2img,sinewave,visvalingam,60x24)) +$(eval $(call algo2img,zeimena,douglas,210x297)) +$(eval $(call algo2img,zeimena,visvalingam,210x297)) $(eval $(call gpkg2pdf,sinewave.pdf,sinewave.gpkg,,--size=52x12)) $(eval $(call gpkg2pdf,zeimena.pdf,zeimena.gpkg rectangle.gpkg,--size=67x95 --overlay-infile rectangle.gpkg)) $(eval $(call gpkg2pdf,crossing.pdf,zeimena.gpkg,--size=105x74 --clip $(CROSSING))) +$(eval $(call algo2overlay,zeimena,douglas,--size 297x210 --clip $(CROSSING))) +$(eval $(call algo2overlay,zeimena,visvalingam,--size 297x210 --clip $(CROSSING))) sinewave.gpkg: fig2layer.py ./fig2layer.py -o $@ sine diff --git a/II/Referatas/mj-referatas.tex b/II/Referatas/mj-referatas.tex index 3943427..8a3e7af 100644 --- a/II/Referatas/mj-referatas.tex +++ b/II/Referatas/mj-referatas.tex @@ -235,6 +235,34 @@ bends on the original map should be retained. \label{tab:comparison-zeimena} \end{figure} +Let's zoom in to the river crossing area for some of the algorithms. + + +\begin{figure}[h] + \renewcommand{\tabularxcolumn}[1]{>{\center\small}m{#1}} + \begin{tabularx}{\textwidth}{ p{1.5cm} | X | X | } + Tolerance DP/VW & + Douglas \& Peucker & + Visvalingam-Whyatt \tabularnewline \hline + + 125/15625 & + \includegraphics[width=\linewidth]{crossing-zeimena-douglas-125} & + \includegraphics[width=\linewidth]{crossing-zeimena-visvalingam-125} \tabularnewline \hline + + 250/62500 & + \includegraphics[width=.5\linewidth]{crossing-zeimena-douglas-250} & + \includegraphics[width=.5\linewidth]{crossing-zeimena-visvalingam-250} \tabularnewline \hline + + 500/250000 & + \includegraphics[width=.25\linewidth]{crossing-zeimena-douglas-500} & + \includegraphics[width=.25\linewidth]{crossing-zeimena-visvalingam-500} \tabularnewline \hline + \end{tabularx} + \caption{{\DP} and {\VW} on river crossing area} + \label{tab:comparison-zoomed} +\end{figure} + + + To sum up, both {\VW} and {\DP} simplify the lines, but their cartographic output poorly represents lines and bends. Where to look for better output?