From cf726386084b1e97503cfb153ad6987f6f8dedab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sun, 18 Apr 2021 23:31:33 +0300 Subject: [PATCH] bugfix with scales --- IV/Makefile | 7 ++++++- IV/layer2img.py | 3 +-- IV/tests-rivers.sql | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/IV/Makefile b/IV/Makefile index cbdbc70..d951e6d 100644 --- a/IV/Makefile +++ b/IV/Makefile @@ -24,7 +24,8 @@ FIGURES = \ RIVERS = \ salvis-gdr10 \ - salvis-gdr50 + salvis-gdr50 \ + salvis-gdr250 # paper sizes in mm A4p = 210x297 @@ -141,6 +142,10 @@ salvis-gdr10_WMCLIP = salcia-visincia:GDR10 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 + + .faux_test-rivers: tests-rivers.sql wm.sql .faux_db ./db -f $< diff --git a/IV/layer2img.py b/IV/layer2img.py index 9dcf050..51e751e 100644 --- a/IV/layer2img.py +++ b/IV/layer2img.py @@ -75,7 +75,6 @@ def read_layer(select, width_in, maybe_wmclip): ) conn = psycopg2.connect(PSQL_CREDS) sql = "SELECT {way} as way1 FROM {select}".format(way=way, select=select) - print("sql: %s" % sql) return geopandas.read_postgis(sql, con=conn, geom_col='way1') @@ -103,7 +102,7 @@ def main(): rc('text', usetex=True) fig, ax = plt.subplots() - #fig.set_figwidth(width) + fig.set_figwidth(width) group1 is not None and group1.plot(ax=ax, **c1) group2 is not None and group2.plot(ax=ax, **c2) diff --git a/IV/tests-rivers.sql b/IV/tests-rivers.sql index bdbeb61..892e29f 100644 --- a/IV/tests-rivers.sql +++ b/IV/tests-rivers.sql @@ -28,7 +28,7 @@ declare halfX float; halfY float; begin - halfX = projection_scale * projection_width_cm / 2; + halfX = projection_scale * projection_width_cm / 2 / 100; halfY = halfX * sqrt(2); select way from wm_visuals where name=center into gcenter; if gcenter is null then