qwat / qwat-data-model

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

How are handled generic values' ID for elements defined in value lists? #319

Open nicolas-sitylb opened 4 years ago

nicolas-sitylb commented 4 years ago

Hi,

I am not able to figure out any rigorous systematism in the definition of the ID of elements in the value lists definitions in qwat.

For example; here is the list of the pipe material values in qwat_vl.pipe_material where code_sire=6:

image

From this table, I can decide to use the pipe with ID=5700 as "a generic PVC pipe" (i.e. having the strict minimal set of data, with no diameter(s) specified) to quickly import SIRE data into the qwat model.

But for some other pipes, there is no such equivalent "generic pipe", e.g. PE 100 pipes with a code_sire=7:

image


An idea could be to set the qwat ID to xyyy with x=code_sire and yyy=000 for a "generic pipe", and then, for all specific pipes, using yyy=001 to 999.

For example, when code_sire=6, the pipe with ID=6000 would be the generic PVC pipe with the minimal set of data (i.e. only the material definition) and pipes 6001to 6999would be well defined pipes (with specific diameters and so on).