QGEP / qgepqwat2ili

3 stars 3 forks source link

Error upon import III #124

Closed meierrom closed 1 year ago

meierrom commented 1 year ago

Hi folks,

I'm getting the following error message upon issuing an import command:

python -m qgepqwat2ili qgep import data/heit/heitsia405export_20230505.xtf --log

[...] INFO Importing ABWASSER.datei, ABWASSER.metaattribute -> QGEP.file INFO done [...] psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "in_od_wastewater_networkelement_identifier" DETAIL: Key (identifier, fk_dataowner)=(1605, 00000000OG000000) already exists. [...] sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "in_od_wastewater_networkelement_identifier" DETAIL: Key (identifier, fk_dataowner)=(1605, 00000000OG000000) already exists. [SQL: UPDATE qgep_od.wastewater_networkelement SET fk_dataowner=%(fk_dataowner)s, fk_provider=%(fk_provider)s WHERE qgep_od.wastewater_networkelement.obj_id = %(qgep_od_wastewater_networkelement_obj_id)s] [parameters: ({'fk_dataowner': '00000000OG000000', 'fk_provider': '00000000OG000000', 'qgep_od_wastewater_networkelement_obj_id': '00000000WE000000'}, {'fk_dataowner': '00000000OG000000', 'fk_provider': '00000000OG000000', 'qgep_od_wastewater_networkelement_obj_id': '00000000WE000001'}, {'fk_dataowner': '00000000OG000000', 'fk_provider': '00000000OG000000', 'qgep_od_wastewater_networkelement_obj_id': '00000000WE000002'}, {'fk_dataowner': '00000000OG000000', 'fk_provider': '00000000OG000000', 'qgep_od_wastewater_networkelement_obj_id': '00000000WE000003'}, {'fk_dataowner': '00000000OG000000', 'fk_provider': '00000000OG000000', 'qgep_od_wastewater_networkelement_obj_id': '00000000WE000004'}, {'fk_dataowner': '00000000OG000000', 'fk_provider': '00000000OG000000', 'qgep_od_wastewater_networkelement_obj_id': '00000000WE000005'}, {'fk_dataowner': '00000000OG000000', 'fk_provider': '00000000OG000000', 'qgep_od_wastewater_networkelement_obj_id': '00000000WE000006'}, {'fk_dataowner': '00000000OG000000', 'fk_provider': '00000000OG000000', 'qgep_od_wastewater_networkelement_obj_id': '00000000WE000007'} ... displaying 10 of 4285 total bound parameter sets ... {'fk_dataowner': '00000000OG000000', 'fk_provider': '00000000OG000000', 'qgep_od_wastewater_networkelement_obj_id': '00000000WE004283'}, {'fk_dataowner': '00000000OG000000', 'fk_provider': '00000000OG000000', 'qgep_od_wastewater_networkelement_obj_id': '00000000WE004284'})] [...]

Any ideas what's going wrong?

Kind regards, Roman

meierrom commented 1 year ago

Well, I'll answer that one myself. ;)

It turned out to be an issue with table "metaattribute". I deleted a few records manually in "netzwerkelement" and "haltungspunkt". Hence table "metaattribute" also needed some cleanup.