gpsfold: Remove $Id$ at EOF.
[gpstools.git] / branches / gpst.gpsman-format / Patch / hvor.patch
blob0f6df872e8dfc17fc6c9bc77fa173cca5a548014
1 Index: postgres/create_funcs.sql
2 ===================================================================
3 --- postgres/create_funcs.sql (revisjon 2238)
4 +++ postgres/create_funcs.sql (arbeidskopi)
5 @@ -120,6 +120,25 @@
6 END;
7 $$ LANGUAGE plpgsql;
9 +DROP FUNCTION hvor(timestamptz);
10 +CREATE OR REPLACE FUNCTION hvor(currtime timestamptz) RETURNS SETOF timestamptz AS $$
11 +DECLARE
12 + currpos point;
13 + currsted text;
14 + currdist numeric;
15 + currlat numeric(9, 6);
16 + currlon numeric(9, 6);
17 +BEGIN
18 + currpos = findpos(currtime);
19 + currlat = currpos[0];
20 + currlon = currpos[1];
21 + currsted = clname(currpos);
22 + currdist = cldist(currpos);
23 + SELECT currtime, currlat::text, currlon::text, currsted, currdist;
24 + RETURN;
25 +END;
26 +$$ LANGUAGE plpgsql;
28 DROP FUNCTION wherepos(timestamptz);
29 CREATE OR REPLACE FUNCTION wherepos(currtime timestamptz) RETURNS text AS $$
30 DECLARE