From 9ec86df8ae869649dd7d64afffc69580a4a10078 Mon Sep 17 00:00:00 2001 From: Tawera Manaena Date: Tue, 1 Sep 2026 14:06:16 +1200 Subject: [PATCH 01/10] feat: update config theme files --- .../config/themes/structure_point.yml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 packages/kart-import/config/themes/structure_point.yml diff --git a/packages/kart-import/config/themes/structure_point.yml b/packages/kart-import/config/themes/structure_point.yml new file mode 100644 index 00000000..0be97eb5 --- /dev/null +++ b/packages/kart-import/config/themes/structure_point.yml @@ -0,0 +1,38 @@ +name: structure_point +target_repo: topographic-data +target_epsg: EPSG:4167 +datasets: + # -------- radar_dome + # nz + - source: kart@data.koordinates.com:linz/nz-radar-dome-points-topo-150k + name: nz_radar_dome_points_topo_150k + mapping: + t50_fid: $ + type: radar_dome + subtype: null + tank_type: null + status: null + name: null + height: null + orientation: null + theme: structures + metadata: null + + # -------- satellite_station + # nz + - source: kart@data.koordinates.com:linz/nz-satellite-station-points-topo-150k + name: nz_satellite_station_points_topo_150k + mapping: &satellite_station + t50_fid: $ + type: satellite_station + subtype: null + tank_type: null + status: null + name: null + height: null + orientation: null + theme: structures + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-satellite-station-points-topo-150k + name: nz_chatham_island_satellite_station_points_topo_150k + mapping: *satellite_station From 28b27b4ebf1646f125e4b6ea4809a286f35957d9 Mon Sep 17 00:00:00 2001 From: Tawera Manaena Date: Fri, 4 Sep 2026 09:48:03 +1200 Subject: [PATCH 02/10] feat: updated batch d config theme files --- .../kart-import/config/themes/structure.yml | 112 +++++ .../config/themes/structure_line.yml | 321 ++++++++++++++ .../config/themes/structure_point.yml | 417 ++++++++++++++++++ .../kart-import/config/themes/vegetation.yml | 111 +++++ packages/kart-import/config/themes/water.yml | 165 +++++++ .../kart-import/config/themes/water_line.yml | 69 +++ 6 files changed, 1195 insertions(+) create mode 100644 packages/kart-import/config/themes/structure.yml create mode 100644 packages/kart-import/config/themes/structure_line.yml create mode 100644 packages/kart-import/config/themes/vegetation.yml create mode 100644 packages/kart-import/config/themes/water.yml create mode 100644 packages/kart-import/config/themes/water_line.yml diff --git a/packages/kart-import/config/themes/structure.yml b/packages/kart-import/config/themes/structure.yml new file mode 100644 index 00000000..f88445eb --- /dev/null +++ b/packages/kart-import/config/themes/structure.yml @@ -0,0 +1,112 @@ +name: structure +target_repo: topographic-data +target_epsg: EPSG:4167 +datasets: + # -------- dry_dock + # nz + - source: kart@data.koordinates.com:linz/nz-dry-dock-polygons-topo-150k + name: nz_dry_dock_polygons_topo_150k + mapping: + t50_fid: $ + type: dry_dock + subtype: $type + lid_type: null + tank_type: null + species: null + status: null + name: null + theme: structures + metadata: null + + # -------- fish_farm + # nz + - source: kart@data.koordinates.com:linz/nz-fish-farm-polygons-topo-150k + name: nz_fish_farm_polygons_topo_150k + mapping: + t50_fid: $ + type: fish_farm + subtype: $type + lid_type: null + tank_type: null + species: $ + status: null + name: null + theme: structures + metadata: null + + # -------- marine_farm + # nz + - source: kart@data.koordinates.com:linz/nz-marine-farm-polygons-topo-150k + name: nz_marine_farm_polygons_topo_150k + mapping: + t50_fid: $ + type: marine_farm + subtype: null + lid_type: null + tank_type: null + species: $ + status: null + name: null + theme: structures + metadata: null + + # -------- reservoir + # nz + - source: kart@data.koordinates.com:linz/nz-reservoir-polygons-topo-150k + name: nz_reservoir_polygons_topo_150k + mapping: &reservoir + t50_fid: $ + type: reservoir + subtype: null + lid_type: $ + tank_type: null + species: null + status: null + name: null + theme: structures + metadata: null + # pi + - source: kart@data.koordinates.com:linz/cook-islands-reservoir-polygons-topo-125k-zone4 + name: cook_islands_reservoir_polygons_topo_125k_zone4 + mapping: *reservoir + + # -------- siphon + # nz + - source: kart@data.koordinates.com:linz/nz-siphon-polygons-topo-150k + name: nz_siphon_polygons_topo_150k + mapping: + t50_fid: $ + type: siphon + subtype: null + lid_type: null + tank_type: null + species: null + status: $ + name: null + theme: structures + metadata: null + + # -------- tank + # Per FTM schema feedback (BM-1754): stored_item -> subtype (same rule as structure_point). + # nz + - source: kart@data.koordinates.com:linz/nz-tank-polygons-topo-150k + name: nz_tank_polygons_topo_150k + mapping: &tank + t50_fid: $ + type: tank + subtype: $store_item + lid_type: null + tank_type: $ + species: null + status: null + name: null + theme: structures + metadata: null + # pi + - source: kart@data.koordinates.com:linz/cook-islands-tank-polygons-topo-125k-zone4 + name: cook_islands_tank_polygons_topo_125k_zone4 + mapping: *tank + # ant + - source: kart@data.koordinates.com:linz/nz-ross-dependency-tank-polygons-ant-150k + name: nz_ross_dependency_tank_polygons_ant_150k + mapping: *tank diff --git a/packages/kart-import/config/themes/structure_line.yml b/packages/kart-import/config/themes/structure_line.yml new file mode 100644 index 00000000..f758fc1d --- /dev/null +++ b/packages/kart-import/config/themes/structure_line.yml @@ -0,0 +1,321 @@ +name: structure_line +target_repo: topographic-data +target_epsg: EPSG:4167 +datasets: + # -------- boatramp + # nz + - source: kart@data.koordinates.com:linz/nz-boatramp-centrelines-topo-150k + name: nz_boatramp_centrelines_topo_150k + mapping: &boatramp + t50_fid: $ + type: boatramp + subtype: null + species: null + status: null + name: $ + theme: structures + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-boatramp-centrelines-topo-150k + name: nz_chatham_island_boatramp_centrelines_topo_150k + mapping: *boatramp + # pi + - source: kart@data.koordinates.com:linz/cook-islands-boatramp-centrelines-topo-125k-zone4 + name: cook_islands_boatramp_centrelines_topo_125k_zone4 + mapping: *boatramp + - source: kart@data.koordinates.com:linz/niue-boatramp-centrelines-topo-150k + name: niue_boatramp_centrelines_topo_150k + mapping: *boatramp + + # -------- boom + # nz + - source: kart@data.koordinates.com:linz/nz-boom-centrelines-topo-150k + name: nz_boom_centrelines_topo_150k + mapping: + t50_fid: $ + type: boom + subtype: null + species: null + status: null + name: null + theme: structures + metadata: null + + # -------- breakwater + # nz + - source: kart@data.koordinates.com:linz/nz-breakwater-centrelines-topo-150k + name: nz_breakwater_centrelines_topo_150k + mapping: &breakwater + t50_fid: $ + type: breakwater + subtype: null + species: null + status: null + name: null + theme: structures + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-breakwater-centrelines-topo-150k + name: nz_chatham_island_breakwater_centrelines_topo_150k + mapping: *breakwater + # pi + - source: kart@data.koordinates.com:linz/cook-islands-breakwater-centrelines-topo-125k-zone4 + name: cook_islands_breakwater_centrelines_topo_125k_zone4 + mapping: *breakwater + - source: kart@data.koordinates.com:linz/tokelau-breakwater-centrelines-topo-125k + name: tokelau_breakwater_centrelines_topo_125k + mapping: *breakwater + + # -------- cableway_industrial + # Per FTM schema feedback (BM-1754): material_conveyed -> subtype (only + # case seen is coal/lime, both valid structure_subtype values). + # nz + - source: kart@data.koordinates.com:linz/nz-cableway-industrial-centrelines-topo-150k + name: nz_cableway_industrial_centrelines_topo_150k + mapping: + t50_fid: $ + type: cableway_industrial + subtype: $mtlconveyd + species: null + status: null + name: null + theme: structures + metadata: null + + # -------- cableway_people + # Per FTM schema feedback (BM-1754): restrictions -> subtype (only case + # seen is "locked", a valid structure_subtype value). + # nz + - source: kart@data.koordinates.com:linz/nz-cableway-people-centrelines-topo-150k + name: nz_cableway_people_centrelines_topo_150k + mapping: &cableway_people + t50_fid: $ + type: cableway_people + subtype: $restrictns + species: null + status: null + name: null + theme: structures + metadata: null + # nzoi + - source: kart@data.koordinates.com:linz/nz-kermadec-is-cableway-people-centrelines-topo-125k + name: nz_kermadec_is_cableway_people_centrelines_topo_125k + mapping: *cableway_people + + # -------- dam + # nz + - source: kart@data.koordinates.com:linz/nz-dam-centrelines-topo-150k + name: nz_dam_centrelines_topo_150k + mapping: &dam + t50_fid: $ + type: dam + subtype: null + species: null + status: $dam_status + name: $ + theme: structures + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-dam-centrelines-topo-150k + name: nz_chatham_island_dam_centrelines_topo_150k + mapping: *dam + + # -------- flume + # nz + - source: kart@data.koordinates.com:linz/nz-flume-centrelines-topo-150k + name: nz_flume_centrelines_topo_150k + mapping: + t50_fid: $ + type: flume + subtype: null + species: null + status: null + name: null + theme: structures + metadata: null + + # -------- ladder + # Per FTM schema feedback (page 20): ladder_upright_materials is always + # null in practice, so it's dropped rather than mapped to subtype. + # nz + - source: kart@data.koordinates.com:linz/nz-ladder-centrelines-topo-150k + name: nz_ladder_centrelines_topo_150k + mapping: + t50_fid: $ + type: ladder + subtype: null + species: null + status: null + name: null + theme: structures + metadata: null + + # -------- marine_farm + # nz + - source: kart@data.koordinates.com:linz/nz-marine-farm-centrelines-topo-150k + name: nz_marine_farm_centrelines_topo_150k + mapping: + t50_fid: $ + type: marine_farm + subtype: null + species: $ + status: null + name: null + theme: structures + metadata: null + + # -------- ski_lift + # nz + - source: kart@data.koordinates.com:linz/nz-ski-lift-centrelines-topo-150k + name: nz_ski_lift_centrelines_topo_150k + mapping: + t50_fid: $ + type: ski_lift + subtype: null + species: null + status: null + name: null + theme: structures + metadata: null + + # -------- ski_tow + # nz + - source: kart@data.koordinates.com:linz/nz-ski-tow-centrelines-topo-150k + name: nz_ski_tow_centrelines_topo_150k + mapping: &ski_tow + t50_fid: $ + type: ski_tow + subtype: null + species: null + status: null + name: null + theme: structures + metadata: null + # ant + - source: kart@data.koordinates.com:linz/nz-ross-dependency-ski-tow-centrelines-ant-150k + name: nz_ross_dependency_ski_tow_centrelines_ant_150k + mapping: *ski_tow + + # -------- slipway + # nz + - source: kart@data.koordinates.com:linz/nz-slipway-centrelines-topo-150k + name: nz_slipway_centrelines_topo_150k + mapping: + t50_fid: $ + type: slipway + subtype: null + species: null + status: null + name: $ + theme: structures + metadata: null + + # -------- spillway_edge + # nz + - source: kart@data.koordinates.com:linz/nz-spillway-edges-topo-150k + name: nz_spillway_edges_topo_150k + mapping: + t50_fid: $ + type: spillway_edge + subtype: null + species: null + status: null + name: null + theme: structures + metadata: null + + # -------- walkwire + # nz + - source: kart@data.koordinates.com:linz/nz-walkwire-centrelines-topo-150k + name: nz_walkwire_centrelines_topo_150k + mapping: + t50_fid: $ + type: walkwire + subtype: null + species: null + status: null + name: null + theme: structures + metadata: null + + # -------- water_race + # nz + - source: kart@data.koordinates.com:linz/nz-water-race-centrelines-topo-150k + name: nz_water_race_centrelines_topo_150k + mapping: + t50_fid: $ + type: water_race + subtype: null + species: null + status: $ + name: $ + theme: structures + metadata: null + + # -------- weir + # nz + - source: kart@data.koordinates.com:linz/nz-weir-centrelines-topo-150k + name: nz_weir_centrelines_topo_150k + mapping: + t50_fid: $ + type: weir + subtype: null + species: null + status: null + name: null + theme: structures + metadata: null + + # -------- wharf + # Per FTM schema feedback (page 20): wharf_use -> subtype (only case seen + # is "jetty", a valid structure_subtype value). + # nz + - source: kart@data.koordinates.com:linz/nz-wharf-centrelines-topo-150k + name: nz_wharf_centrelines_topo_150k + mapping: &wharf + t50_fid: $ + type: wharf + subtype: $wharf_use + species: null + status: $ + name: $ + theme: structures + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-wharf-centrelines-topo-150k + name: nz_chatham_island_wharf_centrelines_topo_150k + mapping: *wharf + # pi + - source: kart@data.koordinates.com:linz/cook-islands-wharf-centrelines-topo-125k-zone3 + name: cook_islands_wharf_centrelines_topo_125k_zone3 + mapping: *wharf + - source: kart@data.koordinates.com:linz/cook-islands-wharf-centrelines-topo-125k-zone4 + name: cook_islands_wharf_centrelines_topo_125k_zone4 + mapping: *wharf + - source: kart@data.koordinates.com:linz/tokelau-wharf-centrelines-topo-125k + name: tokelau_wharf_centrelines_topo_125k + mapping: *wharf + + # -------- wharf_edge + # nz + - source: kart@data.koordinates.com:linz/nz-wharf-edges-topo-150k + name: nz_wharf_edges_topo_150k + mapping: &wharf_edge + t50_fid: $ + type: wharf_edge + subtype: null + species: null + status: null + name: null + theme: structures + metadata: null + # pi + - source: kart@data.koordinates.com:linz/cook-islands-wharf-edges-topo-125k-zone4 + name: cook_islands_wharf_edges_topo_125k_zone4 + mapping: *wharf_edge + - source: kart@data.koordinates.com:linz/niue-wharf-edges-topo-150k + name: niue_wharf_edges_topo_150k + mapping: *wharf_edge + - source: kart@data.koordinates.com:linz/tokelau-wharf-edges-topo-125k + name: tokelau_wharf_edges_topo_125k + mapping: *wharf_edge + # ant + - source: kart@data.koordinates.com:linz/nz-ross-dependency-wharf-edges-ant-150k + name: nz_ross_dependency_wharf_edges_ant_150k + mapping: *wharf_edge diff --git a/packages/kart-import/config/themes/structure_point.yml b/packages/kart-import/config/themes/structure_point.yml index 0be97eb5..f89ddbf0 100644 --- a/packages/kart-import/config/themes/structure_point.yml +++ b/packages/kart-import/config/themes/structure_point.yml @@ -2,6 +2,229 @@ name: structure_point target_repo: topographic-data target_epsg: EPSG:4167 datasets: + # -------- beacon + # Per FTM schema feedback (page 19): raw `type` column distinguishes plain + # beacons from lighthouses ("lighthouse" is a valid structure_subtype + # value; plain "beacon" is not, so it corrects to null). The raw + # `location` (land/sea) column has no schema field yet and is dropped — + # a "type=lighthouse, subtype=location" alternative was proposed but not + # adopted. + # nz + - source: kart@data.koordinates.com:linz/nz-beacon-points-topo-150k + name: nz_beacon_points_topo_150k + mapping: &beacon + t50_fid: $ + type: beacon + subtype: $type + tank_type: null + status: $ + name: $ + height: null + orientation: null + theme: structures + metadata: null + corrections: &beacon_corrections + - column: subtype + replace: + beacon: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-beacon-points-topo-150k + name: nz_chatham_island_beacon_points_topo_150k + mapping: *beacon + corrections: *beacon_corrections + # pi + - source: kart@data.koordinates.com:linz/cook-islands-beacon-points-topo-150k-zone3 + name: cook_islands_beacon_points_topo_150k_zone3 + mapping: *beacon + corrections: *beacon_corrections + - source: kart@data.koordinates.com:linz/cook-islands-beacon-points-topo-125k-zone4 + name: cook_islands_beacon_points_topo_125k_zone4 + mapping: *beacon + corrections: *beacon_corrections + # ant + - source: kart@data.koordinates.com:linz/nz-ross-dependency-beacon-points-ant-150k + name: nz_ross_dependency_beacon_points_ant_150k + mapping: *beacon + corrections: *beacon_corrections + + # -------- bivouac + # Per FTM schema feedback (item 240, Agreed): bivouac_material -> subtype, + # defaulting to "building" where the source material is null. + # nz + - source: kart@data.koordinates.com:linz/nz-bivouac-points-topo-150k + name: nz_bivouac_points_topo_150k + mapping: + t50_fid: $ + type: bivouac + subtype: { source: $materials, default: building } + tank_type: null + status: $ + name: $ + height: null + orientation: $orientatn + theme: structures + metadata: null + + # -------- buoy + # nz + - source: kart@data.koordinates.com:linz/nz-buoy-points-topo-150k + name: nz_buoy_points_topo_150k + mapping: + t50_fid: $ + type: buoy + subtype: null + tank_type: null + status: null + name: null + height: null + orientation: null + theme: structures + metadata: null + + # -------- chimney + # nz + - source: kart@data.koordinates.com:linz/nz-chimney-points-topo-150k + name: nz_chimney_points_topo_150k + mapping: + t50_fid: $ + type: chimney + subtype: null + tank_type: null + status: null + name: null + height: null + orientation: null + theme: structures + metadata: null + + # -------- dredge + # nz + - source: kart@data.koordinates.com:linz/nz-dredge-points-topo-150k + name: nz_dredge_points_topo_150k + mapping: + t50_fid: $ + type: dredge + subtype: null + tank_type: null + status: $ + name: null + height: null + orientation: null + theme: structures + metadata: null + + # -------- flare + # nz + - source: kart@data.koordinates.com:linz/nz-flare-points-topo-150k + name: nz_flare_points_topo_150k + mapping: + t50_fid: $ + type: flare + subtype: null + tank_type: null + status: null + name: null + height: null + orientation: null + theme: structures + metadata: null + + # -------- floodgate + # nz + - source: kart@data.koordinates.com:linz/nz-floodgate-points-topo-150k + name: nz_floodgate_points_topo_150k + mapping: + t50_fid: $ + type: floodgate + subtype: null + tank_type: null + status: null + name: null + height: null + orientation: $orientatn + theme: structures + metadata: null + + # -------- gate + # Per FTM schema feedback (page 19): gate restrictns -> subtype. + # nz + - source: kart@data.koordinates.com:linz/nz-gate-points-topo-150k + name: nz_gate_points_topo_150k + mapping: + t50_fid: $ + type: gate + subtype: $restrictns + tank_type: null + status: null + name: $ + height: null + orientation: $orientatn + theme: structures + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-gate-points-topo-150k + name: nz_chatham_island_gate_points_topo_150k + mapping: + t50_fid: $ + type: gate + subtype: $restrictns + tank_type: null + status: null + name: $ + height: null + orientation: null + theme: structures + metadata: null + + # -------- ladder + # Per FTM schema feedback (page 20): ladder_upright_materials is always + # null in practice, so it's dropped rather than mapped to subtype. + # nz + - source: kart@data.koordinates.com:linz/nz-ladder-points-topo-150k + name: nz_ladder_points_topo_150k + mapping: + t50_fid: $ + type: ladder + subtype: null + tank_type: null + status: null + name: null + height: null + orientation: null + theme: structures + metadata: null + + # -------- mast + # nz + - source: kart@data.koordinates.com:linz/nz-mast-points-topo-150k + name: nz_mast_points_topo_150k + mapping: &mast + t50_fid: $ + type: mast + subtype: null + tank_type: null + status: null + name: null + height: $ + orientation: null + theme: structures + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-mast-points-topo-150k + name: nz_chatham_island_mast_points_topo_150k + mapping: *mast + # pi + - source: kart@data.koordinates.com:linz/cook-islands-mast-points-topo-125k-zone4 + name: cook_islands_mast_points_topo_125k_zone4 + mapping: *mast + - source: kart@data.koordinates.com:linz/niue-mast-points-topo-150k + name: niue_mast_points_topo_150k + mapping: *mast + - source: kart@data.koordinates.com:linz/tokelau-mast-points-topo-125k + name: tokelau_mast_points_topo_125k + mapping: *mast + # ant + - source: kart@data.koordinates.com:linz/nz-ross-dependency-mast-points-ant-150k + name: nz_ross_dependency_mast_points_ant_150k + mapping: *mast + # -------- radar_dome # nz - source: kart@data.koordinates.com:linz/nz-radar-dome-points-topo-150k @@ -18,6 +241,22 @@ datasets: theme: structures metadata: null + # -------- redoubt + # nz + - source: kart@data.koordinates.com:linz/nz-redoubt-points-topo-150k + name: nz_redoubt_points_topo_150k + mapping: + t50_fid: $ + type: redoubt + subtype: null + tank_type: null + status: $ + name: $ + height: null + orientation: null + theme: structures + metadata: null + # -------- satellite_station # nz - source: kart@data.koordinates.com:linz/nz-satellite-station-points-topo-150k @@ -36,3 +275,181 @@ datasets: - source: kart@data.koordinates.com:linz/nz-chatham-island-satellite-station-points-topo-150k name: nz_chatham_island_satellite_station_points_topo_150k mapping: *satellite_station + + # -------- shaft + # Per FTM schema feedback (page 19): shaft_use -> subtype. + # nz + - source: kart@data.koordinates.com:linz/nz-shaft-points-topo-150k + name: nz_shaft_points_topo_150k + mapping: + t50_fid: $ + type: shaft + subtype: $shaft_use + tank_type: null + status: null + name: null + height: null + orientation: null + theme: structures + metadata: null + + # -------- siphon + # nz + - source: kart@data.koordinates.com:linz/nz-siphon-points-topo-150k + name: nz_siphon_points_topo_150k + mapping: + t50_fid: $ + type: siphon + subtype: null + tank_type: null + status: $ + name: null + height: null + orientation: null + theme: structures + metadata: null + + # -------- stockyard + # nz + - source: kart@data.koordinates.com:linz/nz-stockyard-points-topo-150k + name: nz_stockyard_points_topo_150k + mapping: &stockyard + t50_fid: $ + type: stockyard + subtype: null + tank_type: null + status: null + name: null + height: null + orientation: null + theme: structures + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-stockyard-points-topo-150k + name: nz_chatham_island_stockyard_points_topo_150k + mapping: *stockyard + + # -------- tank + # Per FTM schema feedback (BM-1754): stored_item -> subtype. + # nz + - source: kart@data.koordinates.com:linz/nz-tank-points-topo-150k + name: nz_tank_points_topo_150k + mapping: &tank + t50_fid: $ + type: tank + subtype: $store_item + tank_type: $ + status: null + name: null + height: null + orientation: null + theme: structures + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-tank-points-topo-150k + name: nz_chatham_island_tank_points_topo_150k + mapping: *tank + # pi + - source: kart@data.koordinates.com:linz/cook-islands-tank-points-topo-125k-zone4 + name: cook_islands_tank_points_topo_125k_zone4 + mapping: *tank + - source: kart@data.koordinates.com:linz/niue-tank-points-topo-150k + name: niue_tank_points_topo_150k + mapping: *tank + # ant + - source: kart@data.koordinates.com:linz/nz-ross-dependency-tank-points-ant-150k + name: nz_ross_dependency_tank_points_ant_150k + mapping: *tank + + # -------- tower + # Per FTM schema feedback (page 19): tower material -> subtype. + # nz + - source: kart@data.koordinates.com:linz/nz-tower-points-topo-150k + name: nz_tower_points_topo_150k + mapping: + t50_fid: $ + type: tower + subtype: $material + tank_type: null + status: null + name: null + height: null + orientation: null + theme: structures + metadata: null + + # -------- well + # nz + - source: kart@data.koordinates.com:linz/nz-well-points-topo-150k + name: nz_well_points_topo_150k + mapping: &well + t50_fid: $ + type: well + subtype: null + tank_type: null + status: $ + name: null + height: null + orientation: null + theme: structures + metadata: null + # pi + - source: kart@data.koordinates.com:linz/niue-well-points-topo-150k + name: niue_well_points_topo_150k + mapping: *well + - source: kart@data.koordinates.com:linz/tokelau-well-points-topo-125k + name: tokelau_well_points_topo_125k + mapping: *well + + # -------- windmill + # Per FTM schema feedback (page 19): windmill use -> subtype. + # nz + - source: kart@data.koordinates.com:linz/nz-windmill-points-topo-150k + name: nz_windmill_points_topo_150k + mapping: &windmill + t50_fid: $ + type: windmill + subtype: $use + tank_type: null + status: null + name: null + height: null + orientation: null + theme: structures + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-windmill-points-topo-1250k + name: nz_chatham_island_windmill_points_topo_1250k + mapping: *windmill + # ant + - source: kart@data.koordinates.com:linz/nz-ross-dependency-windmill-points-ant-150k + name: nz_ross_dependency_windmill_points_ant_150k + mapping: *windmill + + # -------- wreck + # Per FTM schema feedback (page 19): wreck_of -> subtype. + # nz + - source: kart@data.koordinates.com:linz/nz-wreck-points-topo-150k + name: nz_wreck_points_topo_150k + mapping: &wreck + t50_fid: $ + type: wreck + subtype: $wreck_of + tank_type: null + status: null + name: $ + height: null + orientation: null + theme: structures + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-wreck-points-topo-150k + name: nz_chatham_island_wreck_points_topo_150k + mapping: *wreck + # nzoi + - source: kart@data.koordinates.com:linz/nz-auckland-island-wreck-points-topo-150k + name: nz_auckland_island_wreck_points_topo_150k + mapping: *wreck + - source: kart@data.koordinates.com:linz/nz-kermadec-is-wreck-points-topo-125k + name: nz_kermadec_is_wreck_points_topo_125k + mapping: *wreck + # pi + - source: kart@data.koordinates.com:linz/niue-wreck-points-topo-150k + name: niue_wreck_points_topo_150k + mapping: *wreck diff --git a/packages/kart-import/config/themes/vegetation.yml b/packages/kart-import/config/themes/vegetation.yml new file mode 100644 index 00000000..ff22a8eb --- /dev/null +++ b/packages/kart-import/config/themes/vegetation.yml @@ -0,0 +1,111 @@ +name: vegetation +target_repo: topographic-data +target_epsg: EPSG:4167 +datasets: + # -------- exotic + # Per FTM schema feedback (item 620): species moves into subtype; where + # species is null for exotic features, default subtype to "coniferous". + # nz + - source: kart@data.koordinates.com:linz/nz-exotic-polygons-topo-150k + name: nz_exotic_polygons_topo_150k + mapping: &exotic + t50_fid: $ + type: exotic + subtype: { source: $species, default: coniferous } + theme: landcover + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-exotic-polygons-topo-150k + name: nz_chatham_island_exotic_polygons_topo_150k + mapping: *exotic + + # -------- native + # nz + - source: kart@data.koordinates.com:linz/nz-native-polygons-topo-150k + name: nz_native_polygons_topo_150k + mapping: &native + t50_fid: $ + type: native + subtype: null + theme: landcover + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-native-polygons-topo-150k + name: nz_chatham_island_native_polygons_topo_150k + mapping: *native + # nzoi + - source: kart@data.koordinates.com:linz/nz-auckland-island-native-polygons-topo-150k + name: nz_auckland_island_native_polygons_topo_150k + mapping: *native + - source: kart@data.koordinates.com:linz/nz-kermadec-is-native-polygons-topo-125k + name: nz_kermadec_is_native_polygons_topo_125k + mapping: *native + - source: kart@data.koordinates.com:linz/nz-snares-island-tini-heke-native-polygons-topo-125k + name: nz_snares_island_tini_heke_native_polygons_topo_125k + mapping: *native + # pi + - source: kart@data.koordinates.com:linz/cook-islands-native-polygons-topo-125k-zone3 + name: cook_islands_native_polygons_topo_125k_zone3 + mapping: *native + - source: kart@data.koordinates.com:linz/cook-islands-native-polygons-topo-125k-zone4 + name: cook_islands_native_polygons_topo_125k_zone4 + mapping: *native + - source: kart@data.koordinates.com:linz/niue-native-polygons-topo-150k + name: niue_native_polygons_topo_150k + mapping: *native + - source: kart@data.koordinates.com:linz/tokelau-native-polygons-topo-125k + name: tokelau_native_polygons_topo_125k + mapping: *native + + # -------- scattered_scrub + # nz + - source: kart@data.koordinates.com:linz/nz-scattered-scrub-polygons-topo-150k + name: nz_scattered_scrub_polygons_topo_150k + mapping: &scattered_scrub + t50_fid: $ + type: scattered_scrub + subtype: null + theme: landcover + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-scattered-scrub-polygons-topo-150k + name: nz_chatham_island_scattered_scrub_polygons_topo_150k + mapping: *scattered_scrub + # pi + - source: kart@data.koordinates.com:linz/cook-islands-scattered-scrub-polygons-topo-125k-zone4 + name: cook_islands_scattered_scrub_polygons_topo_125k_zone4 + mapping: *scattered_scrub + + # -------- scrub + # nz + - source: kart@data.koordinates.com:linz/nz-scrub-polygons-topo-150k + name: nz_scrub_polygons_topo_150k + mapping: &scrub + t50_fid: $ + type: scrub + subtype: null + theme: landcover + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-scrub-polygons-topo-150k + name: nz_chatham_island_scrub_polygons_topo_150k + mapping: *scrub + # nzoi + - source: kart@data.koordinates.com:linz/nz-campbell-island-motu-ihupuku-scrub-polygons-topo-150k + name: nz_campbell_island_motu_ihupuku_scrub_polygons_topo_150k + mapping: *scrub + - source: kart@data.koordinates.com:linz/nz-kermadec-is-scrub-polygons-topo-125k + name: nz_kermadec_is_scrub_polygons_topo_125k + mapping: *scrub + - source: kart@data.koordinates.com:linz/nz-snares-island-tini-heke-scrub-polygons-topo-125k + name: nz_snares_island_tini_heke_scrub_polygons_topo_125k + mapping: *scrub + # pi + - source: kart@data.koordinates.com:linz/cook-islands-scrub-polygons-topo-125k-zone3 + name: cook_islands_scrub_polygons_topo_125k_zone3 + mapping: *scrub + - source: kart@data.koordinates.com:linz/cook-islands-scrub-polygons-topo-125k-zone4 + name: cook_islands_scrub_polygons_topo_125k_zone4 + mapping: *scrub + - source: kart@data.koordinates.com:linz/niue-scrub-polygons-topo-150k + name: niue_scrub_polygons_topo_150k + mapping: *scrub + - source: kart@data.koordinates.com:linz/tokelau-scrub-polygons-topo-125k + name: tokelau_scrub_polygons_topo_125k + mapping: *scrub diff --git a/packages/kart-import/config/themes/water.yml b/packages/kart-import/config/themes/water.yml new file mode 100644 index 00000000..2fb35a12 --- /dev/null +++ b/packages/kart-import/config/themes/water.yml @@ -0,0 +1,165 @@ +name: water +target_repo: topographic-data +target_epsg: EPSG:4167 +datasets: + # -------- canal + # nz + - source: kart@data.koordinates.com:linz/nz-canal-polygons-topo-150k + name: nz_canal_polygons_topo_150k + mapping: + t50_fid: $ + type: canal + subtype: null + name: $ + group_name: null + height: null + elevation: null + perennial: null + temperature_indicator: null + theme: landcover + metadata: null + + # -------- lagoon + # nz + - source: kart@data.koordinates.com:linz/nz-lagoon-polygons-topo-150k + name: nz_lagoon_polygons_topo_150k + mapping: &lagoon + t50_fid: $ + type: lagoon + subtype: null + name: $ + group_name: null + height: null + elevation: $ + perennial: null + temperature_indicator: null + theme: landcover + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-lagoon-polygons-topo-150k + name: nz_chatham_island_lagoon_polygons_topo_150k + mapping: *lagoon + # pi + - source: kart@data.koordinates.com:linz/cook-islands-lagoon-polygons-topo-125k-zone3 + name: cook_islands_lagoon_polygons_topo_125k_zone3 + mapping: *lagoon + - source: kart@data.koordinates.com:linz/cook-islands-lagoon-polygons-topo-125k-zone4 + name: cook_islands_lagoon_polygons_topo_125k_zone4 + mapping: *lagoon + - source: kart@data.koordinates.com:linz/tokelau-lagoon-polygons-topo-125k + name: tokelau_lagoon_polygons_topo_125k + mapping: *lagoon + + # -------- lake + # Per FTM schema feedback (item 830/880): lake_use -> subtype. + # nz + - source: kart@data.koordinates.com:linz/nz-lake-polygons-topo-150k-2 + name: nz_lake_polygons_topo_150k_2 + mapping: &lake + t50_fid: $ + type: lake + subtype: $lake_use + name: $ + group_name: $grp_name + height: null + elevation: $ + perennial: $ + temperature_indicator: null + theme: landcover + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-lake-polygons-topo-150k + name: nz_chatham_island_lake_polygons_topo_150k + mapping: *lake + # nzoi + - source: kart@data.koordinates.com:linz/nz-auckland-island-lake-polygons-topo-150k + name: nz_auckland_island_lake_polygons_topo_150k + mapping: *lake + - source: kart@data.koordinates.com:linz/nz-campbell-island-motu-ihupuku-lake-polygons-topo-150k + name: nz_campbell_island_motu_ihupuku_lake_polygons_topo_150k + mapping: *lake + - source: kart@data.koordinates.com:linz/nz-kermadec-is-lake-polygons-topo-125k + name: nz_kermadec_is_lake_polygons_topo_125k + mapping: *lake + - source: kart@data.koordinates.com:linz/nz-snares-island-tini-heke-lake-polygons-topo-125k + name: nz_snares_island_tini_heke_lake_polygons_topo_125k + mapping: *lake + # pi + - source: kart@data.koordinates.com:linz/cook-islands-lake-polygons-topo-125k-zone3 + name: cook_islands_lake_polygons_topo_125k_zone3 + mapping: *lake + - source: kart@data.koordinates.com:linz/cook-islands-lake-polygons-topo-125k-zone4 + name: cook_islands_lake_polygons_topo_125k_zone4 + mapping: *lake + # ant + - source: kart@data.koordinates.com:linz/nz-ross-dependency-lake-polygons-ant-150k + name: nz_ross_dependency_lake_polygons_ant_150k + mapping: + t50_fid: $ + type: lake + subtype: $lake_use + name: $ + group_name: $ + height: null + elevation: $ + perennial: $ + temperature_indicator: null + theme: landcover + metadata: null + - source: kart@data.koordinates.com:linz/nz-ross-dependency-glacial-lake-polygons-ant-150k + name: nz_ross_dependency_glacial_lake_polygons_ant_150k + mapping: + t50_fid: $ + type: lake + subtype: null + name: $ + group_name: null + height: null + elevation: null + perennial: null + temperature_indicator: null + theme: landcover + metadata: null + + # -------- pond + # nz + - source: kart@data.koordinates.com:linz/nz-pond-polygons-topo-150k + name: nz_pond_polygons_topo_150k + mapping: &pond + t50_fid: $ + type: pond + subtype: $pond_use + name: $ + group_name: null + height: null + elevation: null + perennial: null + temperature_indicator: null + theme: landcover + metadata: null + # pi + - source: kart@data.koordinates.com:linz/cook-islands-pond-polygons-topo-125k-zone4 + name: cook_islands_pond_polygons_topo_125k_zone4 + mapping: *pond + + # -------- river + # nz + - source: kart@data.koordinates.com:linz/nz-river-polygons-topo-150k + name: nz_river_polygons_topo_150k + mapping: &river + t50_fid: $ + type: river + subtype: null + name: null + group_name: null + height: null + elevation: null + perennial: null + temperature_indicator: null + theme: landcover + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-river-polygons-topo-150k + name: nz_chatham_island_river_polygons_topo_150k + mapping: *river + # pi + - source: kart@data.koordinates.com:linz/cook-islands-river-polygons-topo-125k-zone4 + name: cook_islands_river_polygons_topo_125k_zone4 + mapping: *river diff --git a/packages/kart-import/config/themes/water_line.yml b/packages/kart-import/config/themes/water_line.yml new file mode 100644 index 00000000..d38a92a6 --- /dev/null +++ b/packages/kart-import/config/themes/water_line.yml @@ -0,0 +1,69 @@ +name: water_line +target_repo: topographic-data +target_epsg: EPSG:4167 +datasets: + # -------- canal + # nz + - source: kart@data.koordinates.com:linz/nz-canal-centrelines-topo-150k + name: nz_canal_centrelines_topo_150k + mapping: + t50_fid: $ + type: canal + name: $ + theme: landcover + metadata: null + + # -------- drain + # nz + - source: kart@data.koordinates.com:linz/nz-drain-centrelines-topo-150k + name: nz_drain_centrelines_topo_150k + mapping: &drain + t50_fid: $ + type: drain + name: $ + theme: landcover + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-drain-centrelines-topo-150k + name: nz_chatham_island_drain_centrelines_topo_150k + mapping: *drain + # pi + - source: kart@data.koordinates.com:linz/cook-islands-drain-centrelines-topo-125k-zone4 + name: cook_islands_drain_centrelines_topo_125k_zone4 + mapping: *drain + + # -------- river + # nz + - source: kart@data.koordinates.com:linz/nz-river-centrelines-topo-150k + name: nz_river_centrelines_topo_150k + mapping: &river + t50_fid: $ + type: river + name: null + theme: landcover + metadata: null + - source: kart@data.koordinates.com:linz/nz-chatham-island-river-centrelines-topo-150k + name: nz_chatham_island_river_centrelines_topo_150k + mapping: *river + # nzoi + - source: kart@data.koordinates.com:linz/nz-antipodes-island-river-centrelines-topo-125k + name: nz_antipodes_island_river_centrelines_topo_125k + mapping: *river + - source: kart@data.koordinates.com:linz/nz-auckland-island-river-centrelines-topo-150k + name: nz_auckland_island_river_centrelines_topo_150k + mapping: *river + - source: kart@data.koordinates.com:linz/nz-campbell-island-motu-ihupuku-river-centrelines-topo-150k + name: nz_campbell_island_motu_ihupuku_river_centrelines_topo_150k + mapping: *river + - source: kart@data.koordinates.com:linz/nz-kermadec-is-river-centrelines-topo-125k + name: nz_kermadec_is_river_centrelines_topo_125k + mapping: *river + - source: kart@data.koordinates.com:linz/nz-snares-island-tini-heke-river-centrelines-topo-125k + name: nz_snares_island_tini_heke_river_centrelines_topo_125k + mapping: *river + # pi + - source: kart@data.koordinates.com:linz/cook-islands-river-centrelines-topo-125k-zone3 + name: cook_islands_river_centrelines_topo_125k_zone3 + mapping: *river + - source: kart@data.koordinates.com:linz/cook-islands-river-centrelines-topo-125k-zone4 + name: cook_islands_river_centrelines_topo_125k_zone4 + mapping: *river From 8c3392f32eae8118303464493ee5fb01d11279b7 Mon Sep 17 00:00:00 2001 From: Tawera Manaena Date: Fri, 4 Sep 2026 11:32:47 +1200 Subject: [PATCH 03/10] feat: comment out all datasets besides nz mainland and chatham islands --- .../kart-import/config/themes/structure.yml | 24 ++-- .../config/themes/structure_line.yml | 92 ++++++------ .../config/themes/structure_point.yml | 122 ++++++++-------- .../kart-import/config/themes/vegetation.yml | 100 ++++++------- packages/kart-import/config/themes/water.yml | 134 +++++++++--------- .../kart-import/config/themes/water_line.yml | 54 +++---- 6 files changed, 263 insertions(+), 263 deletions(-) diff --git a/packages/kart-import/config/themes/structure.yml b/packages/kart-import/config/themes/structure.yml index f88445eb..16bb3f60 100644 --- a/packages/kart-import/config/themes/structure.yml +++ b/packages/kart-import/config/themes/structure.yml @@ -65,10 +65,10 @@ datasets: name: null theme: structures metadata: null - # pi - - source: kart@data.koordinates.com:linz/cook-islands-reservoir-polygons-topo-125k-zone4 - name: cook_islands_reservoir_polygons_topo_125k_zone4 - mapping: *reservoir + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-reservoir-polygons-topo-125k-zone4 + # name: cook_islands_reservoir_polygons_topo_125k_zone4 + # mapping: *reservoir # -------- siphon # nz @@ -102,11 +102,11 @@ datasets: name: null theme: structures metadata: null - # pi - - source: kart@data.koordinates.com:linz/cook-islands-tank-polygons-topo-125k-zone4 - name: cook_islands_tank_polygons_topo_125k_zone4 - mapping: *tank - # ant - - source: kart@data.koordinates.com:linz/nz-ross-dependency-tank-polygons-ant-150k - name: nz_ross_dependency_tank_polygons_ant_150k - mapping: *tank + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-tank-polygons-topo-125k-zone4 + # name: cook_islands_tank_polygons_topo_125k_zone4 + # mapping: *tank + # # ant + # - source: kart@data.koordinates.com:linz/nz-ross-dependency-tank-polygons-ant-150k + # name: nz_ross_dependency_tank_polygons_ant_150k + # mapping: *tank diff --git a/packages/kart-import/config/themes/structure_line.yml b/packages/kart-import/config/themes/structure_line.yml index f758fc1d..f1016904 100644 --- a/packages/kart-import/config/themes/structure_line.yml +++ b/packages/kart-import/config/themes/structure_line.yml @@ -18,13 +18,13 @@ datasets: - source: kart@data.koordinates.com:linz/nz-chatham-island-boatramp-centrelines-topo-150k name: nz_chatham_island_boatramp_centrelines_topo_150k mapping: *boatramp - # pi - - source: kart@data.koordinates.com:linz/cook-islands-boatramp-centrelines-topo-125k-zone4 - name: cook_islands_boatramp_centrelines_topo_125k_zone4 - mapping: *boatramp - - source: kart@data.koordinates.com:linz/niue-boatramp-centrelines-topo-150k - name: niue_boatramp_centrelines_topo_150k - mapping: *boatramp + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-boatramp-centrelines-topo-125k-zone4 + # name: cook_islands_boatramp_centrelines_topo_125k_zone4 + # mapping: *boatramp + # - source: kart@data.koordinates.com:linz/niue-boatramp-centrelines-topo-150k + # name: niue_boatramp_centrelines_topo_150k + # mapping: *boatramp # -------- boom # nz @@ -56,13 +56,13 @@ datasets: - source: kart@data.koordinates.com:linz/nz-chatham-island-breakwater-centrelines-topo-150k name: nz_chatham_island_breakwater_centrelines_topo_150k mapping: *breakwater - # pi - - source: kart@data.koordinates.com:linz/cook-islands-breakwater-centrelines-topo-125k-zone4 - name: cook_islands_breakwater_centrelines_topo_125k_zone4 - mapping: *breakwater - - source: kart@data.koordinates.com:linz/tokelau-breakwater-centrelines-topo-125k - name: tokelau_breakwater_centrelines_topo_125k - mapping: *breakwater + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-breakwater-centrelines-topo-125k-zone4 + # name: cook_islands_breakwater_centrelines_topo_125k_zone4 + # mapping: *breakwater + # - source: kart@data.koordinates.com:linz/tokelau-breakwater-centrelines-topo-125k + # name: tokelau_breakwater_centrelines_topo_125k + # mapping: *breakwater # -------- cableway_industrial # Per FTM schema feedback (BM-1754): material_conveyed -> subtype (only @@ -95,10 +95,10 @@ datasets: name: null theme: structures metadata: null - # nzoi - - source: kart@data.koordinates.com:linz/nz-kermadec-is-cableway-people-centrelines-topo-125k - name: nz_kermadec_is_cableway_people_centrelines_topo_125k - mapping: *cableway_people + # # nzoi + # - source: kart@data.koordinates.com:linz/nz-kermadec-is-cableway-people-centrelines-topo-125k + # name: nz_kermadec_is_cableway_people_centrelines_topo_125k + # mapping: *cableway_people # -------- dam # nz @@ -188,10 +188,10 @@ datasets: name: null theme: structures metadata: null - # ant - - source: kart@data.koordinates.com:linz/nz-ross-dependency-ski-tow-centrelines-ant-150k - name: nz_ross_dependency_ski_tow_centrelines_ant_150k - mapping: *ski_tow + # # ant + # - source: kart@data.koordinates.com:linz/nz-ross-dependency-ski-tow-centrelines-ant-150k + # name: nz_ross_dependency_ski_tow_centrelines_ant_150k + # mapping: *ski_tow # -------- slipway # nz @@ -281,16 +281,16 @@ datasets: - source: kart@data.koordinates.com:linz/nz-chatham-island-wharf-centrelines-topo-150k name: nz_chatham_island_wharf_centrelines_topo_150k mapping: *wharf - # pi - - source: kart@data.koordinates.com:linz/cook-islands-wharf-centrelines-topo-125k-zone3 - name: cook_islands_wharf_centrelines_topo_125k_zone3 - mapping: *wharf - - source: kart@data.koordinates.com:linz/cook-islands-wharf-centrelines-topo-125k-zone4 - name: cook_islands_wharf_centrelines_topo_125k_zone4 - mapping: *wharf - - source: kart@data.koordinates.com:linz/tokelau-wharf-centrelines-topo-125k - name: tokelau_wharf_centrelines_topo_125k - mapping: *wharf + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-wharf-centrelines-topo-125k-zone3 + # name: cook_islands_wharf_centrelines_topo_125k_zone3 + # mapping: *wharf + # - source: kart@data.koordinates.com:linz/cook-islands-wharf-centrelines-topo-125k-zone4 + # name: cook_islands_wharf_centrelines_topo_125k_zone4 + # mapping: *wharf + # - source: kart@data.koordinates.com:linz/tokelau-wharf-centrelines-topo-125k + # name: tokelau_wharf_centrelines_topo_125k + # mapping: *wharf # -------- wharf_edge # nz @@ -305,17 +305,17 @@ datasets: name: null theme: structures metadata: null - # pi - - source: kart@data.koordinates.com:linz/cook-islands-wharf-edges-topo-125k-zone4 - name: cook_islands_wharf_edges_topo_125k_zone4 - mapping: *wharf_edge - - source: kart@data.koordinates.com:linz/niue-wharf-edges-topo-150k - name: niue_wharf_edges_topo_150k - mapping: *wharf_edge - - source: kart@data.koordinates.com:linz/tokelau-wharf-edges-topo-125k - name: tokelau_wharf_edges_topo_125k - mapping: *wharf_edge - # ant - - source: kart@data.koordinates.com:linz/nz-ross-dependency-wharf-edges-ant-150k - name: nz_ross_dependency_wharf_edges_ant_150k - mapping: *wharf_edge + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-wharf-edges-topo-125k-zone4 + # name: cook_islands_wharf_edges_topo_125k_zone4 + # mapping: *wharf_edge + # - source: kart@data.koordinates.com:linz/niue-wharf-edges-topo-150k + # name: niue_wharf_edges_topo_150k + # mapping: *wharf_edge + # - source: kart@data.koordinates.com:linz/tokelau-wharf-edges-topo-125k + # name: tokelau_wharf_edges_topo_125k + # mapping: *wharf_edge + # # ant + # - source: kart@data.koordinates.com:linz/nz-ross-dependency-wharf-edges-ant-150k + # name: nz_ross_dependency_wharf_edges_ant_150k + # mapping: *wharf_edge diff --git a/packages/kart-import/config/themes/structure_point.yml b/packages/kart-import/config/themes/structure_point.yml index f89ddbf0..fb64f773 100644 --- a/packages/kart-import/config/themes/structure_point.yml +++ b/packages/kart-import/config/themes/structure_point.yml @@ -31,20 +31,20 @@ datasets: name: nz_chatham_island_beacon_points_topo_150k mapping: *beacon corrections: *beacon_corrections - # pi - - source: kart@data.koordinates.com:linz/cook-islands-beacon-points-topo-150k-zone3 - name: cook_islands_beacon_points_topo_150k_zone3 - mapping: *beacon - corrections: *beacon_corrections - - source: kart@data.koordinates.com:linz/cook-islands-beacon-points-topo-125k-zone4 - name: cook_islands_beacon_points_topo_125k_zone4 - mapping: *beacon - corrections: *beacon_corrections - # ant - - source: kart@data.koordinates.com:linz/nz-ross-dependency-beacon-points-ant-150k - name: nz_ross_dependency_beacon_points_ant_150k - mapping: *beacon - corrections: *beacon_corrections + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-beacon-points-topo-150k-zone3 + # name: cook_islands_beacon_points_topo_150k_zone3 + # mapping: *beacon + # corrections: *beacon_corrections + # - source: kart@data.koordinates.com:linz/cook-islands-beacon-points-topo-125k-zone4 + # name: cook_islands_beacon_points_topo_125k_zone4 + # mapping: *beacon + # corrections: *beacon_corrections + # # ant + # - source: kart@data.koordinates.com:linz/nz-ross-dependency-beacon-points-ant-150k + # name: nz_ross_dependency_beacon_points_ant_150k + # mapping: *beacon + # corrections: *beacon_corrections # -------- bivouac # Per FTM schema feedback (item 240, Agreed): bivouac_material -> subtype, @@ -210,20 +210,20 @@ datasets: - source: kart@data.koordinates.com:linz/nz-chatham-island-mast-points-topo-150k name: nz_chatham_island_mast_points_topo_150k mapping: *mast - # pi - - source: kart@data.koordinates.com:linz/cook-islands-mast-points-topo-125k-zone4 - name: cook_islands_mast_points_topo_125k_zone4 - mapping: *mast - - source: kart@data.koordinates.com:linz/niue-mast-points-topo-150k - name: niue_mast_points_topo_150k - mapping: *mast - - source: kart@data.koordinates.com:linz/tokelau-mast-points-topo-125k - name: tokelau_mast_points_topo_125k - mapping: *mast - # ant - - source: kart@data.koordinates.com:linz/nz-ross-dependency-mast-points-ant-150k - name: nz_ross_dependency_mast_points_ant_150k - mapping: *mast + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-mast-points-topo-125k-zone4 + # name: cook_islands_mast_points_topo_125k_zone4 + # mapping: *mast + # - source: kart@data.koordinates.com:linz/niue-mast-points-topo-150k + # name: niue_mast_points_topo_150k + # mapping: *mast + # - source: kart@data.koordinates.com:linz/tokelau-mast-points-topo-125k + # name: tokelau_mast_points_topo_125k + # mapping: *mast + # # ant + # - source: kart@data.koordinates.com:linz/nz-ross-dependency-mast-points-ant-150k + # name: nz_ross_dependency_mast_points_ant_150k + # mapping: *mast # -------- radar_dome # nz @@ -347,17 +347,17 @@ datasets: - source: kart@data.koordinates.com:linz/nz-chatham-island-tank-points-topo-150k name: nz_chatham_island_tank_points_topo_150k mapping: *tank - # pi - - source: kart@data.koordinates.com:linz/cook-islands-tank-points-topo-125k-zone4 - name: cook_islands_tank_points_topo_125k_zone4 - mapping: *tank - - source: kart@data.koordinates.com:linz/niue-tank-points-topo-150k - name: niue_tank_points_topo_150k - mapping: *tank - # ant - - source: kart@data.koordinates.com:linz/nz-ross-dependency-tank-points-ant-150k - name: nz_ross_dependency_tank_points_ant_150k - mapping: *tank + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-tank-points-topo-125k-zone4 + # name: cook_islands_tank_points_topo_125k_zone4 + # mapping: *tank + # - source: kart@data.koordinates.com:linz/niue-tank-points-topo-150k + # name: niue_tank_points_topo_150k + # mapping: *tank + # # ant + # - source: kart@data.koordinates.com:linz/nz-ross-dependency-tank-points-ant-150k + # name: nz_ross_dependency_tank_points_ant_150k + # mapping: *tank # -------- tower # Per FTM schema feedback (page 19): tower material -> subtype. @@ -391,13 +391,13 @@ datasets: orientation: null theme: structures metadata: null - # pi - - source: kart@data.koordinates.com:linz/niue-well-points-topo-150k - name: niue_well_points_topo_150k - mapping: *well - - source: kart@data.koordinates.com:linz/tokelau-well-points-topo-125k - name: tokelau_well_points_topo_125k - mapping: *well + # # pi + # - source: kart@data.koordinates.com:linz/niue-well-points-topo-150k + # name: niue_well_points_topo_150k + # mapping: *well + # - source: kart@data.koordinates.com:linz/tokelau-well-points-topo-125k + # name: tokelau_well_points_topo_125k + # mapping: *well # -------- windmill # Per FTM schema feedback (page 19): windmill use -> subtype. @@ -418,10 +418,10 @@ datasets: - source: kart@data.koordinates.com:linz/nz-chatham-island-windmill-points-topo-1250k name: nz_chatham_island_windmill_points_topo_1250k mapping: *windmill - # ant - - source: kart@data.koordinates.com:linz/nz-ross-dependency-windmill-points-ant-150k - name: nz_ross_dependency_windmill_points_ant_150k - mapping: *windmill + # # ant + # - source: kart@data.koordinates.com:linz/nz-ross-dependency-windmill-points-ant-150k + # name: nz_ross_dependency_windmill_points_ant_150k + # mapping: *windmill # -------- wreck # Per FTM schema feedback (page 19): wreck_of -> subtype. @@ -442,14 +442,14 @@ datasets: - source: kart@data.koordinates.com:linz/nz-chatham-island-wreck-points-topo-150k name: nz_chatham_island_wreck_points_topo_150k mapping: *wreck - # nzoi - - source: kart@data.koordinates.com:linz/nz-auckland-island-wreck-points-topo-150k - name: nz_auckland_island_wreck_points_topo_150k - mapping: *wreck - - source: kart@data.koordinates.com:linz/nz-kermadec-is-wreck-points-topo-125k - name: nz_kermadec_is_wreck_points_topo_125k - mapping: *wreck - # pi - - source: kart@data.koordinates.com:linz/niue-wreck-points-topo-150k - name: niue_wreck_points_topo_150k - mapping: *wreck + # # nzoi + # - source: kart@data.koordinates.com:linz/nz-auckland-island-wreck-points-topo-150k + # name: nz_auckland_island_wreck_points_topo_150k + # mapping: *wreck + # - source: kart@data.koordinates.com:linz/nz-kermadec-is-wreck-points-topo-125k + # name: nz_kermadec_is_wreck_points_topo_125k + # mapping: *wreck + # # pi + # - source: kart@data.koordinates.com:linz/niue-wreck-points-topo-150k + # name: niue_wreck_points_topo_150k + # mapping: *wreck diff --git a/packages/kart-import/config/themes/vegetation.yml b/packages/kart-import/config/themes/vegetation.yml index ff22a8eb..0ea52dd6 100644 --- a/packages/kart-import/config/themes/vegetation.yml +++ b/packages/kart-import/config/themes/vegetation.yml @@ -31,29 +31,29 @@ datasets: - source: kart@data.koordinates.com:linz/nz-chatham-island-native-polygons-topo-150k name: nz_chatham_island_native_polygons_topo_150k mapping: *native - # nzoi - - source: kart@data.koordinates.com:linz/nz-auckland-island-native-polygons-topo-150k - name: nz_auckland_island_native_polygons_topo_150k - mapping: *native - - source: kart@data.koordinates.com:linz/nz-kermadec-is-native-polygons-topo-125k - name: nz_kermadec_is_native_polygons_topo_125k - mapping: *native - - source: kart@data.koordinates.com:linz/nz-snares-island-tini-heke-native-polygons-topo-125k - name: nz_snares_island_tini_heke_native_polygons_topo_125k - mapping: *native - # pi - - source: kart@data.koordinates.com:linz/cook-islands-native-polygons-topo-125k-zone3 - name: cook_islands_native_polygons_topo_125k_zone3 - mapping: *native - - source: kart@data.koordinates.com:linz/cook-islands-native-polygons-topo-125k-zone4 - name: cook_islands_native_polygons_topo_125k_zone4 - mapping: *native - - source: kart@data.koordinates.com:linz/niue-native-polygons-topo-150k - name: niue_native_polygons_topo_150k - mapping: *native - - source: kart@data.koordinates.com:linz/tokelau-native-polygons-topo-125k - name: tokelau_native_polygons_topo_125k - mapping: *native + # # nzoi + # - source: kart@data.koordinates.com:linz/nz-auckland-island-native-polygons-topo-150k + # name: nz_auckland_island_native_polygons_topo_150k + # mapping: *native + # - source: kart@data.koordinates.com:linz/nz-kermadec-is-native-polygons-topo-125k + # name: nz_kermadec_is_native_polygons_topo_125k + # mapping: *native + # - source: kart@data.koordinates.com:linz/nz-snares-island-tini-heke-native-polygons-topo-125k + # name: nz_snares_island_tini_heke_native_polygons_topo_125k + # mapping: *native + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-native-polygons-topo-125k-zone3 + # name: cook_islands_native_polygons_topo_125k_zone3 + # mapping: *native + # - source: kart@data.koordinates.com:linz/cook-islands-native-polygons-topo-125k-zone4 + # name: cook_islands_native_polygons_topo_125k_zone4 + # mapping: *native + # - source: kart@data.koordinates.com:linz/niue-native-polygons-topo-150k + # name: niue_native_polygons_topo_150k + # mapping: *native + # - source: kart@data.koordinates.com:linz/tokelau-native-polygons-topo-125k + # name: tokelau_native_polygons_topo_125k + # mapping: *native # -------- scattered_scrub # nz @@ -68,10 +68,10 @@ datasets: - source: kart@data.koordinates.com:linz/nz-chatham-island-scattered-scrub-polygons-topo-150k name: nz_chatham_island_scattered_scrub_polygons_topo_150k mapping: *scattered_scrub - # pi - - source: kart@data.koordinates.com:linz/cook-islands-scattered-scrub-polygons-topo-125k-zone4 - name: cook_islands_scattered_scrub_polygons_topo_125k_zone4 - mapping: *scattered_scrub + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-scattered-scrub-polygons-topo-125k-zone4 + # name: cook_islands_scattered_scrub_polygons_topo_125k_zone4 + # mapping: *scattered_scrub # -------- scrub # nz @@ -86,26 +86,26 @@ datasets: - source: kart@data.koordinates.com:linz/nz-chatham-island-scrub-polygons-topo-150k name: nz_chatham_island_scrub_polygons_topo_150k mapping: *scrub - # nzoi - - source: kart@data.koordinates.com:linz/nz-campbell-island-motu-ihupuku-scrub-polygons-topo-150k - name: nz_campbell_island_motu_ihupuku_scrub_polygons_topo_150k - mapping: *scrub - - source: kart@data.koordinates.com:linz/nz-kermadec-is-scrub-polygons-topo-125k - name: nz_kermadec_is_scrub_polygons_topo_125k - mapping: *scrub - - source: kart@data.koordinates.com:linz/nz-snares-island-tini-heke-scrub-polygons-topo-125k - name: nz_snares_island_tini_heke_scrub_polygons_topo_125k - mapping: *scrub - # pi - - source: kart@data.koordinates.com:linz/cook-islands-scrub-polygons-topo-125k-zone3 - name: cook_islands_scrub_polygons_topo_125k_zone3 - mapping: *scrub - - source: kart@data.koordinates.com:linz/cook-islands-scrub-polygons-topo-125k-zone4 - name: cook_islands_scrub_polygons_topo_125k_zone4 - mapping: *scrub - - source: kart@data.koordinates.com:linz/niue-scrub-polygons-topo-150k - name: niue_scrub_polygons_topo_150k - mapping: *scrub - - source: kart@data.koordinates.com:linz/tokelau-scrub-polygons-topo-125k - name: tokelau_scrub_polygons_topo_125k - mapping: *scrub + # # nzoi + # - source: kart@data.koordinates.com:linz/nz-campbell-island-motu-ihupuku-scrub-polygons-topo-150k + # name: nz_campbell_island_motu_ihupuku_scrub_polygons_topo_150k + # mapping: *scrub + # - source: kart@data.koordinates.com:linz/nz-kermadec-is-scrub-polygons-topo-125k + # name: nz_kermadec_is_scrub_polygons_topo_125k + # mapping: *scrub + # - source: kart@data.koordinates.com:linz/nz-snares-island-tini-heke-scrub-polygons-topo-125k + # name: nz_snares_island_tini_heke_scrub_polygons_topo_125k + # mapping: *scrub + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-scrub-polygons-topo-125k-zone3 + # name: cook_islands_scrub_polygons_topo_125k_zone3 + # mapping: *scrub + # - source: kart@data.koordinates.com:linz/cook-islands-scrub-polygons-topo-125k-zone4 + # name: cook_islands_scrub_polygons_topo_125k_zone4 + # mapping: *scrub + # - source: kart@data.koordinates.com:linz/niue-scrub-polygons-topo-150k + # name: niue_scrub_polygons_topo_150k + # mapping: *scrub + # - source: kart@data.koordinates.com:linz/tokelau-scrub-polygons-topo-125k + # name: tokelau_scrub_polygons_topo_125k + # mapping: *scrub diff --git a/packages/kart-import/config/themes/water.yml b/packages/kart-import/config/themes/water.yml index 2fb35a12..ab68580c 100644 --- a/packages/kart-import/config/themes/water.yml +++ b/packages/kart-import/config/themes/water.yml @@ -38,16 +38,16 @@ datasets: - source: kart@data.koordinates.com:linz/nz-chatham-island-lagoon-polygons-topo-150k name: nz_chatham_island_lagoon_polygons_topo_150k mapping: *lagoon - # pi - - source: kart@data.koordinates.com:linz/cook-islands-lagoon-polygons-topo-125k-zone3 - name: cook_islands_lagoon_polygons_topo_125k_zone3 - mapping: *lagoon - - source: kart@data.koordinates.com:linz/cook-islands-lagoon-polygons-topo-125k-zone4 - name: cook_islands_lagoon_polygons_topo_125k_zone4 - mapping: *lagoon - - source: kart@data.koordinates.com:linz/tokelau-lagoon-polygons-topo-125k - name: tokelau_lagoon_polygons_topo_125k - mapping: *lagoon + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-lagoon-polygons-topo-125k-zone3 + # name: cook_islands_lagoon_polygons_topo_125k_zone3 + # mapping: *lagoon + # - source: kart@data.koordinates.com:linz/cook-islands-lagoon-polygons-topo-125k-zone4 + # name: cook_islands_lagoon_polygons_topo_125k_zone4 + # mapping: *lagoon + # - source: kart@data.koordinates.com:linz/tokelau-lagoon-polygons-topo-125k + # name: tokelau_lagoon_polygons_topo_125k + # mapping: *lagoon # -------- lake # Per FTM schema feedback (item 830/880): lake_use -> subtype. @@ -69,55 +69,55 @@ datasets: - source: kart@data.koordinates.com:linz/nz-chatham-island-lake-polygons-topo-150k name: nz_chatham_island_lake_polygons_topo_150k mapping: *lake - # nzoi - - source: kart@data.koordinates.com:linz/nz-auckland-island-lake-polygons-topo-150k - name: nz_auckland_island_lake_polygons_topo_150k - mapping: *lake - - source: kart@data.koordinates.com:linz/nz-campbell-island-motu-ihupuku-lake-polygons-topo-150k - name: nz_campbell_island_motu_ihupuku_lake_polygons_topo_150k - mapping: *lake - - source: kart@data.koordinates.com:linz/nz-kermadec-is-lake-polygons-topo-125k - name: nz_kermadec_is_lake_polygons_topo_125k - mapping: *lake - - source: kart@data.koordinates.com:linz/nz-snares-island-tini-heke-lake-polygons-topo-125k - name: nz_snares_island_tini_heke_lake_polygons_topo_125k - mapping: *lake - # pi - - source: kart@data.koordinates.com:linz/cook-islands-lake-polygons-topo-125k-zone3 - name: cook_islands_lake_polygons_topo_125k_zone3 - mapping: *lake - - source: kart@data.koordinates.com:linz/cook-islands-lake-polygons-topo-125k-zone4 - name: cook_islands_lake_polygons_topo_125k_zone4 - mapping: *lake - # ant - - source: kart@data.koordinates.com:linz/nz-ross-dependency-lake-polygons-ant-150k - name: nz_ross_dependency_lake_polygons_ant_150k - mapping: - t50_fid: $ - type: lake - subtype: $lake_use - name: $ - group_name: $ - height: null - elevation: $ - perennial: $ - temperature_indicator: null - theme: landcover - metadata: null - - source: kart@data.koordinates.com:linz/nz-ross-dependency-glacial-lake-polygons-ant-150k - name: nz_ross_dependency_glacial_lake_polygons_ant_150k - mapping: - t50_fid: $ - type: lake - subtype: null - name: $ - group_name: null - height: null - elevation: null - perennial: null - temperature_indicator: null - theme: landcover - metadata: null + # # nzoi + # - source: kart@data.koordinates.com:linz/nz-auckland-island-lake-polygons-topo-150k + # name: nz_auckland_island_lake_polygons_topo_150k + # mapping: *lake + # - source: kart@data.koordinates.com:linz/nz-campbell-island-motu-ihupuku-lake-polygons-topo-150k + # name: nz_campbell_island_motu_ihupuku_lake_polygons_topo_150k + # mapping: *lake + # - source: kart@data.koordinates.com:linz/nz-kermadec-is-lake-polygons-topo-125k + # name: nz_kermadec_is_lake_polygons_topo_125k + # mapping: *lake + # - source: kart@data.koordinates.com:linz/nz-snares-island-tini-heke-lake-polygons-topo-125k + # name: nz_snares_island_tini_heke_lake_polygons_topo_125k + # mapping: *lake + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-lake-polygons-topo-125k-zone3 + # name: cook_islands_lake_polygons_topo_125k_zone3 + # mapping: *lake + # - source: kart@data.koordinates.com:linz/cook-islands-lake-polygons-topo-125k-zone4 + # name: cook_islands_lake_polygons_topo_125k_zone4 + # mapping: *lake + # # ant + # - source: kart@data.koordinates.com:linz/nz-ross-dependency-lake-polygons-ant-150k + # name: nz_ross_dependency_lake_polygons_ant_150k + # mapping: + # t50_fid: $ + # type: lake + # subtype: $lake_use + # name: $ + # group_name: $ + # height: null + # elevation: $ + # perennial: $ + # temperature_indicator: null + # theme: landcover + # metadata: null + # - source: kart@data.koordinates.com:linz/nz-ross-dependency-glacial-lake-polygons-ant-150k + # name: nz_ross_dependency_glacial_lake_polygons_ant_150k + # mapping: + # t50_fid: $ + # type: lake + # subtype: null + # name: $ + # group_name: null + # height: null + # elevation: null + # perennial: null + # temperature_indicator: null + # theme: landcover + # metadata: null # -------- pond # nz @@ -135,10 +135,10 @@ datasets: temperature_indicator: null theme: landcover metadata: null - # pi - - source: kart@data.koordinates.com:linz/cook-islands-pond-polygons-topo-125k-zone4 - name: cook_islands_pond_polygons_topo_125k_zone4 - mapping: *pond + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-pond-polygons-topo-125k-zone4 + # name: cook_islands_pond_polygons_topo_125k_zone4 + # mapping: *pond # -------- river # nz @@ -159,7 +159,7 @@ datasets: - source: kart@data.koordinates.com:linz/nz-chatham-island-river-polygons-topo-150k name: nz_chatham_island_river_polygons_topo_150k mapping: *river - # pi - - source: kart@data.koordinates.com:linz/cook-islands-river-polygons-topo-125k-zone4 - name: cook_islands_river_polygons_topo_125k_zone4 - mapping: *river + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-river-polygons-topo-125k-zone4 + # name: cook_islands_river_polygons_topo_125k_zone4 + # mapping: *river diff --git a/packages/kart-import/config/themes/water_line.yml b/packages/kart-import/config/themes/water_line.yml index d38a92a6..d95110a4 100644 --- a/packages/kart-import/config/themes/water_line.yml +++ b/packages/kart-import/config/themes/water_line.yml @@ -26,10 +26,10 @@ datasets: - source: kart@data.koordinates.com:linz/nz-chatham-island-drain-centrelines-topo-150k name: nz_chatham_island_drain_centrelines_topo_150k mapping: *drain - # pi - - source: kart@data.koordinates.com:linz/cook-islands-drain-centrelines-topo-125k-zone4 - name: cook_islands_drain_centrelines_topo_125k_zone4 - mapping: *drain + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-drain-centrelines-topo-125k-zone4 + # name: cook_islands_drain_centrelines_topo_125k_zone4 + # mapping: *drain # -------- river # nz @@ -44,26 +44,26 @@ datasets: - source: kart@data.koordinates.com:linz/nz-chatham-island-river-centrelines-topo-150k name: nz_chatham_island_river_centrelines_topo_150k mapping: *river - # nzoi - - source: kart@data.koordinates.com:linz/nz-antipodes-island-river-centrelines-topo-125k - name: nz_antipodes_island_river_centrelines_topo_125k - mapping: *river - - source: kart@data.koordinates.com:linz/nz-auckland-island-river-centrelines-topo-150k - name: nz_auckland_island_river_centrelines_topo_150k - mapping: *river - - source: kart@data.koordinates.com:linz/nz-campbell-island-motu-ihupuku-river-centrelines-topo-150k - name: nz_campbell_island_motu_ihupuku_river_centrelines_topo_150k - mapping: *river - - source: kart@data.koordinates.com:linz/nz-kermadec-is-river-centrelines-topo-125k - name: nz_kermadec_is_river_centrelines_topo_125k - mapping: *river - - source: kart@data.koordinates.com:linz/nz-snares-island-tini-heke-river-centrelines-topo-125k - name: nz_snares_island_tini_heke_river_centrelines_topo_125k - mapping: *river - # pi - - source: kart@data.koordinates.com:linz/cook-islands-river-centrelines-topo-125k-zone3 - name: cook_islands_river_centrelines_topo_125k_zone3 - mapping: *river - - source: kart@data.koordinates.com:linz/cook-islands-river-centrelines-topo-125k-zone4 - name: cook_islands_river_centrelines_topo_125k_zone4 - mapping: *river + # # nzoi + # - source: kart@data.koordinates.com:linz/nz-antipodes-island-river-centrelines-topo-125k + # name: nz_antipodes_island_river_centrelines_topo_125k + # mapping: *river + # - source: kart@data.koordinates.com:linz/nz-auckland-island-river-centrelines-topo-150k + # name: nz_auckland_island_river_centrelines_topo_150k + # mapping: *river + # - source: kart@data.koordinates.com:linz/nz-campbell-island-motu-ihupuku-river-centrelines-topo-150k + # name: nz_campbell_island_motu_ihupuku_river_centrelines_topo_150k + # mapping: *river + # - source: kart@data.koordinates.com:linz/nz-kermadec-is-river-centrelines-topo-125k + # name: nz_kermadec_is_river_centrelines_topo_125k + # mapping: *river + # - source: kart@data.koordinates.com:linz/nz-snares-island-tini-heke-river-centrelines-topo-125k + # name: nz_snares_island_tini_heke_river_centrelines_topo_125k + # mapping: *river + # # pi + # - source: kart@data.koordinates.com:linz/cook-islands-river-centrelines-topo-125k-zone3 + # name: cook_islands_river_centrelines_topo_125k_zone3 + # mapping: *river + # - source: kart@data.koordinates.com:linz/cook-islands-river-centrelines-topo-125k-zone4 + # name: cook_islands_river_centrelines_topo_125k_zone4 + # mapping: *river From 473634bd754bd9c69ee3ee37a0119f03c9649b64 Mon Sep 17 00:00:00 2001 From: Tawera Manaena Date: Wed, 9 Sep 2026 09:33:37 +1200 Subject: [PATCH 04/10] fix: disable chatham islands windmill points --- .../config/themes/structure_point.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/kart-import/config/themes/structure_point.yml b/packages/kart-import/config/themes/structure_point.yml index fb64f773..2c0c35bd 100644 --- a/packages/kart-import/config/themes/structure_point.yml +++ b/packages/kart-import/config/themes/structure_point.yml @@ -404,7 +404,7 @@ datasets: # nz - source: kart@data.koordinates.com:linz/nz-windmill-points-topo-150k name: nz_windmill_points_topo_150k - mapping: &windmill + mapping: t50_fid: $ type: windmill subtype: $use @@ -415,9 +415,20 @@ datasets: orientation: null theme: structures metadata: null - - source: kart@data.koordinates.com:linz/nz-chatham-island-windmill-points-topo-1250k - name: nz_chatham_island_windmill_points_topo_1250k - mapping: *windmill + # # FIXME: throws a 'Change without fid' exception + # - source: kart@data.koordinates.com:linz/nz-chatham-island-windmill-points-topo-1250k + # name: nz_chatham_island_windmill_points_topo_1250k + # mapping: + # t50_fid: $t250_fid # different attribute name + # type: windmill + # subtype: $use + # tank_type: null + # status: null + # name: null + # height: null + # orientation: null + # theme: structures + # metadata: null # # ant # - source: kart@data.koordinates.com:linz/nz-ross-dependency-windmill-points-ant-150k # name: nz_ross_dependency_windmill_points_ant_150k From a23c6cedaa381100e684b8c1f453df3b1bd55733 Mon Sep 17 00:00:00 2001 From: Tawera Manaena Date: Wed, 9 Sep 2026 14:39:27 +1200 Subject: [PATCH 05/10] fix: subtype corrections --- .../config/themes/structure_point.yml | 16 ++++++++++++++++ packages/kart-import/config/themes/water.yml | 10 ++++++++++ 2 files changed, 26 insertions(+) diff --git a/packages/kart-import/config/themes/structure_point.yml b/packages/kart-import/config/themes/structure_point.yml index 2c0c35bd..1bed2806 100644 --- a/packages/kart-import/config/themes/structure_point.yml +++ b/packages/kart-import/config/themes/structure_point.yml @@ -292,6 +292,10 @@ datasets: orientation: null theme: structures metadata: null + corrections: + - column: subtype + replace: + 'tunnel ventilation': tunnel_ventilation # -------- siphon # nz @@ -344,9 +348,17 @@ datasets: orientation: null theme: structures metadata: null + corrections: &tank_type_corrections + - column: tank_type + replace: + 'surge chamber': surge_chamber + - column: subtype + replace: + 'watre': water # source typo, 1 feature - source: kart@data.koordinates.com:linz/nz-chatham-island-tank-points-topo-150k name: nz_chatham_island_tank_points_topo_150k mapping: *tank + corrections: *tank_type_corrections # # pi # - source: kart@data.koordinates.com:linz/cook-islands-tank-points-topo-125k-zone4 # name: cook_islands_tank_points_topo_125k_zone4 @@ -415,6 +427,10 @@ datasets: orientation: null theme: structures metadata: null + corrections: + - column: subtype + replace: + 'power generation': power_generation # # FIXME: throws a 'Change without fid' exception # - source: kart@data.koordinates.com:linz/nz-chatham-island-windmill-points-topo-1250k # name: nz_chatham_island_windmill_points_topo_1250k diff --git a/packages/kart-import/config/themes/water.yml b/packages/kart-import/config/themes/water.yml index ab68580c..9bec14b5 100644 --- a/packages/kart-import/config/themes/water.yml +++ b/packages/kart-import/config/themes/water.yml @@ -66,9 +66,14 @@ datasets: temperature_indicator: null theme: landcover metadata: null + corrections: &lake_subtype_corrections + - column: subtype + replace: + 'hydro-electric': hydro_electric - source: kart@data.koordinates.com:linz/nz-chatham-island-lake-polygons-topo-150k name: nz_chatham_island_lake_polygons_topo_150k mapping: *lake + corrections: *lake_subtype_corrections # # nzoi # - source: kart@data.koordinates.com:linz/nz-auckland-island-lake-polygons-topo-150k # name: nz_auckland_island_lake_polygons_topo_150k @@ -135,6 +140,11 @@ datasets: temperature_indicator: null theme: landcover metadata: null + corrections: + - column: subtype + replace: + 'ice skating': ice_skating + 'sewage treatment': sewage_treatment # # pi # - source: kart@data.koordinates.com:linz/cook-islands-pond-polygons-topo-125k-zone4 # name: cook_islands_pond_polygons_topo_125k_zone4 From 8d72f95015f0b3ac3d917c52efcc105214784820 Mon Sep 17 00:00:00 2001 From: Tawera Manaena Date: Fri, 11 Sep 2026 17:16:12 +1200 Subject: [PATCH 06/10] feat: implement gazfeatid lookups --- packages/kart-import/config/themes/water.yml | 119 ++++++++++++++++-- .../kart-import/config/themes/water_line.yml | 79 ++++++++++-- .../kart-import/src/kart_import/fixups.py | 59 +++++++++ .../src/kart_import/fixups_test.py | 101 +++++++++++++++ 4 files changed, 336 insertions(+), 22 deletions(-) diff --git a/packages/kart-import/config/themes/water.yml b/packages/kart-import/config/themes/water.yml index 9bec14b5..21e4116c 100644 --- a/packages/kart-import/config/themes/water.yml +++ b/packages/kart-import/config/themes/water.yml @@ -1,6 +1,46 @@ name: water target_repo: topographic-data target_epsg: EPSG:4167 +lookups: + # -------- canal + - name: canal_poly_lkp + source: + url: git@github.com:linz/topographic-source-data + dataset: canal_poly + key: t50_fid + columns: + - gazfeatid + - name + + # -------- lagoon + - name: lagoon_poly_lkp + source: + url: git@github.com:linz/topographic-source-data + dataset: lagoon_poly + key: t50_fid + columns: + # no `gazfeatid` + - name + + # -------- lake + - name: lake_poly_lkp + source: + url: git@github.com:linz/topographic-source-data + dataset: lake_poly + key: t50_fid + columns: + # no `gazfeatid` + - name + + # -------- river + - name: river_poly_lkp + source: + url: git@github.com:linz/topographic-source-data + dataset: river_poly + key: t50_fid + columns: + - gazfeatid + - name datasets: # -------- canal # nz @@ -10,24 +50,29 @@ datasets: t50_fid: $ type: canal subtype: null - name: $ + name: $canal_poly_lkp.name group_name: null height: null elevation: null perennial: null temperature_indicator: null theme: landcover - metadata: null + metadata: { source: $canal_poly_lkp.gazfeatid, fixup: true } + joins: + - lookup: canal_poly_lkp + left_on: t50_fid + fixups: + - fn: build_nzgb_metadata # -------- lagoon # nz - source: kart@data.koordinates.com:linz/nz-lagoon-polygons-topo-150k name: nz_lagoon_polygons_topo_150k - mapping: &lagoon + mapping: t50_fid: $ type: lagoon subtype: null - name: $ + name: $lagoon_poly_lkp.name group_name: null height: null elevation: $ @@ -35,9 +80,25 @@ datasets: temperature_indicator: null theme: landcover metadata: null + joins: + - lookup: lagoon_poly_lkp + left_on: t50_fid + # Chatham Islands overlap with `lagoon_poly_lkp` is unverified, so this keeps the + # pre-lookup mapping rather than sharing the mainland entry's anchor. - source: kart@data.koordinates.com:linz/nz-chatham-island-lagoon-polygons-topo-150k name: nz_chatham_island_lagoon_polygons_topo_150k - mapping: *lagoon + mapping: + t50_fid: $ + type: lagoon + subtype: null + name: $ + group_name: null + height: null + elevation: $ + perennial: null + temperature_indicator: null + theme: landcover + metadata: null # # pi # - source: kart@data.koordinates.com:linz/cook-islands-lagoon-polygons-topo-125k-zone3 # name: cook_islands_lagoon_polygons_topo_125k_zone3 @@ -54,11 +115,11 @@ datasets: # nz - source: kart@data.koordinates.com:linz/nz-lake-polygons-topo-150k-2 name: nz_lake_polygons_topo_150k_2 - mapping: &lake + mapping: t50_fid: $ type: lake subtype: $lake_use - name: $ + name: $lake_poly_lkp.name group_name: $grp_name height: null elevation: $ @@ -70,9 +131,25 @@ datasets: - column: subtype replace: 'hydro-electric': hydro_electric + joins: + - lookup: lake_poly_lkp + left_on: t50_fid + # Chatham Islands overlap with `lake_poly_lkp` is unverified, so this keeps the + # pre-lookup mapping rather than sharing the mainland entry's anchor. - source: kart@data.koordinates.com:linz/nz-chatham-island-lake-polygons-topo-150k name: nz_chatham_island_lake_polygons_topo_150k - mapping: *lake + mapping: + t50_fid: $ + type: lake + subtype: $lake_use + name: $ + group_name: $grp_name + height: null + elevation: $ + perennial: $ + temperature_indicator: null + theme: landcover + metadata: null corrections: *lake_subtype_corrections # # nzoi # - source: kart@data.koordinates.com:linz/nz-auckland-island-lake-polygons-topo-150k @@ -154,21 +231,39 @@ datasets: # nz - source: kart@data.koordinates.com:linz/nz-river-polygons-topo-150k name: nz_river_polygons_topo_150k - mapping: &river + mapping: t50_fid: $ type: river subtype: null - name: null + name: $river_poly_lkp.name group_name: null height: null elevation: null perennial: null temperature_indicator: null theme: landcover - metadata: null + metadata: { source: $river_poly_lkp.gazfeatid, fixup: true } + joins: + - lookup: river_poly_lkp + left_on: t50_fid + fixups: + - fn: build_nzgb_metadata + # Chatham Islands overlap with `river_poly_lkp` is unverified, so this keeps the + # pre-lookup mapping rather than sharing the mainland entry's anchor. - source: kart@data.koordinates.com:linz/nz-chatham-island-river-polygons-topo-150k name: nz_chatham_island_river_polygons_topo_150k - mapping: *river + mapping: + t50_fid: $ + type: river + subtype: null + name: null + group_name: null + height: null + elevation: null + perennial: null + temperature_indicator: null + theme: landcover + metadata: null # # pi # - source: kart@data.koordinates.com:linz/cook-islands-river-polygons-topo-125k-zone4 # name: cook_islands_river_polygons_topo_125k_zone4 diff --git a/packages/kart-import/config/themes/water_line.yml b/packages/kart-import/config/themes/water_line.yml index d95110a4..ae76eee3 100644 --- a/packages/kart-import/config/themes/water_line.yml +++ b/packages/kart-import/config/themes/water_line.yml @@ -1,6 +1,36 @@ name: water_line target_repo: topographic-data target_epsg: EPSG:4167 +lookups: + # -------- canal + - name: canal_cl_lkp + source: + url: git@github.com:linz/topographic-source-data + dataset: canal_cl + key: t50_fid + columns: + - gazfeatid + - name + + # -------- drain + - name: drain_cl_lkp + source: + url: git@github.com:linz/topographic-source-data + dataset: drain_cl + key: t50_fid + columns: + - gazfeatid + - name + + # -------- river + - name: river_cl_lkp + source: + url: git@github.com:linz/topographic-source-data + dataset: river_cl + key: t50_fid + columns: + - gazfeatid + - name datasets: # -------- canal # nz @@ -9,23 +39,40 @@ datasets: mapping: t50_fid: $ type: canal - name: $ + name: $canal_cl_lkp.name theme: landcover - metadata: null + metadata: { source: $canal_cl_lkp.gazfeatid, fixup: true } + joins: + - lookup: canal_cl_lkp + left_on: t50_fid + fixups: + - fn: build_nzgb_metadata # -------- drain # nz - source: kart@data.koordinates.com:linz/nz-drain-centrelines-topo-150k name: nz_drain_centrelines_topo_150k - mapping: &drain + mapping: t50_fid: $ type: drain - name: $ + name: $drain_cl_lkp.name theme: landcover - metadata: null + metadata: { source: $drain_cl_lkp.gazfeatid, fixup: true } + joins: + - lookup: drain_cl_lkp + left_on: t50_fid + fixups: + - fn: build_nzgb_metadata + # Chatham Islands overlap with `drain_cl_lkp` is unverified, so this keeps the + # pre-lookup mapping rather than sharing the mainland entry's anchor. - source: kart@data.koordinates.com:linz/nz-chatham-island-drain-centrelines-topo-150k name: nz_chatham_island_drain_centrelines_topo_150k - mapping: *drain + mapping: + t50_fid: $ + type: drain + name: $ + theme: landcover + metadata: null # # pi # - source: kart@data.koordinates.com:linz/cook-islands-drain-centrelines-topo-125k-zone4 # name: cook_islands_drain_centrelines_topo_125k_zone4 @@ -35,15 +82,27 @@ datasets: # nz - source: kart@data.koordinates.com:linz/nz-river-centrelines-topo-150k name: nz_river_centrelines_topo_150k - mapping: &river + mapping: t50_fid: $ type: river - name: null + name: $river_cl_lkp.name theme: landcover - metadata: null + metadata: { source: $river_cl_lkp.gazfeatid, fixup: true } + joins: + - lookup: river_cl_lkp + left_on: t50_fid + fixups: + - fn: build_nzgb_metadata + # Chatham Islands overlap with `river_cl_lkp` is unverified, so this keeps the + # pre-lookup mapping rather than sharing the mainland entry's anchor. - source: kart@data.koordinates.com:linz/nz-chatham-island-river-centrelines-topo-150k name: nz_chatham_island_river_centrelines_topo_150k - mapping: *river + mapping: + t50_fid: $ + type: river + name: null + theme: landcover + metadata: null # # nzoi # - source: kart@data.koordinates.com:linz/nz-antipodes-island-river-centrelines-topo-125k # name: nz_antipodes_island_river_centrelines_topo_125k diff --git a/packages/kart-import/src/kart_import/fixups.py b/packages/kart-import/src/kart_import/fixups.py index 0bdbeaf1..a979cc93 100644 --- a/packages/kart-import/src/kart_import/fixups.py +++ b/packages/kart-import/src/kart_import/fixups.py @@ -279,6 +279,64 @@ def build_road_metadata(gdf: gpd.GeoDataFrame, td: ThemeDataset, release_id: int ) +NZGB_GAZETTEER_SOURCE = "nzgb_gazetteer" +NZGB_GAZETTEER_KEY_NAME = "gazfeatid" +"""What the NZGB gazetteer calls its own key, regardless of what a lookup config names the column +carrying it - every gazetteer-linked lookup so far has kept the same name, but the two are +conceptually distinct (see `ROAD_NAME_FROM_AIMS`'s `road_id` vs. its local `rna_sufi`).""" + + +def build_nzgb_metadata(gdf: gpd.GeoDataFrame, td: ThemeDataset, release_id: int) -> gpd.GeoDataFrame: + """Record that a dataset's `name` came from the NZGB gazetteer, keyed by its lookup's key column. + + Generic across every dataset wired the way `nz_canal_polygons_topo_150k` is - a gazetteer + lookup joined in, its name column mapped to `name`, and its key column mapped into `metadata`: + + name: $.name + metadata: {source: $., fixup: true} + joins: + - lookup: + left_on: t50_fid + fixups: + - fn: build_nzgb_metadata + + The lookup name, its key column, and its source dataset are all read off `td` and the theme's + `lookups:`, so a new dataset needs none of the Python above - just that same wiring. A dataset + whose gazetteer-sourced value lands somewhere other than `name` needs its own `SourceRef` and a + direct `_build_source_metadata` call instead (see `build_road_metadata`). + """ + from .config import LOOKUP_MAP + + metadata_source = td.field_specs()["metadata"].source + is_lookup_ref = isinstance(metadata_source, str) and metadata_source.startswith("$") + lookup_name, sep, key_column = metadata_source[1:].partition(".") if is_lookup_ref else ("", "", "") + if not sep or not key_column: + raise ValueError( + f"{td.name}: `metadata` must be mapped as '$.' for " + f"build_nzgb_metadata, got {metadata_source!r}" + ) + + name_source = td.field_specs()["name"].source + if name_source != f"${lookup_name}.name": + raise ValueError( + f"{td.name}: `name` must be mapped as '${lookup_name}.name' to match the gazetteer " + f"lookup '{lookup_name}' referenced by `metadata`, got {name_source!r}" + ) + + lookup = LOOKUP_MAP.get(lookup_name) + if lookup is None: + raise ValueError(f"{td.name}: `metadata` references unknown lookup '{lookup_name}'") + + ref = SourceRef( + table_column="name", + source=NZGB_GAZETTEER_SOURCE, + source_key_name=NZGB_GAZETTEER_KEY_NAME, + source_table=lookup.source.dataset or lookup.name, + source_column="name", + ) + return _build_source_metadata(gdf, td, release_id, td.name, ref) + + def _split_id(parent_id: str, dataset_name: str, parent_fid, part_index: int) -> str: """Deterministic UUIDv7 for a part that has no source fid. @@ -409,6 +467,7 @@ def contour_number(gdf: gpd.GeoDataFrame, td: ThemeDataset, release_id: int) -> FIXUPS: dict[str, Fixup] = { + "build_nzgb_metadata": build_nzgb_metadata, "build_road_metadata": build_road_metadata, "drop_degenerate_fences": drop_degenerate_fences, "drop_degenerate_roads": drop_degenerate_roads, diff --git a/packages/kart-import/src/kart_import/fixups_test.py b/packages/kart-import/src/kart_import/fixups_test.py index e8fae1b9..f3f810d9 100644 --- a/packages/kart-import/src/kart_import/fixups_test.py +++ b/packages/kart-import/src/kart_import/fixups_test.py @@ -283,6 +283,107 @@ def test_build_road_metadata_rejects_an_unknown_release(road_releases): fixups.build_road_metadata(_road_gdf([3061525]), _td([], ROADS), 99) +def _gaz_gdf(gazfeatids: list[int | None], names: list[str | None] | None = None) -> gpd.GeoDataFrame: + """A post-`normalize_fields` frame: `metadata` already holds the raw gazetteer key and `name` + already holds the joined lookup's name column - the only inputs `build_nzgb_metadata` has.""" + return gpd.GeoDataFrame( + {"metadata": gazfeatids, "name": names if names is not None else [f"NAME {g}" for g in gazfeatids]}, + geometry=[Point(0, 0) for _ in gazfeatids], + crs="EPSG:4167", + ) + + +def _gaz_td( + name: str, lookup: str, key_column: str = "gazfeatid", fixups_cfg: list[dict] | None = None +) -> ThemeDataset: + return ThemeDataset.model_validate( + { + "name": name, + "source": "kart@data.koordinates.com:linz/x-topo-150k", + "mapping": { + "name": f"${lookup}.name", + "metadata": {"source": f"${lookup}.{key_column}", "fixup": True}, + }, + "fixups": fixups_cfg if fixups_cfg is not None else [{"fn": "build_nzgb_metadata"}], + } + ) + + +def _register_lookup(monkeypatch, name: str, dataset: str) -> None: + from . import config as config_module + + lookup = config_module.Lookup.model_validate( + { + "name": name, + "source": {"url": "git@github.com:linz/topographic-source-data", "dataset": dataset}, + "key": "t50_fid", + "columns": ["gazfeatid", "name"], + } + ) + monkeypatch.setitem(config_module.LOOKUP_MAP, name, lookup) + + +def test_build_nzgb_metadata_record_shape(road_releases, monkeypatch): + """The record shape matches `build_road_metadata`'s - only the `SourceRef` differs - built + entirely from the dataset's own mapping and lookup, with no per-dataset Python.""" + _register_lookup(monkeypatch, "canal_lkp", "canal_cl") + td = _gaz_td("nz_canal_polygons_topo_150k", "canal_lkp") + + out = fixups.build_nzgb_metadata(_gaz_gdf([1043221]), td, 66) + + assert json.loads(out["metadata"].iloc[0]) == [ + { + "table_column": "name", + "source": "nzgb_gazetteer", + "source_key_name": "gazfeatid", + "source_key_value": 1043221, + "source_table": "canal_cl", + "source_column": "name", + "source_updated_at": STAMP_66, + "imported_at": STAMP_66, + } + ] + + +def test_build_nzgb_metadata_is_generic_across_datasets(road_releases, monkeypatch): + """A second dataset on a different lookup/source dataset needs no new Python - just the + lookup/mapping/fixups wiring `build_nzgb_metadata`'s docstring describes.""" + _register_lookup(monkeypatch, "lake_lkp", "lake_pt") + td = _gaz_td("nz_lake_polygons_topo_150k", "lake_lkp") + + out = fixups.build_nzgb_metadata(_gaz_gdf([555]), td, 66) + + record = json.loads(out["metadata"].iloc[0])[0] + assert record["source_table"] == "lake_pt" + assert record["source_key_value"] == 555 + + +def test_build_nzgb_metadata_rejects_a_metadata_column_not_shaped_as_a_lookup_ref(road_releases): + td = _gaz_td("ds", "canal_lkp") + td.mapping["metadata"] = {"source": None, "fixup": True} + + with pytest.raises(ValueError, match="must be mapped as '\\$.'"): + fixups.build_nzgb_metadata(_gaz_gdf([1]), td, 66) + + +def test_build_nzgb_metadata_rejects_name_mapped_off_a_different_lookup(road_releases, monkeypatch): + """`name` and `metadata` disagreeing on which lookup fed them is exactly the kind of copy-paste + mistake the generic fixup can't otherwise catch, since it trusts `metadata`'s lookup by default.""" + _register_lookup(monkeypatch, "canal_lkp", "canal_cl") + td = _gaz_td("ds", "canal_lkp") + td.mapping["name"] = "$other_lkp.name" + + with pytest.raises(ValueError, match="must be mapped as '\\$canal_lkp.name'"): + fixups.build_nzgb_metadata(_gaz_gdf([1]), td, 66) + + +def test_build_nzgb_metadata_rejects_an_unknown_lookup(road_releases): + td = _gaz_td("ds", "no_such_lookup") + + with pytest.raises(ValueError, match="unknown lookup 'no_such_lookup'"): + fixups.build_nzgb_metadata(_gaz_gdf([1]), td, 66) + + def _status_of_a(gdf: gpd.GeoDataFrame) -> str: return gdf.loc[gdf["name"] == "a", "status"].iloc[0] From 1fef5744025ec0d42ff2b6e8dab9cd849a996ace Mon Sep 17 00:00:00 2001 From: Tawera Manaena Date: Tue, 15 Sep 2026 05:11:20 +1200 Subject: [PATCH 07/10] refactor: todos --- packages/kart-import/config/themes/water.yml | 1 + packages/kart-import/config/themes/water_line.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/kart-import/config/themes/water.yml b/packages/kart-import/config/themes/water.yml index 21e4116c..ada8f795 100644 --- a/packages/kart-import/config/themes/water.yml +++ b/packages/kart-import/config/themes/water.yml @@ -2,6 +2,7 @@ name: water target_repo: topographic-data target_epsg: EPSG:4167 lookups: + # TODO: We only want to attach the metadata attribute if the `name` value is not null for the lookup row. # -------- canal - name: canal_poly_lkp source: diff --git a/packages/kart-import/config/themes/water_line.yml b/packages/kart-import/config/themes/water_line.yml index ae76eee3..c80dc397 100644 --- a/packages/kart-import/config/themes/water_line.yml +++ b/packages/kart-import/config/themes/water_line.yml @@ -2,6 +2,7 @@ name: water_line target_repo: topographic-data target_epsg: EPSG:4167 lookups: + # TODO: We only want to attach the metadata attribute if the `name` value is not null for the lookup row. # -------- canal - name: canal_cl_lkp source: From 73fe7ac537cde4518a4b4b206dd0fea463e2f519 Mon Sep 17 00:00:00 2001 From: Tawera Manaena Date: Tue, 15 Sep 2026 05:11:48 +1200 Subject: [PATCH 08/10] feat: update metadata generation to add timestamps --- .../kart-import/src/kart_import/fixups.py | 50 +++++++++++++------ .../src/kart_import/fixups_test.py | 32 +++++++++--- 2 files changed, 61 insertions(+), 21 deletions(-) diff --git a/packages/kart-import/src/kart_import/fixups.py b/packages/kart-import/src/kart_import/fixups.py index a979cc93..10c0787c 100644 --- a/packages/kart-import/src/kart_import/fixups.py +++ b/packages/kart-import/src/kart_import/fixups.py @@ -26,6 +26,7 @@ from __future__ import annotations +from datetime import datetime, timezone import logging from collections.abc import Callable from datetime import UTC @@ -145,7 +146,7 @@ def drop_degenerate_roads(gdf: gpd.GeoDataFrame, td: ThemeDataset, release_id: i class SourceRef(NamedTuple): """The constant half of a provenance record: which target column it explains, and where that - column's value came from. Only `source_key_value` and the two timestamps vary per row. + column's value came from. Only `source_key_value` varies per row. Field names are the record's JSON keys. """ @@ -160,6 +161,12 @@ class SourceRef(NamedTuple): """The table within that system, e.g. `roads`.""" source_column: str """The column within that table the value was read from.""" + source_updated_at: str | None = None + """RFC 3339 UTC text, or `None` to stamp both timestamps from the release date - see + `_build_source_metadata`. Set this only when a ref needs a different stamp, e.g. build-time + wall-clock rather than the release it's imported for.""" + imported_at: str | None = None + """As `source_updated_at`; the two are independent so a ref can set one without the other.""" ROAD_NAME_FROM_AIMS = SourceRef( @@ -175,8 +182,14 @@ class SourceRef(NamedTuple): than a null check is what separates a road whose name came from AIMS from one that has no link.""" +def _rfc3339(moment: datetime) -> str: + """`moment` as RFC 3339 UTC text (second precision, `Z` suffix) - the one timestamp shape every + provenance record uses, whether stamped from a release date or the build's wall clock.""" + return moment.astimezone(UTC).strftime("%Y-%m-%dT%H:%M:%SZ") + + def _release_stamp(release_id: int) -> str: - """The release's own date as RFC 3339 UTC text, for a provenance timestamp.""" + """The release's own date as an RFC 3339 UTC stamp, for a provenance timestamp.""" from .config import get_releases release_date = next((release.date for release in get_releases() if release.id == release_id), None) @@ -187,7 +200,7 @@ def _release_stamp(release_id: int) -> str: # `astimezone` on a naive value would otherwise make the output depend on the machine's TZ. if release_date.tzinfo is None: release_date = release_date.replace(tzinfo=UTC) - return release_date.astimezone(UTC).strftime("%Y-%m-%dT%H:%M:%SZ") + return _rfc3339(release_date) def _build_source_metadata( @@ -241,7 +254,14 @@ def record(key_value: int) -> str: # sort_keys/separators so the same key always serialises to the same bytes - two runs that # differ only in dict ordering would read as a changed feature to kart. return json.dumps( - [{**ref._asdict(), "source_key_value": key_value, "source_updated_at": stamp, "imported_at": stamp}], + [ + { + **ref._asdict(), + "source_key_value": key_value, + "source_updated_at": ref.source_updated_at or stamp, + "imported_at": ref.imported_at or stamp, + } + ], sort_keys=True, separators=(",", ":"), ) @@ -279,13 +299,6 @@ def build_road_metadata(gdf: gpd.GeoDataFrame, td: ThemeDataset, release_id: int ) -NZGB_GAZETTEER_SOURCE = "nzgb_gazetteer" -NZGB_GAZETTEER_KEY_NAME = "gazfeatid" -"""What the NZGB gazetteer calls its own key, regardless of what a lookup config names the column -carrying it - every gazetteer-linked lookup so far has kept the same name, but the two are -conceptually distinct (see `ROAD_NAME_FROM_AIMS`'s `road_id` vs. its local `rna_sufi`).""" - - def build_nzgb_metadata(gdf: gpd.GeoDataFrame, td: ThemeDataset, release_id: int) -> gpd.GeoDataFrame: """Record that a dataset's `name` came from the NZGB gazetteer, keyed by its lookup's key column. @@ -304,6 +317,11 @@ def build_nzgb_metadata(gdf: gpd.GeoDataFrame, td: ThemeDataset, release_id: int `lookups:`, so a new dataset needs none of the Python above - just that same wiring. A dataset whose gazetteer-sourced value lands somewhere other than `name` needs its own `SourceRef` and a direct `_build_source_metadata` call instead (see `build_road_metadata`). + + Both timestamps are stamped at build time rather than from the release date, unlike + `build_road_metadata` - the gazetteer lookup carries no per-record update time of its own, so + "when this ref was built" is the closest available proxy. Unlike a release-dated ref, this is + not byte-stable: rebuilding the same release later reproduces different bytes for every row. """ from .config import LOOKUP_MAP @@ -327,12 +345,16 @@ def build_nzgb_metadata(gdf: gpd.GeoDataFrame, td: ThemeDataset, release_id: int if lookup is None: raise ValueError(f"{td.name}: `metadata` references unknown lookup '{lookup_name}'") + build_stamp = _rfc3339(datetime.now(timezone.utc)) + ref = SourceRef( table_column="name", - source=NZGB_GAZETTEER_SOURCE, - source_key_name=NZGB_GAZETTEER_KEY_NAME, - source_table=lookup.source.dataset or lookup.name, + source="nzgb_gazetteer", + source_key_name="feat_id", + source_table="nzgb_gaz", source_column="name", + source_updated_at=build_stamp, + imported_at=build_stamp, ) return _build_source_metadata(gdf, td, release_id, td.name, ref) diff --git a/packages/kart-import/src/kart_import/fixups_test.py b/packages/kart-import/src/kart_import/fixups_test.py index f3f810d9..d4cd8fc9 100644 --- a/packages/kart-import/src/kart_import/fixups_test.py +++ b/packages/kart-import/src/kart_import/fixups_test.py @@ -323,7 +323,23 @@ def _register_lookup(monkeypatch, name: str, dataset: str) -> None: monkeypatch.setitem(config_module.LOOKUP_MAP, name, lookup) -def test_build_nzgb_metadata_record_shape(road_releases, monkeypatch): +class _FrozenDatetime(datetime): + """Stands in for `fixups.datetime` so `build_nzgb_metadata`'s build-time stamp is deterministic.""" + + @classmethod + def now(cls, tz=None): + return cls(2026, 1, 2, 3, 4, 5, tzinfo=tz) + + +BUILD_TIME_STAMP = "2026-01-02T03:04:05Z" + + +@pytest.fixture +def frozen_build_time(monkeypatch): + monkeypatch.setattr(fixups, "datetime", _FrozenDatetime) + + +def test_build_nzgb_metadata_record_shape(road_releases, frozen_build_time, monkeypatch): """The record shape matches `build_road_metadata`'s - only the `SourceRef` differs - built entirely from the dataset's own mapping and lookup, with no per-dataset Python.""" _register_lookup(monkeypatch, "canal_lkp", "canal_cl") @@ -335,26 +351,28 @@ def test_build_nzgb_metadata_record_shape(road_releases, monkeypatch): { "table_column": "name", "source": "nzgb_gazetteer", - "source_key_name": "gazfeatid", + "source_key_name": "feat_id", "source_key_value": 1043221, - "source_table": "canal_cl", + "source_table": "nzgb_gaz", "source_column": "name", - "source_updated_at": STAMP_66, - "imported_at": STAMP_66, + "source_updated_at": BUILD_TIME_STAMP, + "imported_at": BUILD_TIME_STAMP, } ] def test_build_nzgb_metadata_is_generic_across_datasets(road_releases, monkeypatch): """A second dataset on a different lookup/source dataset needs no new Python - just the - lookup/mapping/fixups wiring `build_nzgb_metadata`'s docstring describes.""" + lookup/mapping/fixups wiring `build_nzgb_metadata`'s docstring describes. `source_table` names + the gazetteer itself, not the lookup, so it stays constant across datasets - it's the dataset + name and key value below that prove this ran against the right lookup, not a hardcoded one.""" _register_lookup(monkeypatch, "lake_lkp", "lake_pt") td = _gaz_td("nz_lake_polygons_topo_150k", "lake_lkp") out = fixups.build_nzgb_metadata(_gaz_gdf([555]), td, 66) record = json.loads(out["metadata"].iloc[0])[0] - assert record["source_table"] == "lake_pt" + assert record["source_table"] == "nzgb_gaz" assert record["source_key_value"] == 555 From 9c0da38db7f312b643774a45963f4e743e75a0c0 Mon Sep 17 00:00:00 2001 From: ccbblin <205563055+ccbblin@users.noreply.github.com> Date: Wed, 16 Sep 2026 09:24:14 +1200 Subject: [PATCH 09/10] lint --- packages/kart-import/src/kart_import/fixups.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/kart-import/src/kart_import/fixups.py b/packages/kart-import/src/kart_import/fixups.py index 10c0787c..e09110d3 100644 --- a/packages/kart-import/src/kart_import/fixups.py +++ b/packages/kart-import/src/kart_import/fixups.py @@ -26,10 +26,9 @@ from __future__ import annotations -from datetime import datetime, timezone import logging from collections.abc import Callable -from datetime import UTC +from datetime import UTC, datetime from typing import TYPE_CHECKING, NamedTuple from .fixups_map_sheet import ( @@ -345,7 +344,7 @@ def build_nzgb_metadata(gdf: gpd.GeoDataFrame, td: ThemeDataset, release_id: int if lookup is None: raise ValueError(f"{td.name}: `metadata` references unknown lookup '{lookup_name}'") - build_stamp = _rfc3339(datetime.now(timezone.utc)) + build_stamp = _rfc3339(datetime.now(UTC)) ref = SourceRef( table_column="name", From 99d2ddee47cc4626eb9241f6be86e9eb387ca3dc Mon Sep 17 00:00:00 2001 From: ccbblin <205563055+ccbblin@users.noreply.github.com> Date: Wed, 16 Sep 2026 10:59:11 +1200 Subject: [PATCH 10/10] ignore metadata if no name --- packages/kart-import/config/themes/water.yml | 1 - .../kart-import/config/themes/water_line.yml | 1 - .../kart-import/src/kart_import/fixups.py | 17 ++++++++++++---- .../src/kart_import/fixups_test.py | 20 +++++++++++++++++++ 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/packages/kart-import/config/themes/water.yml b/packages/kart-import/config/themes/water.yml index ada8f795..21e4116c 100644 --- a/packages/kart-import/config/themes/water.yml +++ b/packages/kart-import/config/themes/water.yml @@ -2,7 +2,6 @@ name: water target_repo: topographic-data target_epsg: EPSG:4167 lookups: - # TODO: We only want to attach the metadata attribute if the `name` value is not null for the lookup row. # -------- canal - name: canal_poly_lkp source: diff --git a/packages/kart-import/config/themes/water_line.yml b/packages/kart-import/config/themes/water_line.yml index c80dc397..ae76eee3 100644 --- a/packages/kart-import/config/themes/water_line.yml +++ b/packages/kart-import/config/themes/water_line.yml @@ -2,7 +2,6 @@ name: water_line target_repo: topographic-data target_epsg: EPSG:4167 lookups: - # TODO: We only want to attach the metadata attribute if the `name` value is not null for the lookup row. # -------- canal - name: canal_cl_lkp source: diff --git a/packages/kart-import/src/kart_import/fixups.py b/packages/kart-import/src/kart_import/fixups.py index e09110d3..cbd2380a 100644 --- a/packages/kart-import/src/kart_import/fixups.py +++ b/packages/kart-import/src/kart_import/fixups.py @@ -229,6 +229,10 @@ def _build_source_metadata( `metadata` rather than a record asserting a link to a row that does not exist. A NULL key is always treated as unset. + A row whose looked-up value (`ref.table_column`) came back null also gets NULL `metadata`: a + provenance record explains where that column's value came from, and a null value has nothing + to explain. + `dataset` names what the wiring was checked against, as in `_drop_listed_empty`: pointed at another dataset this would silently overwrite that dataset's `metadata` instead of failing. @@ -247,7 +251,13 @@ def _build_source_metadata( # Not `errors="coerce"`: a non-numeric column here means the config wired something other than # the key column into `metadata`, which should fail rather than quietly produce an all-null one. key = pd.to_numeric(gdf["metadata"]).astype("Int32", errors="raise") - keyed = key.notna() if unset_key is None else key.notna() & (key != unset_key) + has_key = key.notna() if unset_key is None else key.notna() & (key != unset_key) + + # Only a row whose looked-up value is present gets a record: the record explains where that + # value came from, so a key that resolved to a null `ref.table_column` has nothing to explain + # and gets NULL `metadata` instead of a record pointing at an absent value. + named = gdf[ref.table_column].notna() + keyed = has_key & named def record(key_value: int) -> str: # sort_keys/separators so the same key always serialises to the same bytes - two runs that @@ -280,9 +290,8 @@ def record(key_value: int) -> str: "release": release_id, "source": ref.source, "keyed": int(keyed.sum()), - "unlinked": int((~keyed).sum()), - # A key with no value to attribute: the record still says the column came from `source`. - f"keyed_without_{ref.table_column}": int((keyed & gdf[ref.table_column].isna()).sum()), + "unlinked": int((~has_key).sum()), + f"keyed_without_{ref.table_column}": int((has_key & ~named).sum()), }, ) diff --git a/packages/kart-import/src/kart_import/fixups_test.py b/packages/kart-import/src/kart_import/fixups_test.py index d4cd8fc9..d3124f31 100644 --- a/packages/kart-import/src/kart_import/fixups_test.py +++ b/packages/kart-import/src/kart_import/fixups_test.py @@ -235,6 +235,15 @@ def test_build_source_metadata_without_a_sentinel_keys_every_non_null(road_relea assert json.loads(out["metadata"].iloc[0])[0]["source_key_value"] == 0 +def test_build_source_metadata_leaves_a_keyed_row_with_a_null_value_null(road_releases): + """A row with a real key but a null looked-up value gets NULL `metadata`, not a record: the + record explains where `name` came from, and there is no name to explain.""" + gdf = _road_gdf([3061525, 1771150], names=["FIRST ROAD", None]) + out = fixups._build_source_metadata(gdf, _td([], ROADS), 66, ROADS, fixups.ROAD_NAME_FROM_AIMS) + + assert out["metadata"].isna().tolist() == [False, True] + + def test_build_source_metadata_writes_the_source_ref_as_json_keys(road_releases): """A `SourceRef`'s field names are the record's JSON keys, so a future `build_water_metadata` only has to declare its own ref rather than restate the record shape.""" @@ -376,6 +385,17 @@ def test_build_nzgb_metadata_is_generic_across_datasets(road_releases, monkeypat assert record["source_key_value"] == 555 +def test_build_nzgb_metadata_skips_a_gazfeatid_whose_name_is_null(road_releases, monkeypatch): + """The gazetteer lookup can match a `gazfeatid` while carrying no `name` for it. Such a row has + nothing to attribute, so it gets NULL `metadata` rather than a record for an absent name.""" + _register_lookup(monkeypatch, "canal_lkp", "canal_cl") + td = _gaz_td("nz_canal_polygons_topo_150k", "canal_lkp") + + out = fixups.build_nzgb_metadata(_gaz_gdf([1043221, 999], names=["Grand Canal", None]), td, 66) + + assert out["metadata"].isna().tolist() == [False, True] + + def test_build_nzgb_metadata_rejects_a_metadata_column_not_shaped_as_a_lookup_ref(road_releases): td = _gaz_td("ds", "canal_lkp") td.mapping["metadata"] = {"source": None, "fixup": True}