Commit 947da2dd authored by Alice Salsé's avatar Alice Salsé
Browse files

set parameter tolerance

parent 0c79eb9c
......@@ -3,7 +3,7 @@
set search_path to :schemaname, public;
-->> DEFINITION DE LA TOLERANCE TOPOLOGIQUE
-->> DEFINITION DE LA TOLERANCE TOPOLOGIQUE PAR DEFAUT
CREATE TABLE IF NOT EXISTS config.tolerance (
type varchar(15) PRIMARY KEY,
distance float
......@@ -14,9 +14,11 @@ INSERT INTO config.tolerance VALUES('topo', 0.01)
INSERT INTO config.tolerance VALUES('spike', 0.05)
ON CONFLICT DO NOTHING;
--LA TOLERANCE TOPO peut également être forcée en paramètre : SET configtolerance.topo TO 0.04;
CREATE OR REPLACE FUNCTION config.get_tolerance(i_type varchar(15))
RETURNS double precision AS
$$SELECT distance FROM config.tolerance WHERE type = i_type
RETURNS double precision AS $$
SELECT coalesce(nullif(current_setting('configtolerance.'||i_type, true),'')::float, distance)
FROM config.tolerance WHERE type = i_type
$$ LANGUAGE sql IMMUTABLE;
CREATE TABLE IF NOT EXISTS pipe_default_node (
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment