qwat / qwat-data-model

TEKSI Water module (project QWAT) - PostgreSQL / postgis Datamodel
https://www.teksi.ch
23 stars 24 forks source link

Valve nominal diameter #305

Closed lbartoletti closed 4 years ago

lbartoletti commented 4 years ago

I'm facing an issue on diameter_nominal from qwat_od.valve

This column is a varchar(10) type without foreign key. For me, it's ambiguous and the demonstration data confirm my doubt about that [1]

With this liberty of input, you can enter: DN, NPS, inside/outside size, etc.

For me, it should be only the size from the ISO 6708 (DN 50, DN 100, etc). So an integer type (millimeter value).

What is your practice and convention? @ponceta @kandre @tudorbarascu

[1]

SELECT DISTINCT diameter_nominal
FROM qwat_od.valve

returns

90/63
80
1 1/4''
125
2500
200/63
160-63
50
1 1/4"
160/63
63
250
1/2''
200
65
32
1"
70
1.5"
120
200/2"
3/4"
60
40
90
1,25"
1,25
150
1 1/2"
300
180
1,5"
100
250/2"
2"
125/63
2''
1.25"
63/63
tudorbarascu commented 4 years ago

@lbartoletti Well.. In production for small valves (on water laterals mostly), the engineers use notations like"1.5" At least in Romania and some other countries, (I think Switzerland too).

tudorbarascu commented 4 years ago

The nice integer diameters are only used for bigger valves

lbartoletti commented 4 years ago

@tudorbarascu Yes, it's the same problem here. DN is really used for bigger valves and we use NPS - and sometimes interior/exterior dimensions - for medium/small valves...

Whatever the practice, I wonder if it is not necessary to rationalize the base by proposing a foreign key on an equivalence table, something like this

tudorbarascu commented 4 years ago

That would be a + for sure..

ponceta commented 4 years ago

+1 for me

haubourg commented 4 years ago

+1 too !