3 -- OBS! Må fjernes når jeg er ferdig med å teste og opprenskinga er gjort.
5 \echo ================ Slett skrotpunkter. ================
7 DELETE FROM logg WHERE coor[0] < 51;
8 DELETE FROM logg WHERE coor[0] > 71;
9 DELETE FROM logg WHERE coor[1] < -2;
10 DELETE FROM logg WHERE coor[1] > 26;
11 DELETE FROM logg WHERE date < '2002-01-01';
12 DELETE FROM logg WHERE date > '2010-01-01';
13 DELETE FROM logg WHERE date BETWEEN '2005-09-24' AND '2006-02-08';
14 DELETE FROM logg WHERE date BETWEEN '2003-02-15 17:58:26Z' AND '2003-02-15 17:59:37Z';
15 DELETE FROM logg WHERE date BETWEEN '2003-07-15 16:06:58Z' AND '2003-07-15 16:08:05Z';
16 DELETE FROM logg WHERE date = '2002-12-10 01:25:28Z';
17 DELETE FROM logg WHERE date = '2002-10-06 22:41:10Z';
18 DELETE FROM logg WHERE date = '2006-02-12 03:33:15Z';
19 DELETE FROM logg WHERE date = '2006-02-19 14:15:07Z';
20 DELETE FROM logg WHERE ele = -1500;
23 \echo ================ Slett høyder som er på trynet ================
25 UPDATE logg SET ele = NULL WHERE ele < -1500;
26 UPDATE logg SET ele = NULL WHERE ele > 29000;
29 \echo ================ Rund av veipunkter til seks desimaler ================
31 UPDATE wayp SET coor = point(
32 round(coor[0]::numeric, 6),
33 round(coor[1]::numeric, 6)
37 \echo ================ Fjern duplikater i wayp ================
40 AS "Antall i wayp før rensking"
43 BEGIN ISOLATION LEVEL SERIALIZABLE;
44 CREATE TEMPORARY TABLE dupfri
70 AS "Antall i wayp etter rensking"
74 \echo ================ Fjern duplikater i events ================
77 AS "Antall i events før rensking"
80 BEGIN ISOLATION LEVEL SERIALIZABLE;
81 CREATE TEMPORARY TABLE dupfri
85 DISTINCT ON (date, coor[0], coor[1], descr) *
97 AS "Antall i events etter rensking"
101 \echo ================ Oppdater koordinater for bilder ================
103 UPDATE pictures SET coor = findpos(date)
106 \echo ================ Rund av bildekoordinater ================
107 UPDATE pictures SET coor = point(
108 round(coor[0]::numeric, 6),
109 round(coor[1]::numeric, 6)
113 \echo ================ Fjern duplikater i pictures ================
116 AS "Antall i pictures før rensking"
119 BEGIN ISOLATION LEVEL SERIALIZABLE;
120 CREATE TEMPORARY TABLE dupfri
124 DISTINCT ON (date, coor[0], coor[1], descr, filename, author) *
128 INSERT INTO pictures (
136 AS "Antall i pictures etter rensking"