From c480c8543eceae2277e2bbbcdebfcc9f8641ad3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Tue, 26 May 2020 16:10:54 +0300 Subject: [PATCH] a5 --- II/Referatas/Makefile | 14 ++++++++------ II/Referatas/layer2img.py | 15 ++------------- II/Referatas/mj-referatas.tex | 5 +++-- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/II/Referatas/Makefile b/II/Referatas/Makefile index ea72b29..baa2141 100644 --- a/II/Referatas/Makefile +++ b/II/Referatas/Makefile @@ -6,30 +6,32 @@ GEN = $(addsuffix .pdf, \ $(addprefix zeimena-douglas-,$(ZEIMENA_TOLERANCES)) \ $(addprefix zeimena-visvalingam-,$(ZEIMENA_TOLERANCES))) -mj-referatas.pdf: mj-referatas.tex version.tex bib.bib zeimena-pretty.pdf \ - sinewave.pdf $(GEN) +mj-referatas.pdf: mj-referatas.tex version.tex bib.bib zeimena.pdf sinewave.pdf $(GEN) latexmk -g -pdf $< define algo2img 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 touch $$@ - $(1)-$(2)-%.pdf: layer2img.py db/.faux_$(1)-$(2)-% ./layer2img.py --table=$(1)_$(2)_$$* --size=$(3) --outfile $(1)-$(2)-$$*.pdf endef +define gpkg2pdf +$(1).pdf: $(1).gpkg + ./layer2img.py --size=$(2) --infile=$(1).gpkg --outfile $(1).pdf +endef + $(eval $(call algo2img,sinewave,douglas,52x12)) $(eval $(call algo2img,sinewave,visvalingam,52x12)) $(eval $(call algo2img,zeimena,douglas,52x74)) $(eval $(call algo2img,zeimena,visvalingam,52x74)) +$(eval $(call gpkg2pdf,sinewave,52x15)) +$(eval $(call gpkg2pdf,zeimena,148x210)) sinewave.gpkg: sinewave.py ./sinewave.py -sinewave.pdf: sinewave.gpkg - ./layer2img.py --size=52x15 --infile=$< --outfile=$@ - db/.faux_ready: zeimena.gpkg sinewave.gpkg managedb -./managedb stop; rm -fr db ./managedb init diff --git a/II/Referatas/layer2img.py b/II/Referatas/layer2img.py index 837c0d9..b536e07 100755 --- a/II/Referatas/layer2img.py +++ b/II/Referatas/layer2img.py @@ -35,17 +35,6 @@ def parse_args(): return parser.parse_args() -#def makebox(t): -# xmin, ymin, xmax, ymax = t -# if xmin > xmax: -# raise Exception("xmin should be > xmax") -# if ymin > ymax: -# raise Exception("ymin should be > ymax") -# left, bottom = xmin, ymin -# width, height = xmax - xmin, ymax - ymin -# return {'left': left, 'bottom': bottom, 'width': width, 'height': height} - - def main(): args = parse_args() if args.table: @@ -57,13 +46,13 @@ def main(): f.plot(figsize=args.size) ax = plt.gca() if args.clip: - ax.set_ylim(bottom=args.clip[1], top=args.clip[3]) ax.set_xlim(left=args.clip[0], right=args.clip[2]) + ax.set_ylim(bottom=args.clip[1], top=args.clip[3]) ax.axis('off') ax.margins(0, 0) plt.tight_layout(0) if args.outfile: - plt.savefig(args.outfile, bbox_inches=0, dpi=300) + plt.savefig(args.outfile, bbox_inches=0, dpi=600) else: plt.show() diff --git a/II/Referatas/mj-referatas.tex b/II/Referatas/mj-referatas.tex index 9241ade..059a9e0 100644 --- a/II/Referatas/mj-referatas.tex +++ b/II/Referatas/mj-referatas.tex @@ -42,6 +42,7 @@ small scale: 1:XXXXXX large scale: 1:XXX a4: 210x297mm +a5: 148x210mm a6: 105x148xmm a7: 74x105mm a8: 52x74mm @@ -152,12 +153,12 @@ algorithms, because the river exhibits both both straight and curved shape, is a combination of two curly rivers, and author's familiarity with the location. Since the map area is large (scale $1:150 000$), we will also review a -zoomed-in subset of the map of scale $1:10 000$. The zoomed-in version will +zoomed-in subset of the map of scale $1:15 000$. The zoomed-in version will help explain some of the deficiencies in the reviewed algorithms. \begin{figure}[H] \centering - \includegraphics[width=148mm]{zeimena-pretty} + \includegraphics[width=148mm]{zeimena} \caption{Lakaja and Žeimena} \label{fig:zeimena} \end{figure}