FLO-2DSoftware / qgis-flo-2d-plugin

A plugin for pre-processing/post-processing FLO-2D models
6 stars 7 forks source link

Auto Port Geopackage Error List #1113

Closed FLO-2DKaren closed 5 months ago

FLO-2DKaren commented 8 months ago

2023-12-11T22:05:29 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.OperationalError: near ")": syntax error

2023-12-11T22:05:36 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.IntegrityError: UNIQUE constraint failed: infil_cells_green.fid

2023-12-11T22:05:36 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.OperationalError: near ")": syntax error

2023-12-11T22:05:37 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.OperationalError: near ")": syntax error

2023-12-11T22:05:37 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.OperationalError: near ")": syntax error

2023-12-11T22:05:37 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.OperationalError: near ")": syntax error

2023-12-11T22:05:37 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.OperationalError: near ")": syntax error

2023-12-11T22:05:37 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.OperationalError: near ")": syntax error

2023-12-11T22:05:37 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.OperationalError: near ")": syntax error

2023-12-11T22:05:37 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.OperationalError: near ")": syntax error

2023-12-11T22:05:37 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.OperationalError: near ")": syntax error

2023-12-11T22:05:37 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.OperationalError: near ")": syntax error

2023-12-11T22:05:37 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.OperationalError: near ")": syntax error

2023-12-11T22:05:37 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.OperationalError: near ")": syntax error

2023-12-11T22:05:37 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.OperationalError: near ")": syntax error

2023-12-11T22:05:37 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.OperationalError: near ")": syntax error

2023-12-11T22:05:37 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.IntegrityError: UNIQUE constraint failed: user_chan_n.fid

2023-12-11T22:05:37 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.IntegrityError: UNIQUE constraint failed: all_schem_bc.fid

2023-12-11T22:05:37 INFO Traceback (most recent call last): File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 356, in copy_from_other self.execute(qry) File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\flo2d\geopackage_utils.py", line 410, in execute result_cursor = cursor.execute(statement) sqlite3.OperationalError: near ")": syntax error

FLO-2DKaren commented 8 months ago

I got these errors when I used autoport on this project. https://flo-2d.sharefile.com/d-sd8b394f6cf604c8e98a05fae537ffd37

FLO-2DKaren commented 8 months ago

The errors were on the FLO-2D message log.

rpachaly commented 8 months ago

@FLO-2DKaren

I've pushed a branch called plugin_organization_3. I believe the issues are fixed. It took me a while because I had to figure out the projection issue. We need to discuss this. The PROJ cannot be our standard method of setting the crs.

rpachaly commented 8 months ago

I almost forgot. I created a script to quickly compare two databases:

import sqlite3

conn1 = sqlite3.connect(r"D:\FLO-2D\FLO-2D Plugin\_PLUGIN ORGANIZATION\geoport\test_gpkg\Subdomain 3 SD.gpkg")
conn2 =sqlite3.connect(r"D:\FLO-2D\FLO-2D Plugin\_PLUGIN ORGANIZATION\geoport\test_gpkg\Subdomain 3 SD_v1.0.0.gpkg")

# Step 1: Compare Schema (Tables and Columns)
tables1 = [table[0] for table in conn1.execute("SELECT name FROM sqlite_master WHERE type='table';").fetchall()]
tables2 = [table[0] for table in conn2.execute("SELECT name FROM sqlite_master WHERE type='table';").fetchall()]

if set(tables1) == set(tables2):
    print("Schema (Tables) matches.")
else:
    print("Schema (Tables) does not match.")

# Step 2: Compare Data (Geometry and Attributes)
for table in tables1:
    # Check if the table exists in the second database
    if table in tables2:
        data1 = conn1.execute(f"SELECT * FROM {table};").fetchall()
        data2 = conn2.execute(f"SELECT * FROM {table};").fetchall()

        # Compare data or perform other operations
        if set(data1) == set(data2):
            pass
        else:
            print(f"Data in table {table} is different.")
    else:
        print(f"Table {table} does not exist in the second database.")
FLO-2DKaren commented 5 months ago

This seems good. I was able to get the script to work. Log error messages all gone Table comparison OK

https://github.com/FLO-2DSoftware/qgis-flo-2d-plugin/assets/20424460/9dca7232-df4b-4c62-9d39-9d73c4f6549d