Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
BMG PUBLIC RESOURCES
SIG-TOPO-BMG
Commits
947da2dd
Commit
947da2dd
authored
Dec 15, 2020
by
Alice Salsé
Browse files
❇
set parameter tolerance
parent
0c79eb9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
sql/network/create_table.sql
View file @
947da2dd
...
...
@@ -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
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment