* /trunk/src/gpstools/poisync
[gpstools.git] / Patch / events+func.patch
blobe8718f84509ff84dcca39484f6c07d3fa6993fba
1 Index: postgres/create_funcs.sql
2 ===================================================================
3 --- postgres/create_funcs.sql (revisjon 2218)
4 +++ postgres/create_funcs.sql (arbeidskopi)
5 @@ -124,7 +124,8 @@
6 currlon = currpos[1];
7 currsted = clname(currpos);
8 currdist = cldist(currpos);
9 - RETURN(currtime || ' - ' || currlat::text || ' ' || currlon::text || ' - ' || currsted || ' - ' || currdist);
10 + RAISE NOTICE 'time = %, lat = %, lon = %, sted = %, dist = %', currtime::text, currlat::text, currlon::text, currsted::text, currdist::text;
11 + RETURN(currtime::text || ' - ' || currlat::text || ' ' || currlon::text || ' - ' || currsted::text || ' - ' || currdist::text);
12 END;
13 $$ LANGUAGE plpgsql;
15 Index: postgres/update_things.sql
16 ===================================================================
17 --- postgres/update_things.sql (revisjon 2218)
18 +++ postgres/update_things.sql (arbeidskopi)
19 @@ -71,6 +71,20 @@
20 FROM wayp;
22 \echo
23 +\echo ================ Oppdater koordinater for events ================
25 +UPDATE events SET coor = findpos(date)
26 + WHERE coor IS NULL;
28 +\echo
29 +\echo ================ Rund av events til fem desimaler ================
31 +UPDATE events SET coor = point(
32 + round(coor[0]::numeric, 5),
33 + round(coor[1]::numeric, 5)
34 +);
36 +\echo
37 \echo ================ Fjern duplikater i events ================
39 SELECT count(*)