claeis / ili2db

interlis import/export to relational databases
30 stars 30 forks source link

ili2gpkg option `--gpkgMultiGeomPerTable` needed on export/import/validate #542

Closed signedav closed 3 months ago

signedav commented 6 months ago

On schema import we can pass option --gpkgMultiGeomPerTable to support multiple geometry columns per table in GeoPackage. This works.

But on export, when we don't pass option --gpkgMultiGeomPerTable it encounters an error.

When we pass the option it works fine.

Still, the option should not be needed in export / import / validate, since there are no other info needed how the schema is created.

KbS_V1_5

Error: failed to query KbS_V1_5.Belastete_Standorte.Belasteter_Standort
Error:   [SQLITE_ERROR] SQL error or missing database (no such table: belasteter_standort_geo_lage_punkt) 

Testmodel

INTERLIS 2.3;

MODEL MultiGeom (en) 
AT "http://modelbaker.ch"
VERSION "2020-06-22" =

    IMPORTS GeometryCHLV95_V1;

    DOMAIN
      Line = POLYLINE WITH (STRAIGHTS) VERTEX GeometryCHLV95_V1.Coord2;
      Surface = SURFACE WITH (STRAIGHTS) VERTEX GeometryCHLV95_V1.Coord2 WITHOUT OVERLAPS > 0.005;

      TOPIC Spots =
        CLASS POI =
          Name: TEXT;
          Point: GeometryCHLV95_V1.Coord2;
          Line: Line;
          Surface: Surface;
        END POI;
      END Spots;

END MultiGeom.
Error: failed to query MultiGeom.Spots.POI
Error:   [SQLITE_ERROR] SQL error or missing database (no such table: poi_line)
signedav commented 3 months ago

Nice!

signedav commented 1 month ago

Is this on 5.1.1?

I still get the error on export:

Error: failed to query MultiGeom.Spots.POI
Error:   [SQLITE_ERROR] SQL error or missing database (no such table: poi_line)
...export failed

with this command:

$ java -jar /home/dave/dev/opengisch/QgisModelBakerLibrary/modelbaker/iliwrapper/bin/ili2gpkg-5.1.1/ili2gpkg-5.1.1.jar --dbfile /home/dave/qgis_projects/multigeometry/multi_01.gpkg --export --disableValidation --exportTid --models MultiGeom /home/dave/qgis_projects/multigeometry/export.xtf
claeis commented 1 month ago

yes. But requires that the .gpkg file was created with 5.1.1+

signedav commented 1 month ago

Ah... Alright!