From d20c467da177683bd2c265002c6499764c56aa66 Mon Sep 17 00:00:00 2001 From: Callum Morris Date: Fri, 11 Sep 2026 16:42:50 +1200 Subject: [PATCH 1/4] nfc: update readme to clarify how to generate code --- map180/nzmap_gen_test.go | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/map180/nzmap_gen_test.go b/map180/nzmap_gen_test.go index 18765623..c74c2e60 100644 --- a/map180/nzmap_gen_test.go +++ b/map180/nzmap_gen_test.go @@ -16,15 +16,17 @@ import ( ) /* -Use these tests to generate files in nzmap. Adjust the pg connection in setup depending on the DB used. -e.g., 862640294325.dkr.ecr.ap-southeast-2.amazonaws.com/haz-db:9.5 +Use these tests to generate files in nzmap. Firstly, start up a Postgres DB (recommended to use the one +defined in the haz repo: https://github.com/GeoNet/haz/tree/main/etc). e.g.: -create the tables public.map180_layers and public.map180_labels (cf etc/nz_map180_layer.ddl): + docker build -t haz-db . + docker run -p 5432:5432 -e POSTGRES_PASSWORD=test haz-db:latest - psql -h 127.0.0.1 hazard postgresql +Start psql: + psql -h localhost -U postgres -d hazard -then copy and paste the following commands: +Then copy and paste the following commands: drop table public.map180_layers; drop table public.map180_labels; @@ -60,17 +62,19 @@ then copy and paste the following commands: GRANT SELECT ON public.map180_labels TO PUBLIC; -The add the coast line data: +Then add the coast line data: - cp data/new_zealand_map_layers.ddl.gz /work/new_zealand_map_layers.ddl.gz - gunzip /work/new_zealand_map_layers.ddl.gz - psql -h 127.0.0.1 hazard postgres -f /work/new_zealand_map_layers.ddl + mkdir work + cp ./data/new_zealand_map_layers.ddl.gz ./work/new_zealand_map_layers.ddl.gz + gunzip ./work/new_zealand_map_layers.ddl.gz + psql -h localhost -U postgres -d hazard -f ./work/new_zealand_map_layers.ddl + rm -rf ./work -Generate and format the nzmap files: +Export the environment variables in env.list, then generate and format the nzmap files: go test -tags generate - gofmt -s -w nzmap/ + goimports -w nzmap/ */ const ( From 04789ba19f2663c6095b0a84ee3968ce1dfd27c6 Mon Sep 17 00:00:00 2001 From: Callum Morris Date: Mon, 14 Sep 2026 11:26:58 +1200 Subject: [PATCH 2/4] fix: add changes from https://github.com/GeoNet/kit/pull/156 properly, and regenerate code --- map180/nzmap/nzicon.go | 14 +--- map180/nzmap/nzmedium.go | 14 +--- map180/nzmap/nzrcicon.go | 14 +--- map180/nzmap/nzrcmedium.go | 14 +--- map180/nzmap/nzrmedium.go | 14 +--- map180/nzmap/nzsicon.go | 146 +++++++++++++++++-------------------- map180/nzmap/nzsmedium.go | 146 +++++++++++++++++-------------------- map180/nzmap_gen_test.go | 4 +- 8 files changed, 141 insertions(+), 225 deletions(-) diff --git a/map180/nzmap/nzicon.go b/map180/nzmap/nzicon.go index bfcc13f5..e43feb94 100644 --- a/map180/nzmap/nzicon.go +++ b/map180/nzmap/nzicon.go @@ -1,18 +1,6 @@ package nzmap -var nzIcon = `Map of New Zealand. - -` +var nzIcon = `Map of New Zealand.` func init() { nzIconPts[0][0] = pt{x: 0, y: 124} diff --git a/map180/nzmap/nzmedium.go b/map180/nzmap/nzmedium.go index 84995645..2cf6d7d3 100644 --- a/map180/nzmap/nzmedium.go +++ b/map180/nzmap/nzmedium.go @@ -1,18 +1,6 @@ package nzmap -var nzMedium = `Map of New Zealand. - -` +var nzMedium = `Map of New Zealand.` func init() { nzMediumPts[0][0] = pt{x: 0, y: 622} diff --git a/map180/nzmap/nzrcicon.go b/map180/nzmap/nzrcicon.go index 65a9fc0a..5757cbe3 100644 --- a/map180/nzmap/nzrcicon.go +++ b/map180/nzmap/nzrcicon.go @@ -1,18 +1,6 @@ package nzmap -var nzrcIcon = `Map of New Zealand. - -` +var nzrcIcon = `Map of New Zealand.` func init() { nzrcIconPts[0][0] = pt{x: 0, y: 125} diff --git a/map180/nzmap/nzrcmedium.go b/map180/nzmap/nzrcmedium.go index 9c5466f4..baa901ae 100644 --- a/map180/nzmap/nzrcmedium.go +++ b/map180/nzmap/nzrcmedium.go @@ -1,18 +1,6 @@ package nzmap -var nzrcMedium = `Map of New Zealand. - -` +var nzrcMedium = `Map of New Zealand.` func init() { nzrcMediumPts[0][0] = pt{x: 0, y: 624} diff --git a/map180/nzmap/nzrmedium.go b/map180/nzmap/nzrmedium.go index 7d545d4a..70527a48 100644 --- a/map180/nzmap/nzrmedium.go +++ b/map180/nzmap/nzrmedium.go @@ -1,18 +1,6 @@ package nzmap -var nzrMedium = `Map of New Zealand. - -` +var nzrMedium = `Map of New Zealand.` func init() { nzrMediumPts[0][0] = pt{x: 0, y: 638} diff --git a/map180/nzmap/nzsicon.go b/map180/nzmap/nzsicon.go index 270f8382..19bd41ca 100644 --- a/map180/nzmap/nzsicon.go +++ b/map180/nzmap/nzsicon.go @@ -1,18 +1,6 @@ package nzmap -var nzsIcon = `Map of New Zealand. - -` +var nzsIcon = `Map of New Zealand.` func init() { nzsIconPts[0][0] = pt{x: 0, y: 125} @@ -81,28 +69,28 @@ func init() { nzsIconPts[2][19] = pt{x: 8, y: 10} nzsIconPts[2][20] = pt{x: 8, y: 5} nzsIconPts[2][21] = pt{x: 8, y: 0} - nzsIconPts[3][0] = pt{x: 12, y: 125} - nzsIconPts[3][1] = pt{x: 12, y: 118} - nzsIconPts[3][2] = pt{x: 12, y: 111} - nzsIconPts[3][3] = pt{x: 12, y: 104} - nzsIconPts[3][4] = pt{x: 12, y: 97} - nzsIconPts[3][5] = pt{x: 12, y: 90} - nzsIconPts[3][6] = pt{x: 12, y: 84} - nzsIconPts[3][7] = pt{x: 12, y: 78} - nzsIconPts[3][8] = pt{x: 12, y: 72} - nzsIconPts[3][9] = pt{x: 12, y: 66} - nzsIconPts[3][10] = pt{x: 12, y: 60} - nzsIconPts[3][11] = pt{x: 12, y: 54} - nzsIconPts[3][12] = pt{x: 12, y: 48} - nzsIconPts[3][13] = pt{x: 12, y: 42} - nzsIconPts[3][14] = pt{x: 12, y: 37} - nzsIconPts[3][15] = pt{x: 12, y: 31} - nzsIconPts[3][16] = pt{x: 12, y: 26} - nzsIconPts[3][17] = pt{x: 12, y: 21} - nzsIconPts[3][18] = pt{x: 12, y: 15} - nzsIconPts[3][19] = pt{x: 12, y: 10} - nzsIconPts[3][20] = pt{x: 12, y: 5} - nzsIconPts[3][21] = pt{x: 12, y: 0} + nzsIconPts[3][0] = pt{x: 13, y: 125} + nzsIconPts[3][1] = pt{x: 13, y: 118} + nzsIconPts[3][2] = pt{x: 13, y: 111} + nzsIconPts[3][3] = pt{x: 13, y: 104} + nzsIconPts[3][4] = pt{x: 13, y: 97} + nzsIconPts[3][5] = pt{x: 13, y: 90} + nzsIconPts[3][6] = pt{x: 13, y: 84} + nzsIconPts[3][7] = pt{x: 13, y: 78} + nzsIconPts[3][8] = pt{x: 13, y: 72} + nzsIconPts[3][9] = pt{x: 13, y: 66} + nzsIconPts[3][10] = pt{x: 13, y: 60} + nzsIconPts[3][11] = pt{x: 13, y: 54} + nzsIconPts[3][12] = pt{x: 13, y: 48} + nzsIconPts[3][13] = pt{x: 13, y: 42} + nzsIconPts[3][14] = pt{x: 13, y: 37} + nzsIconPts[3][15] = pt{x: 13, y: 31} + nzsIconPts[3][16] = pt{x: 13, y: 26} + nzsIconPts[3][17] = pt{x: 13, y: 21} + nzsIconPts[3][18] = pt{x: 13, y: 15} + nzsIconPts[3][19] = pt{x: 13, y: 10} + nzsIconPts[3][20] = pt{x: 13, y: 5} + nzsIconPts[3][21] = pt{x: 13, y: 0} nzsIconPts[4][0] = pt{x: 17, y: 125} nzsIconPts[4][1] = pt{x: 17, y: 118} nzsIconPts[4][2] = pt{x: 17, y: 111} @@ -213,28 +201,28 @@ func init() { nzsIconPts[8][19] = pt{x: 33, y: 10} nzsIconPts[8][20] = pt{x: 33, y: 5} nzsIconPts[8][21] = pt{x: 33, y: 0} - nzsIconPts[9][0] = pt{x: 38, y: 125} - nzsIconPts[9][1] = pt{x: 38, y: 118} - nzsIconPts[9][2] = pt{x: 38, y: 111} - nzsIconPts[9][3] = pt{x: 38, y: 104} - nzsIconPts[9][4] = pt{x: 38, y: 97} - nzsIconPts[9][5] = pt{x: 38, y: 90} - nzsIconPts[9][6] = pt{x: 38, y: 84} - nzsIconPts[9][7] = pt{x: 38, y: 78} - nzsIconPts[9][8] = pt{x: 38, y: 72} - nzsIconPts[9][9] = pt{x: 38, y: 66} - nzsIconPts[9][10] = pt{x: 38, y: 60} - nzsIconPts[9][11] = pt{x: 38, y: 54} - nzsIconPts[9][12] = pt{x: 38, y: 48} - nzsIconPts[9][13] = pt{x: 38, y: 42} - nzsIconPts[9][14] = pt{x: 38, y: 37} - nzsIconPts[9][15] = pt{x: 38, y: 31} - nzsIconPts[9][16] = pt{x: 38, y: 26} - nzsIconPts[9][17] = pt{x: 38, y: 21} - nzsIconPts[9][18] = pt{x: 38, y: 15} - nzsIconPts[9][19] = pt{x: 38, y: 10} - nzsIconPts[9][20] = pt{x: 38, y: 5} - nzsIconPts[9][21] = pt{x: 38, y: 0} + nzsIconPts[9][0] = pt{x: 37, y: 125} + nzsIconPts[9][1] = pt{x: 37, y: 118} + nzsIconPts[9][2] = pt{x: 37, y: 111} + nzsIconPts[9][3] = pt{x: 37, y: 104} + nzsIconPts[9][4] = pt{x: 37, y: 97} + nzsIconPts[9][5] = pt{x: 37, y: 90} + nzsIconPts[9][6] = pt{x: 37, y: 84} + nzsIconPts[9][7] = pt{x: 37, y: 78} + nzsIconPts[9][8] = pt{x: 37, y: 72} + nzsIconPts[9][9] = pt{x: 37, y: 66} + nzsIconPts[9][10] = pt{x: 37, y: 60} + nzsIconPts[9][11] = pt{x: 37, y: 54} + nzsIconPts[9][12] = pt{x: 37, y: 48} + nzsIconPts[9][13] = pt{x: 37, y: 42} + nzsIconPts[9][14] = pt{x: 37, y: 37} + nzsIconPts[9][15] = pt{x: 37, y: 31} + nzsIconPts[9][16] = pt{x: 37, y: 26} + nzsIconPts[9][17] = pt{x: 37, y: 21} + nzsIconPts[9][18] = pt{x: 37, y: 15} + nzsIconPts[9][19] = pt{x: 37, y: 10} + nzsIconPts[9][20] = pt{x: 37, y: 5} + nzsIconPts[9][21] = pt{x: 37, y: 0} nzsIconPts[10][0] = pt{x: 42, y: 125} nzsIconPts[10][1] = pt{x: 42, y: 118} nzsIconPts[10][2] = pt{x: 42, y: 111} @@ -477,28 +465,28 @@ func init() { nzsIconPts[20][19] = pt{x: 83, y: 10} nzsIconPts[20][20] = pt{x: 83, y: 5} nzsIconPts[20][21] = pt{x: 83, y: 0} - nzsIconPts[21][0] = pt{x: 87, y: 125} - nzsIconPts[21][1] = pt{x: 87, y: 118} - nzsIconPts[21][2] = pt{x: 87, y: 111} - nzsIconPts[21][3] = pt{x: 87, y: 104} - nzsIconPts[21][4] = pt{x: 87, y: 97} - nzsIconPts[21][5] = pt{x: 87, y: 90} - nzsIconPts[21][6] = pt{x: 87, y: 84} - nzsIconPts[21][7] = pt{x: 87, y: 78} - nzsIconPts[21][8] = pt{x: 87, y: 72} - nzsIconPts[21][9] = pt{x: 87, y: 66} - nzsIconPts[21][10] = pt{x: 87, y: 60} - nzsIconPts[21][11] = pt{x: 87, y: 54} - nzsIconPts[21][12] = pt{x: 87, y: 48} - nzsIconPts[21][13] = pt{x: 87, y: 42} - nzsIconPts[21][14] = pt{x: 87, y: 37} - nzsIconPts[21][15] = pt{x: 87, y: 31} - nzsIconPts[21][16] = pt{x: 87, y: 26} - nzsIconPts[21][17] = pt{x: 87, y: 21} - nzsIconPts[21][18] = pt{x: 87, y: 15} - nzsIconPts[21][19] = pt{x: 87, y: 10} - nzsIconPts[21][20] = pt{x: 87, y: 5} - nzsIconPts[21][21] = pt{x: 87, y: 0} + nzsIconPts[21][0] = pt{x: 88, y: 125} + nzsIconPts[21][1] = pt{x: 88, y: 118} + nzsIconPts[21][2] = pt{x: 88, y: 111} + nzsIconPts[21][3] = pt{x: 88, y: 104} + nzsIconPts[21][4] = pt{x: 88, y: 97} + nzsIconPts[21][5] = pt{x: 88, y: 90} + nzsIconPts[21][6] = pt{x: 88, y: 84} + nzsIconPts[21][7] = pt{x: 88, y: 78} + nzsIconPts[21][8] = pt{x: 88, y: 72} + nzsIconPts[21][9] = pt{x: 88, y: 66} + nzsIconPts[21][10] = pt{x: 88, y: 60} + nzsIconPts[21][11] = pt{x: 88, y: 54} + nzsIconPts[21][12] = pt{x: 88, y: 48} + nzsIconPts[21][13] = pt{x: 88, y: 42} + nzsIconPts[21][14] = pt{x: 88, y: 37} + nzsIconPts[21][15] = pt{x: 88, y: 31} + nzsIconPts[21][16] = pt{x: 88, y: 26} + nzsIconPts[21][17] = pt{x: 88, y: 21} + nzsIconPts[21][18] = pt{x: 88, y: 15} + nzsIconPts[21][19] = pt{x: 88, y: 10} + nzsIconPts[21][20] = pt{x: 88, y: 5} + nzsIconPts[21][21] = pt{x: 88, y: 0} nzsIconPts[22][0] = pt{x: 92, y: 125} nzsIconPts[22][1] = pt{x: 92, y: 118} nzsIconPts[22][2] = pt{x: 92, y: 111} diff --git a/map180/nzmap/nzsmedium.go b/map180/nzmap/nzsmedium.go index 46136690..ee67dd07 100644 --- a/map180/nzmap/nzsmedium.go +++ b/map180/nzmap/nzsmedium.go @@ -1,18 +1,6 @@ package nzmap -var nzsMedium = `Map of New Zealand. - -` +var nzsMedium = `Map of New Zealand.` func init() { nzsMediumPts[0][0] = pt{x: 0, y: 624} @@ -81,28 +69,28 @@ func init() { nzsMediumPts[2][19] = pt{x: 42, y: 51} nzsMediumPts[2][20] = pt{x: 42, y: 25} nzsMediumPts[2][21] = pt{x: 42, y: 0} - nzsMediumPts[3][0] = pt{x: 62, y: 624} - nzsMediumPts[3][1] = pt{x: 62, y: 588} - nzsMediumPts[3][2] = pt{x: 62, y: 553} - nzsMediumPts[3][3] = pt{x: 62, y: 519} - nzsMediumPts[3][4] = pt{x: 62, y: 485} - nzsMediumPts[3][5] = pt{x: 62, y: 452} - nzsMediumPts[3][6] = pt{x: 62, y: 420} - nzsMediumPts[3][7] = pt{x: 62, y: 389} - nzsMediumPts[3][8] = pt{x: 62, y: 358} - nzsMediumPts[3][9] = pt{x: 62, y: 328} - nzsMediumPts[3][10] = pt{x: 62, y: 298} - nzsMediumPts[3][11] = pt{x: 62, y: 269} - nzsMediumPts[3][12] = pt{x: 62, y: 240} - nzsMediumPts[3][13] = pt{x: 62, y: 212} - nzsMediumPts[3][14] = pt{x: 62, y: 184} - nzsMediumPts[3][15] = pt{x: 62, y: 157} - nzsMediumPts[3][16] = pt{x: 62, y: 130} - nzsMediumPts[3][17] = pt{x: 62, y: 103} - nzsMediumPts[3][18] = pt{x: 62, y: 77} - nzsMediumPts[3][19] = pt{x: 62, y: 51} - nzsMediumPts[3][20] = pt{x: 62, y: 25} - nzsMediumPts[3][21] = pt{x: 62, y: 0} + nzsMediumPts[3][0] = pt{x: 63, y: 624} + nzsMediumPts[3][1] = pt{x: 63, y: 588} + nzsMediumPts[3][2] = pt{x: 63, y: 553} + nzsMediumPts[3][3] = pt{x: 63, y: 519} + nzsMediumPts[3][4] = pt{x: 63, y: 485} + nzsMediumPts[3][5] = pt{x: 63, y: 452} + nzsMediumPts[3][6] = pt{x: 63, y: 420} + nzsMediumPts[3][7] = pt{x: 63, y: 389} + nzsMediumPts[3][8] = pt{x: 63, y: 358} + nzsMediumPts[3][9] = pt{x: 63, y: 328} + nzsMediumPts[3][10] = pt{x: 63, y: 298} + nzsMediumPts[3][11] = pt{x: 63, y: 269} + nzsMediumPts[3][12] = pt{x: 63, y: 240} + nzsMediumPts[3][13] = pt{x: 63, y: 212} + nzsMediumPts[3][14] = pt{x: 63, y: 184} + nzsMediumPts[3][15] = pt{x: 63, y: 157} + nzsMediumPts[3][16] = pt{x: 63, y: 130} + nzsMediumPts[3][17] = pt{x: 63, y: 103} + nzsMediumPts[3][18] = pt{x: 63, y: 77} + nzsMediumPts[3][19] = pt{x: 63, y: 51} + nzsMediumPts[3][20] = pt{x: 63, y: 25} + nzsMediumPts[3][21] = pt{x: 63, y: 0} nzsMediumPts[4][0] = pt{x: 83, y: 624} nzsMediumPts[4][1] = pt{x: 83, y: 588} nzsMediumPts[4][2] = pt{x: 83, y: 553} @@ -213,28 +201,28 @@ func init() { nzsMediumPts[8][19] = pt{x: 167, y: 51} nzsMediumPts[8][20] = pt{x: 167, y: 25} nzsMediumPts[8][21] = pt{x: 167, y: 0} - nzsMediumPts[9][0] = pt{x: 188, y: 624} - nzsMediumPts[9][1] = pt{x: 188, y: 588} - nzsMediumPts[9][2] = pt{x: 188, y: 553} - nzsMediumPts[9][3] = pt{x: 188, y: 519} - nzsMediumPts[9][4] = pt{x: 188, y: 485} - nzsMediumPts[9][5] = pt{x: 188, y: 452} - nzsMediumPts[9][6] = pt{x: 188, y: 420} - nzsMediumPts[9][7] = pt{x: 188, y: 389} - nzsMediumPts[9][8] = pt{x: 188, y: 358} - nzsMediumPts[9][9] = pt{x: 188, y: 328} - nzsMediumPts[9][10] = pt{x: 188, y: 298} - nzsMediumPts[9][11] = pt{x: 188, y: 269} - nzsMediumPts[9][12] = pt{x: 188, y: 240} - nzsMediumPts[9][13] = pt{x: 188, y: 212} - nzsMediumPts[9][14] = pt{x: 188, y: 184} - nzsMediumPts[9][15] = pt{x: 188, y: 157} - nzsMediumPts[9][16] = pt{x: 188, y: 130} - nzsMediumPts[9][17] = pt{x: 188, y: 103} - nzsMediumPts[9][18] = pt{x: 188, y: 77} - nzsMediumPts[9][19] = pt{x: 188, y: 51} - nzsMediumPts[9][20] = pt{x: 188, y: 25} - nzsMediumPts[9][21] = pt{x: 188, y: 0} + nzsMediumPts[9][0] = pt{x: 187, y: 624} + nzsMediumPts[9][1] = pt{x: 187, y: 588} + nzsMediumPts[9][2] = pt{x: 187, y: 553} + nzsMediumPts[9][3] = pt{x: 187, y: 519} + nzsMediumPts[9][4] = pt{x: 187, y: 485} + nzsMediumPts[9][5] = pt{x: 187, y: 452} + nzsMediumPts[9][6] = pt{x: 187, y: 420} + nzsMediumPts[9][7] = pt{x: 187, y: 389} + nzsMediumPts[9][8] = pt{x: 187, y: 358} + nzsMediumPts[9][9] = pt{x: 187, y: 328} + nzsMediumPts[9][10] = pt{x: 187, y: 298} + nzsMediumPts[9][11] = pt{x: 187, y: 269} + nzsMediumPts[9][12] = pt{x: 187, y: 240} + nzsMediumPts[9][13] = pt{x: 187, y: 212} + nzsMediumPts[9][14] = pt{x: 187, y: 184} + nzsMediumPts[9][15] = pt{x: 187, y: 157} + nzsMediumPts[9][16] = pt{x: 187, y: 130} + nzsMediumPts[9][17] = pt{x: 187, y: 103} + nzsMediumPts[9][18] = pt{x: 187, y: 77} + nzsMediumPts[9][19] = pt{x: 187, y: 51} + nzsMediumPts[9][20] = pt{x: 187, y: 25} + nzsMediumPts[9][21] = pt{x: 187, y: 0} nzsMediumPts[10][0] = pt{x: 208, y: 624} nzsMediumPts[10][1] = pt{x: 208, y: 588} nzsMediumPts[10][2] = pt{x: 208, y: 553} @@ -477,28 +465,28 @@ func init() { nzsMediumPts[20][19] = pt{x: 417, y: 51} nzsMediumPts[20][20] = pt{x: 417, y: 25} nzsMediumPts[20][21] = pt{x: 417, y: 0} - nzsMediumPts[21][0] = pt{x: 437, y: 624} - nzsMediumPts[21][1] = pt{x: 437, y: 588} - nzsMediumPts[21][2] = pt{x: 437, y: 553} - nzsMediumPts[21][3] = pt{x: 437, y: 519} - nzsMediumPts[21][4] = pt{x: 437, y: 485} - nzsMediumPts[21][5] = pt{x: 437, y: 452} - nzsMediumPts[21][6] = pt{x: 437, y: 420} - nzsMediumPts[21][7] = pt{x: 437, y: 389} - nzsMediumPts[21][8] = pt{x: 437, y: 358} - nzsMediumPts[21][9] = pt{x: 437, y: 328} - nzsMediumPts[21][10] = pt{x: 437, y: 298} - nzsMediumPts[21][11] = pt{x: 437, y: 269} - nzsMediumPts[21][12] = pt{x: 437, y: 240} - nzsMediumPts[21][13] = pt{x: 437, y: 212} - nzsMediumPts[21][14] = pt{x: 437, y: 184} - nzsMediumPts[21][15] = pt{x: 437, y: 157} - nzsMediumPts[21][16] = pt{x: 437, y: 130} - nzsMediumPts[21][17] = pt{x: 437, y: 103} - nzsMediumPts[21][18] = pt{x: 437, y: 77} - nzsMediumPts[21][19] = pt{x: 437, y: 51} - nzsMediumPts[21][20] = pt{x: 437, y: 25} - nzsMediumPts[21][21] = pt{x: 437, y: 0} + nzsMediumPts[21][0] = pt{x: 438, y: 624} + nzsMediumPts[21][1] = pt{x: 438, y: 588} + nzsMediumPts[21][2] = pt{x: 438, y: 553} + nzsMediumPts[21][3] = pt{x: 438, y: 519} + nzsMediumPts[21][4] = pt{x: 438, y: 485} + nzsMediumPts[21][5] = pt{x: 438, y: 452} + nzsMediumPts[21][6] = pt{x: 438, y: 420} + nzsMediumPts[21][7] = pt{x: 438, y: 389} + nzsMediumPts[21][8] = pt{x: 438, y: 358} + nzsMediumPts[21][9] = pt{x: 438, y: 328} + nzsMediumPts[21][10] = pt{x: 438, y: 298} + nzsMediumPts[21][11] = pt{x: 438, y: 269} + nzsMediumPts[21][12] = pt{x: 438, y: 240} + nzsMediumPts[21][13] = pt{x: 438, y: 212} + nzsMediumPts[21][14] = pt{x: 438, y: 184} + nzsMediumPts[21][15] = pt{x: 438, y: 157} + nzsMediumPts[21][16] = pt{x: 438, y: 130} + nzsMediumPts[21][17] = pt{x: 438, y: 103} + nzsMediumPts[21][18] = pt{x: 438, y: 77} + nzsMediumPts[21][19] = pt{x: 438, y: 51} + nzsMediumPts[21][20] = pt{x: 438, y: 25} + nzsMediumPts[21][21] = pt{x: 438, y: 0} nzsMediumPts[22][0] = pt{x: 458, y: 624} nzsMediumPts[22][1] = pt{x: 458, y: 588} nzsMediumPts[22][2] = pt{x: 458, y: 553} diff --git a/map180/nzmap_gen_test.go b/map180/nzmap_gen_test.go index c74c2e60..3504a98c 100644 --- a/map180/nzmap_gen_test.go +++ b/map180/nzmap_gen_test.go @@ -81,9 +81,9 @@ const ( iconWidth = 100 mediumWidth = 500 // used for drawing landmasses. - landPath = "" + landPath = "" // used for drawing lakes ontop of landmasses. - lakePath = "" + lakePath = "" // fixed size SVG images (icons) fixed = "Map of New Zealand." // responsive From f53cf4409d05a0ee1dc4f54d1fff3211f5501a66 Mon Sep 17 00:00:00 2001 From: Callum Morris Date: Mon, 14 Sep 2026 11:31:35 +1200 Subject: [PATCH 3/4] nfc: add warning comment to generated code --- map180/nzmap/nzicon.go | 2 ++ map180/nzmap/nzmedium.go | 2 ++ map180/nzmap/nzrcicon.go | 2 ++ map180/nzmap/nzrcmedium.go | 2 ++ map180/nzmap/nzrmedium.go | 2 ++ map180/nzmap/nzsicon.go | 2 ++ map180/nzmap/nzsmedium.go | 2 ++ map180/nzmap_gen_test.go | 12 ++++++++++-- 8 files changed, 24 insertions(+), 2 deletions(-) diff --git a/map180/nzmap/nzicon.go b/map180/nzmap/nzicon.go index e43feb94..eeccf9b0 100644 --- a/map180/nzmap/nzicon.go +++ b/map180/nzmap/nzicon.go @@ -1,3 +1,5 @@ +// Code generated by nzmap_gen_test.go. DO NOT EDIT. + package nzmap var nzIcon = `Map of New Zealand.` diff --git a/map180/nzmap/nzmedium.go b/map180/nzmap/nzmedium.go index 2cf6d7d3..99b5d53b 100644 --- a/map180/nzmap/nzmedium.go +++ b/map180/nzmap/nzmedium.go @@ -1,3 +1,5 @@ +// Code generated by nzmap_gen_test.go. DO NOT EDIT. + package nzmap var nzMedium = `Map of New Zealand.` diff --git a/map180/nzmap/nzrcicon.go b/map180/nzmap/nzrcicon.go index 5757cbe3..82d694df 100644 --- a/map180/nzmap/nzrcicon.go +++ b/map180/nzmap/nzrcicon.go @@ -1,3 +1,5 @@ +// Code generated by nzmap_gen_test.go. DO NOT EDIT. + package nzmap var nzrcIcon = `Map of New Zealand.` diff --git a/map180/nzmap/nzrcmedium.go b/map180/nzmap/nzrcmedium.go index baa901ae..90e452cc 100644 --- a/map180/nzmap/nzrcmedium.go +++ b/map180/nzmap/nzrcmedium.go @@ -1,3 +1,5 @@ +// Code generated by nzmap_gen_test.go. DO NOT EDIT. + package nzmap var nzrcMedium = `Map of New Zealand.` diff --git a/map180/nzmap/nzrmedium.go b/map180/nzmap/nzrmedium.go index 70527a48..1d061628 100644 --- a/map180/nzmap/nzrmedium.go +++ b/map180/nzmap/nzrmedium.go @@ -1,3 +1,5 @@ +// Code generated by nzmap_gen_test.go. DO NOT EDIT. + package nzmap var nzrMedium = `Map of New Zealand.` diff --git a/map180/nzmap/nzsicon.go b/map180/nzmap/nzsicon.go index 19bd41ca..8f1ad5bb 100644 --- a/map180/nzmap/nzsicon.go +++ b/map180/nzmap/nzsicon.go @@ -1,3 +1,5 @@ +// Code generated by nzmap_gen_test.go. DO NOT EDIT. + package nzmap var nzsIcon = `Map of New Zealand.` diff --git a/map180/nzmap/nzsmedium.go b/map180/nzmap/nzsmedium.go index ee67dd07..b662b5f1 100644 --- a/map180/nzmap/nzsmedium.go +++ b/map180/nzmap/nzsmedium.go @@ -1,3 +1,5 @@ +// Code generated by nzmap_gen_test.go. DO NOT EDIT. + package nzmap var nzsMedium = `Map of New Zealand.` diff --git a/map180/nzmap_gen_test.go b/map180/nzmap_gen_test.go index 3504a98c..e9bf03fd 100644 --- a/map180/nzmap_gen_test.go +++ b/map180/nzmap_gen_test.go @@ -78,8 +78,9 @@ Export the environment variables in env.list, then generate and format the nzmap */ const ( - iconWidth = 100 - mediumWidth = 500 + generatedCodeWarning = "// Code generated by nzmap_gen_test.go. DO NOT EDIT.\n\n" + iconWidth = 100 + mediumWidth = 500 // used for drawing landmasses. landPath = "" // used for drawing lakes ontop of landmasses. @@ -159,6 +160,7 @@ func TestIconNewZealand(t *testing.T) { var out bytes.Buffer + out.WriteString(generatedCodeWarning) out.WriteString("package nzmap\n") out.WriteString("var nzIcon = `" + buf.String() + "`\n\n") out.WriteString("func init() {\n") @@ -213,6 +215,7 @@ func TestIconNewZealandRaoulChathams(t *testing.T) { var out bytes.Buffer + out.WriteString(generatedCodeWarning) out.WriteString("package nzmap\n") out.WriteString("var nzrcIcon = `" + buf.String() + "`\n\n") out.WriteString("func init() {\n") @@ -270,6 +273,7 @@ func TestIconNewZealandSouth(t *testing.T) { var out bytes.Buffer + out.WriteString(generatedCodeWarning) out.WriteString("package nzmap\n") out.WriteString("var nzsIcon = `" + buf.String() + "`\n\n") out.WriteString("func init() {\n") @@ -322,6 +326,7 @@ func TestNewZealand(t *testing.T) { var out bytes.Buffer + out.WriteString(generatedCodeWarning) out.WriteString("package nzmap\n") out.WriteString("var nzMedium = `" + buf.String() + "`\n\n") out.WriteString("func init() {\n") @@ -377,6 +382,7 @@ func TestNewZealandRaoulChathams(t *testing.T) { var out bytes.Buffer + out.WriteString(generatedCodeWarning) out.WriteString("package nzmap\n") out.WriteString("var nzrcMedium = `" + buf.String() + "`\n\n") out.WriteString("func init() {\n") @@ -434,6 +440,7 @@ func TestNewZealandSouth(t *testing.T) { var out bytes.Buffer + out.WriteString(generatedCodeWarning) out.WriteString("package nzmap\n") out.WriteString("var nzsMedium = `" + buf.String() + "`\n\n") out.WriteString("func init() {\n") @@ -487,6 +494,7 @@ func TestNewZealandRaoul(t *testing.T) { var out bytes.Buffer + out.WriteString(generatedCodeWarning) out.WriteString("package nzmap\n") out.WriteString("var nzrMedium = `" + buf.String() + "`\n\n") out.WriteString("func init() {\n") From 3d5f949297a9bf29cdc7206034fd5a872c69cc79 Mon Sep 17 00:00:00 2001 From: Callum Morris Date: Fri, 11 Sep 2026 09:42:09 +1200 Subject: [PATCH 4/4] feat: add viewbox to map180 icons To allow CSS to resize them without clipping --- map180/nzmap/nzicon.go | 2 +- map180/nzmap/nzrcicon.go | 2 +- map180/nzmap/nzsicon.go | 2 +- map180/nzmap_gen_test.go | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/map180/nzmap/nzicon.go b/map180/nzmap/nzicon.go index eeccf9b0..dde95b77 100644 --- a/map180/nzmap/nzicon.go +++ b/map180/nzmap/nzicon.go @@ -2,7 +2,7 @@ package nzmap -var nzIcon = `Map of New Zealand.` +var nzIcon = `Map of New Zealand.` func init() { nzIconPts[0][0] = pt{x: 0, y: 124} diff --git a/map180/nzmap/nzrcicon.go b/map180/nzmap/nzrcicon.go index 82d694df..c5b83c28 100644 --- a/map180/nzmap/nzrcicon.go +++ b/map180/nzmap/nzrcicon.go @@ -2,7 +2,7 @@ package nzmap -var nzrcIcon = `Map of New Zealand.` +var nzrcIcon = `Map of New Zealand.` func init() { nzrcIconPts[0][0] = pt{x: 0, y: 125} diff --git a/map180/nzmap/nzsicon.go b/map180/nzmap/nzsicon.go index 8f1ad5bb..3a2923fb 100644 --- a/map180/nzmap/nzsicon.go +++ b/map180/nzmap/nzsicon.go @@ -2,7 +2,7 @@ package nzmap -var nzsIcon = `Map of New Zealand.` +var nzsIcon = `Map of New Zealand.` func init() { nzsIconPts[0][0] = pt{x: 0, y: 125} diff --git a/map180/nzmap_gen_test.go b/map180/nzmap_gen_test.go index e9bf03fd..c88ad6fe 100644 --- a/map180/nzmap_gen_test.go +++ b/map180/nzmap_gen_test.go @@ -86,7 +86,7 @@ const ( // used for drawing lakes ontop of landmasses. lakePath = "" // fixed size SVG images (icons) - fixed = "Map of New Zealand." + fixed = "Map of New Zealand." // responsive responsive = "Map of New Zealand." ) @@ -154,7 +154,7 @@ func TestIconNewZealand(t *testing.T) { var buf bytes.Buffer - buf.WriteString(fmt.Sprintf(fixed, m.height, m.width)) + buf.WriteString(fmt.Sprintf(fixed, m.width, m.height, m.width, m.height)) buf.WriteString(fmt.Sprintf(landPath, land)) buf.WriteString(fmt.Sprintf(lakePath, lakes)) @@ -209,7 +209,7 @@ func TestIconNewZealandRaoulChathams(t *testing.T) { var buf bytes.Buffer - buf.WriteString(fmt.Sprintf(fixed, m.height, m.width)) + buf.WriteString(fmt.Sprintf(fixed, m.width, m.height, m.width, m.height)) buf.WriteString(fmt.Sprintf(landPath, land)) buf.WriteString(fmt.Sprintf(lakePath, lakes)) @@ -267,7 +267,7 @@ func TestIconNewZealandSouth(t *testing.T) { var buf bytes.Buffer - buf.WriteString(fmt.Sprintf(fixed, m.height, m.width)) + buf.WriteString(fmt.Sprintf(fixed, m.width, m.height, m.width, m.height)) buf.WriteString(fmt.Sprintf(landPath, land)) buf.WriteString(fmt.Sprintf(lakePath, lakes))