Project

General

Profile

« Previous | Next » 

Revision 7678

schemas/functions.sql: _dms_to_dd(): Fixed bug where need to use 1 as the multiplier when dir is NULL

View differences:

schemas/functions.sql
91 91
CREATE FUNCTION _dms_to_dd(deg double precision DEFAULT NULL::double precision, min double precision DEFAULT NULL::double precision, sec double precision DEFAULT NULL::double precision, dir compass_dir DEFAULT NULL::compass_dir) RETURNS double precision
92 92
    LANGUAGE sql IMMUTABLE
93 93
    AS $_$
94
SELECT sum(value)*functions._map('N=>1,E=>1,S=>-1,W=>-1', $4::text)::integer
94
SELECT sum(value)*COALESCE(functions._map('N=>1,E=>1,S=>-1,W=>-1', $4::text)::integer, 1)
95 95
FROM
96 96
(VALUES
97 97
      ($1)

Also available in: Unified diff