aboutsummaryrefslogtreecommitdiffstats
path: root/webmap-import
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2024-10-27 23:14:54 +0100
committerGuilhem Moulin <guilhem@fripost.org>2024-10-27 23:14:54 +0100
commit39658412ab12f332446f1ca8acad37a8255b0009 (patch)
treed848547538cd424c712b4a789b18006c8d9b6122 /webmap-import
parent502a0c50cbf638f1f492efaa53ed0acb296c7424 (diff)
PostgreSQL: Add NOT NULL constraints on the geometry columns.
Among other things this allows CLUSTERing on the GIST indices, cf. https://postgis.net/docs/manual-3.3/performance_tips.html#database_clustering
Diffstat (limited to 'webmap-import')
-rwxr-xr-xwebmap-import3
1 files changed, 3 insertions, 0 deletions
diff --git a/webmap-import b/webmap-import
index 00c4756..8311c26 100755
--- a/webmap-import
+++ b/webmap-import
@@ -593,6 +593,9 @@ def createOutputLayer(ds, layername, srs=None, options=None):
lyr = dso.CreateLayer(layername, **kwargs)
if lyr is None:
raise Exception(f'Could not create destination layer "{layername}"')
+ # TODO use CreateLayerFromGeomFieldDefn() from ≥v3.9 as it's not
+ # possible to toggle the geomfield's nullable property after fact
+ # otherwise
fields = options['fields']
if len(fields) > 0 and not lyr.TestCapability(ogr.OLCCreateField):