QGEP / qgepqwat2ili

3 stars 3 forks source link

INTERLIS-Export: dataowner and provider are not implemented #113

Open urskaufmann opened 1 year ago

urskaufmann commented 1 year ago

Describe the bug Datenherr and Datenlieferant are exported always as unknown, also when there are values in this fields.

This is not a bug (it's documentated in the code), but the correct values are not implemented.

sjib commented 1 year ago

See https://github.com/QGEP/qgepqwat2ili/issues/36 for more background and considerations

sjib commented 1 year ago

Needs adaption here: datenherr=getattr(row.fk_dataowner__REL, "name", "unknown"), # TODO : is unknown ok ? datenlieferant=getattr(row.fk_provider__REL, "name", "unknown"), # TODO : is unknown ok ?

See https://github.com/QGEP/qgepqwat2ili/blob/df62333539ec7197becb1ad0f604a35f29c8b98b/qgepqwat2ili/qgep/export.py#L96

Suggested Change Options: a) Change "name" to "identifier" as there is no column "name" in qgep datamodel in class organisation to get the identifier in case there is no fk_ set b) It should only set 'unknown' if there is no fkprovider set. Just add 'unknown' if there is no fk set (becaus if NULL then we get an error in the INTERLIS file) and else leave the foreignkey value

sjib commented 1 year ago

With identifier instead of name: datenherr=getattr(row.fk_dataowner__REL, "identifier", "unknown"), # TODO : is unknown ok ? datenlieferant=getattr(row.fk_provider__REL, "identifier", "unknown"), # TODO : is unknown ok ?

20230331_datenherr_datenlieferant_identifier_instead_name

sjib commented 1 year ago

With obj_id instead of name: datenherr=getattr(row.fk_dataowner__REL, "obj_id", "unknown"), # TODO : is unknown ok ? datenlieferant=getattr(row.fk_provider__REL, "obj_id", "unknown"), # TODO : is unknown ok ?

20230331_datenherr_datenlieferant_obj_id_instead_name

sjib commented 1 year ago

Please vote with thumb which of the two option should be implemented.

sjib commented 5 months ago

Should be correct now with obj:

https://github.com/QGEP/qgepqwat2ili/blob/2455a6a71da44ea58e2a98b421dc35db9e657830/qgepqwat2ili/qgep/export.py#L123

https://github.com/QGEP/qgepqwat2ili/blob/2455a6a71da44ea58e2a98b421dc35db9e657830/qgepqwat2ili/qgepdss/export.py#L128

https://github.com/QGEP/qgepqwat2ili/blob/2455a6a71da44ea58e2a98b421dc35db9e657830/qgepqwat2ili/qgepsia405/export.py#L121

@urskaufmann Please check and confirm, then this can be closed.