Skip to content

Instantly share code, notes, and snippets.

@signedav
Last active April 18, 2024 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save signedav/4f858989ca4fc8dbdeebd4a2a1265ef4 to your computer and use it in GitHub Desktop.
Save signedav/4f858989ca4fc8dbdeebd4a2a1265ef4 to your computer and use it in GitHub Desktop.
multis-and-locks

Test with GDAL 3.4 (default)

When having this (Use Case Multigeometry - ili2db)

image

In QGIS it recognizes only a point.

Test with GDAL 3.8 build

Model Baker makes it like this:

image

With direct drag'n'drop:

image

We can add something. And no (at least no immediate) locks on Transaction Mode:

image

Then I checked KbS_V1_5.

With Model Baker it turned like this (after ignoring the rel.isValid() error):

image

   Kann Layer belasteter_standort nicht finden.(Table belasteter_standort appearing several times in gpkg_contents and/or gpkg_geometry_columns)

Then I fixed the sources. And I try to digitize.

There are no locks and I can digitize, but the results are not rendered...

On reopening the project I see something:

image

Multigeometry

Manually

INSERT INTO gpkg_geometry_columns VALUES('test','poly','POLYGON',0,0,0)
INSERT INTO gpkg_geometry_columns VALUES('test','pt','POINT',0,0,0)
CREATE TABLE "test" ( "ogc_fid" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "poly" POLYGON, "pt" POINT, "area" REAL, "eas_id" INTEGER, "prfedea" TEXT(16))

ili2db

Additional param: --gpkgMultiGeomPerTable

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.

Model Baker Error on Project Create:

  File "/home/dave/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QgisModelBaker/libs/modelbaker/dataobjects/project.py", line 158, in create
    assert rel.isValid()

But fixes made by passing the geometry column: opengisch/QgisModelBakerLibrary#91

And here something funny:

multiediting.webm

Smooth work on KbS with GeoPackage...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment