From 485e7b1512f30bd6651d41a6fdc3327816f188a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sun, 28 Feb 2021 16:52:10 +0200 Subject: [PATCH] Snap to grid --- IV/tests.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/IV/tests.sql b/IV/tests.sql index 0942e1a..877a696 100644 --- a/IV/tests.sql +++ b/IV/tests.sql @@ -12,10 +12,12 @@ end $$ LANGUAGE plpgsql; drop table if exists figures; create table figures (name text, way geometry); +-- to "normalize" a new line: +-- select st_astext(st_snaptogrid(st_transscale(geometry, 80, 130, .3, .3), 1)) from f; insert into figures (name, way) values ('fig3',ST_GeomFromText('LINESTRING(0 0,12 0,13 4,20 2,20 0,32 0,33 10,38 16,43 15,44 10,44 0,60 0)')); insert into figures (name, way) values ('fig3-1',ST_GeomFromText('LINESTRING(0 0,12 0,13 4,20 2,20 0,32 0,33 10,38 16,43 15,44 10,44 0)')); insert into figures (name, way) values ('fig5',ST_GeomFromText('LINESTRING(0 39,19 52,27 77,26 104,41 115,49 115,65 103,65 75,53 45,63 15,91 0)')); -insert into figures (name, way) values ('fig6',ST_GeomFromText('LINESTRING(84 46,91 59,114 63,122 79,116 91,109 93,105 106,117 118,136 107,135 76,120 44,125 38,141 38,146 31)')); +insert into figures (name, way) values ('fig6',ST_GeomFromText('LINESTRING(84 47,91 59,114 64,122 80,116 92,110 93,106 106,117 118,136 107,135 76,120 45,125 39,141 39,147 32)')); insert into figures (name, way) values ('inflection-1',ST_GeomFromText('LINESTRING(110 24,114 20,133 20,145 15,145 0,136 5,123 7,114 7,111 2)')); -- DETECT BENDS