This commit is contained in:
Motiejus Jakštys 2020-05-27 15:23:54 +03:00
parent 75108e09a9
commit 1eafa0871a
2 changed files with 48 additions and 9 deletions

View File

@ -17,18 +17,24 @@ GEN2 = $(addsuffix .pdf, \
mj-referatas.pdf: mj-referatas.tex version.tex bib.bib zeimena.pdf \ mj-referatas.pdf: mj-referatas.tex version.tex bib.bib zeimena.pdf \
sinewave1.pdf sinewave2.pdf crossing.pdf $(GEN1) $(GEN2) sinewave1.pdf sinewave2.pdf crossing.pdf $(GEN1) $(GEN2)
latexmk -g -pdf $< latexmk -shell-escape -g -pdf $<
define algo2img define algo2img
db/.faux_$(1)-$(2)-%: $(2).sql db/.faux_ready db/.faux_$(1)-$(2)-%: $(2).sql db/.faux_ready
./managedb -- --echo-all -v ON_ERROR_STOP=1 -v src=$(1) -v tolerance=$$* -v tbl=$(1)_$(2)_$$* -f $(2).sql ./managedb -- --echo-all \
-v ON_ERROR_STOP=1 \
-v src=$(1) \
-v tolerance=$$* \
-v tbl=$(1)_$(2)_$$* \
-f $(2).sql
touch $$@ touch $$@
$(1)-$(2)-%.pdf: layer2img.py db/.faux_$(1)-$(2)-% $(1)-$(2)-%.pdf: layer2img.py db/.faux_$(1)-$(2)-%
./layer2img.py --group2-table=$(1)_$(2)_$$* --size=$(3) --outfile $$@ ./layer2img.py --group2-table=$(1)_$(2)_$$* --size=$(3) --outfile $$@
endef endef
define algo2overlay define algo2overlay
overlaid-$(1)-$(2)-%.pdf: layer2img.py db/.faux_$(1)-$(2)-% overlaid-$(1)-$(2)-%.pdf: layer2img.py db/.faux_$(1)-$(2)-%
./layer2img.py $(3) --group1-table=$(1) --group2-table=$(1)_$(2)_$$* --outfile $$@ ./layer2img.py $(3) --group1-table=$(1) --group2-table=$(1)_$(2)_$$* \
--outfile $$@
endef endef
define gpkg2pdf define gpkg2pdf
$(1): $(2) ./layer2img.py $(1): $(2) ./layer2img.py
@ -41,7 +47,8 @@ $(eval $(call algo2img,zeimena,douglas,210x297))
$(eval $(call algo2img,zeimena,visvalingam,210x297)) $(eval $(call algo2img,zeimena,visvalingam,210x297))
$(eval $(call gpkg2pdf,sinewave1.pdf,sinewave1.gpkg,--size=$(SINEWAVE_SIZE))) $(eval $(call gpkg2pdf,sinewave1.pdf,sinewave1.gpkg,--size=$(SINEWAVE_SIZE)))
$(eval $(call gpkg2pdf,sinewave2.pdf,sinewave2.gpkg,--size=$(SINEWAVE_SIZE))) $(eval $(call gpkg2pdf,sinewave2.pdf,sinewave2.gpkg,--size=$(SINEWAVE_SIZE)))
$(eval $(call gpkg2pdf,zeimena.pdf,zeimena.gpkg rectangle.gpkg,--size=134x191 --group2-infile rectangle.gpkg)) $(eval $(call gpkg2pdf,zeimena.pdf,zeimena.gpkg rectangle.gpkg,\
--size=134x191 --group2-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 148x105 --clip $(CROSSING))) $(eval $(call algo2overlay,zeimena,douglas,--size 148x105 --clip $(CROSSING)))
$(eval $(call algo2overlay,zeimena,visvalingam,--size 148x105 --clip $(CROSSING))) $(eval $(call algo2overlay,zeimena,visvalingam,--size 148x105 --clip $(CROSSING)))

View File

@ -23,6 +23,7 @@
\usepackage{tabularx} \usepackage{tabularx}
\usepackage{float} \usepackage{float}
\usepackage{tikz} \usepackage{tikz}
\usepackage{minted}
\usetikzlibrary{er,positioning} \usetikzlibrary{er,positioning}
\input{version} \input{version}
@ -385,18 +386,49 @@ 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 to have a formula mapping {\DP} tolerance to {\VW}. That way, visual
comparisons between line simplification algorithms could be more objective. comparisons between line simplification algorithms could be more objective.
\printbibliography \printbibliography
\iffalse
may enable this before publishing
\begin{appendices} \begin{appendices}
\section{Žeimena and Lakaja in context}
\begin{figure}[H] \begin{figure}[H]
\centering \centering
\includegraphics[width=148mm]{zeimena-pretty} \includegraphics[width=148mm]{zeimena-pretty}
\caption{Lakaja and Žeimena river in context} \caption{Lakaja and Žeimena river in context}
\end{figure} \end{figure}
\end{appendices}
\fi
\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.
\subsection{douglas.sql}
Transforms a layer ({\tt :src}) to {\DP} using $tolerance$ tolerance.
\inputminted[fontsize=\small]{sql}{douglas.sql}
\subsection{visvalingam.sql}
Transforms a layer ({\tt :src}) to {\VW} using $tolerance^2$ tolerance.
\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}
\end{appendices}
\end{document} \end{document}