crossing with overlays

This commit is contained in:
Motiejus Jakštys 2020-05-27 12:01:03 +03:00
parent 0367e7f548
commit 28b6752e0a
2 changed files with 45 additions and 7 deletions

View File

@ -1,14 +1,19 @@
CROSSING=622916 6109267 626066 6111487 # xmin ymin xmax ymax CROSSING=622916 6109267 626066 6111487 # xmin ymin xmax ymax
ZEIMENA_TOLERANCES = 100 125 250 500 1000 2000 4000 ZEIMENA_TOLERANCES = 100 125 250 500 1000 2000 4000
SINEWAVE_TOLERANCES = 1 20 30 40 SINEWAVE_TOLERANCES = 1 20 30 40
GEN = $(addsuffix .pdf, \ CROSSING_TOLERANCES = 125 250 500
GEN1 = $(addsuffix .pdf, \
$(addprefix sinewave-douglas-,$(SINEWAVE_TOLERANCES)) \ $(addprefix sinewave-douglas-,$(SINEWAVE_TOLERANCES)) \
$(addprefix sinewave-visvalingam-,$(SINEWAVE_TOLERANCES)) \ $(addprefix sinewave-visvalingam-,$(SINEWAVE_TOLERANCES)) \
$(addprefix zeimena-douglas-,$(ZEIMENA_TOLERANCES)) \ $(addprefix zeimena-douglas-,$(ZEIMENA_TOLERANCES)) \
$(addprefix zeimena-visvalingam-,$(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 \ 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 $< latexmk -g -pdf $<
define algo2img define algo2img
@ -17,8 +22,11 @@ db/.faux_$(1)-$(2)-%: $(2).sql db/.faux_ready
touch $$@ touch $$@
$(1)-$(2)-%.pdf: layer2img.py db/.faux_$(1)-$(2)-% $(1)-$(2)-%.pdf: layer2img.py db/.faux_$(1)-$(2)-%
./layer2img.py --table=$(1)_$(2)_$$* --size=$(3) --outfile $$@ ./layer2img.py --table=$(1)_$(2)_$$* --size=$(3) --outfile $$@
endef
define algo2overlay
crossing-$(1)-$(2)-%.pdf: layer2img.py db/.faux_$(1)-$(2)-% 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 endef
define gpkg2pdf define gpkg2pdf
@ -26,13 +34,15 @@ $(1): $(2) ./layer2img.py
./layer2img.py $(3) --infile=$$< --outfile $(1) ./layer2img.py $(3) --infile=$$< --outfile $(1)
endef endef
$(eval $(call algo2img,sinewave,douglas,30x12)) $(eval $(call algo2img,sinewave,douglas,60x24))
$(eval $(call algo2img,sinewave,visvalingam,30x12)) $(eval $(call algo2img,sinewave,visvalingam,60x24))
$(eval $(call algo2img,zeimena,douglas,52x74)) $(eval $(call algo2img,zeimena,douglas,210x297))
$(eval $(call algo2img,zeimena,visvalingam,52x74)) $(eval $(call algo2img,zeimena,visvalingam,210x297))
$(eval $(call gpkg2pdf,sinewave.pdf,sinewave.gpkg,,--size=52x12)) $(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,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 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 sinewave.gpkg: fig2layer.py
./fig2layer.py -o $@ sine ./fig2layer.py -o $@ sine

View File

@ -235,6 +235,34 @@ bends on the original map should be retained.
\label{tab:comparison-zeimena} \label{tab:comparison-zeimena}
\end{figure} \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 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? output poorly represents lines and bends. Where to look for better output?