Skip to content

Commit

Permalink
Concern multiple geometries in same layer for geopackage
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Sep 27, 2024
1 parent c43ea23 commit a93a154
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modelbaker/db_factory/gpkg_layer_uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ def get_data_source_uri(self, record: dict) -> str:
data_source_uri = "{uri}|layername={table}".format(
uri=self.uri, table=record["tablename"]
)
if record["geometry_column"]:
data_source_uri = "{} ({})".format(
data_source_uri, record["geometry_column"]
)
return data_source_uri
4 changes: 4 additions & 0 deletions modelbaker/iliwrapper/ili2dbconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from qgis.core import QgsNetworkAccessManager
from qgis.PyQt.QtNetwork import QNetworkProxy

from .globals import DbIliMode
from .ili2dbutils import get_all_modeldir_in_path


Expand Down Expand Up @@ -298,6 +299,9 @@ def to_ili2db_args(self, extra_args=[], with_action=True):
elif self.db_ili_version is None or self.db_ili_version > 3:
self.append_args(args, ["--createBasketCol=False"])

if self.tool == DbIliMode.gpkg:
self.append_args(args, ["--gpkgMultiGeomPerTable"], True)

self.append_args(args, ["--defaultSrsAuth", self.srs_auth])

self.append_args(args, ["--defaultSrsCode", "{}".format(self.srs_code)])
Expand Down

0 comments on commit a93a154

Please sign in to comment.