File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ themepark.debug = false
1313-- Add JSONB column `tags` with original OSM tags in debug mode
1414themepark :set_option (' tags' , ' all_tags' )
1515
16+ -- Set this to add a column 'id' with unique IDs (and corresponding unique
17+ -- index). This is needed for instance when you want to edit the data in QGIS.
18+ -- themepark:set_option('unique_id', 'id')
19+
1620-- ---------------------------------------------------------------------------
1721
1822-- themepark:add_topic('core/name-single', { column = 'name' })
Original file line number Diff line number Diff line change @@ -282,6 +282,19 @@ function themepark:add_table(data)
282282 })
283283 end
284284
285+ if themepark .options .unique_id then
286+ table.insert (data .columns , {
287+ column = themepark .options .unique_id ,
288+ sql_type = ' bigserial' ,
289+ create_only = true
290+ })
291+ table.insert (data .indexes , {
292+ column = themepark .options .unique_id ,
293+ unique = true ,
294+ method = ' btree'
295+ })
296+ end
297+
285298 if data .geom then
286299 if type (data .geom ) == ' string' then
287300 data .geom_type = data .geom
You can’t perform that action at this time.
0 commit comments