Revision 7702
Added by Aaron Marcuse-Kubitza over 11 years ago
functions.sql | ||
---|---|---|
96 | 96 |
( |
97 | 97 |
SELECT regexp_matches($1, '^ *(-?)(\d{1,3}(?:\.\d*)?)(?:(?:deg|[°º])(?: *([\d.]+)(?:min|[''’]))?(?: *([\d.]+)(?:sec|["”]))?)? *([NESW])? *$') |
98 | 98 |
UNION ALL |
99 |
SELECT regexp_matches($1, '^ *(-?)(\d{2,3})(\d{2})(\d{3}) *([NESW])? *$') |
|
99 |
SELECT ARRAY[g[1], g[2], g[3]||'.'||g[4], NULL, g[5]] |
|
100 |
FROM regexp_matches($1, '^ *(-?)(\d{2,3})(\d{2})(\d{3}) *([NESW])? *$') matches (g) -- [D]DDMMmmm, where MMmmm = MM.mmm |
|
100 | 101 |
) |
101 | 102 |
matches (g) |
102 | 103 |
$_$; |
Also available in: Unified diff
schemas/functions.sql: _dms_to_dd(text): Corrected concatenated form to interpret last 5 digits as MMmmm = MM.mmm instead of MMSSS, per Tom Wendt's explanation that this form is "degrees/minutes/decimalminutes"