Skip to content

feat: update various config theme files (batch d) BM-1860 - #387

Open
tawera-manaena wants to merge 10 commits into
feat/kart-import-theme-contourfrom
feat/config-themes-batch-d
Open

tawera-manaena wants to merge 10 commits into
feat/kart-import-theme-contourfrom
feat/config-themes-batch-d

Conversation

@tawera-manaena

@tawera-manaena tawera-manaena commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Motivation

To import a layer via the kart-import package, we define a config theme file that maps the source data to our target schema. Each theme file must conform to the latest schema version.

Our existing theme files were written against an earlier version of the schemas and do not yet conform to the updated v0.3 definitions. This pull request updates a set of those theme files so their mappings align with the v0.3 schemas, allowing us to import their datasets.

Modifications

  • Disabled all datasets besides those for NZ Mainland and Chatham Islands.

  • packages/kart-import/config/themes/

    • Added and updated the following config theme files:

      • structure.yml
      • structure_line.yml
      • structure_point.yml
      • vegetation.yml
      • water.yml
      • water_line.yml
    • Updated dataset mappings to conform to their respective v0.3 schemas.

Verification

Tested locally using the following commands to ensure the updated theme files fufill their schemas:

# to process a theme file:
uv run snakemake --cores=4 theme_<THEME_NAME> --quiet | npx pjl

# to strictly check against the correlating schema file:
KART_SCHEMA_CHECK=strict uv run snakemake --cores=4 theme_<THEME_NAME> --quiet | npx pjl

Note: The KART_SCHEMA_CHECK flag checks everything, rather than just the specified theme. But, it's very useful for finding out which attributes you might be missing in your theme file.

@tawera-manaena tawera-manaena changed the title Feat/config themes batch d feat: config themes batch d Sep 3, 2026
@tawera-manaena
tawera-manaena changed the base branch from master to feat/kart-import-theme-contour September 3, 2026 22:02
@tawera-manaena tawera-manaena changed the title feat: config themes batch d feat: update various config theme files (batch d) BM-1860 Sep 3, 2026
@tawera-manaena
tawera-manaena marked this pull request as ready for review September 3, 2026 23:33
@tawera-manaena
tawera-manaena requested a review from a team as a code owner September 3, 2026 23:33
@amcmenamin-linz

Copy link
Copy Markdown
Contributor

Issues

geom must be called-> geometry

type and subtype values with spaces should have underscore _
structure_point - subtype & tank_type - must be equal to one of the allowed values
subtype: power generation = power_generation
subtype: tunnel ventilation = tunnel_ventilation

tank_type: surge chamber = surge_chamber

water subtype:must be equal to one of the allowed values
sewage treatment = sewage_treatment

@amcmenamin-linz

Copy link
Copy Markdown
Contributor

One missed is to fix typo in structure_point: watre = water

Some more complex rules for structures
review type/subtype = lighthouse see https://toitutewhenua.atlassian.net/browse/BM-1754

@amcmenamin-linz

Copy link
Copy Markdown
Contributor

water
structure_updates: subtype 'hydro-electric' -> 'hydro_electric'.

@amcmenamin-linz

amcmenamin-linz commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

We need to check we are not losing data in this field gazfeatid -> feat_id = should end up as metadata - ids associated with names in lookup. - WATER_LINE - note this is similar to road_line metadata.
see: https://toitutewhenua.atlassian.net/browse/BM-1716

'table_column', 'name',
'source', 'nzgb_gazetteer',
'source_key_name', 'feat_id',
'source_key_value', feat_id,
'source_table', 'nzgb_gaz',
'source_column', 'name',
'source_updated_at', NOW(),
'imported_at', NOW()

@amcmenamin-linz

Copy link
Copy Markdown
Contributor

Final element:
Where the name is null the metadata should be null. As there is no name to explain.

@ccbblin
ccbblin force-pushed the feat/config-themes-batch-d branch from 55bded8 to 0017fb4 Compare September 15, 2026 21:21
ccbblin
ccbblin previously approved these changes Sep 15, 2026
ccbblin
ccbblin previously approved these changes Sep 15, 2026
@ccbblin
ccbblin dismissed their stale review September 15, 2026 22:50

The merge-base changed after approval.

@ccbblin
ccbblin force-pushed the feat/config-themes-batch-d branch from a7ab298 to daa53c1 Compare September 15, 2026 22:50
@ccbblin
ccbblin force-pushed the feat/config-themes-batch-d branch from daa53c1 to 997b958 Compare September 16, 2026 21:26
@ccbblin
ccbblin force-pushed the feat/config-themes-batch-d branch from 997b958 to 1068a7f Compare September 16, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants