diff --git a/map180/nzmap/nzicon.go b/map180/nzmap/nzicon.go index bfcc13f..dde95b7 100644 --- a/map180/nzmap/nzicon.go +++ b/map180/nzmap/nzicon.go @@ -1,18 +1,8 @@ +// Code generated by nzmap_gen_test.go. DO NOT EDIT. + 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 8499564..99b5d53 100644 --- a/map180/nzmap/nzmedium.go +++ b/map180/nzmap/nzmedium.go @@ -1,18 +1,8 @@ +// Code generated by nzmap_gen_test.go. DO NOT EDIT. + 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 65a9fc0..c5b83c2 100644 --- a/map180/nzmap/nzrcicon.go +++ b/map180/nzmap/nzrcicon.go @@ -1,18 +1,8 @@ +// Code generated by nzmap_gen_test.go. DO NOT EDIT. + 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 9c5466f..90e452c 100644 --- a/map180/nzmap/nzrcmedium.go +++ b/map180/nzmap/nzrcmedium.go @@ -1,18 +1,8 @@ +// Code generated by nzmap_gen_test.go. DO NOT EDIT. + 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 7d545d4..1d06162 100644 --- a/map180/nzmap/nzrmedium.go +++ b/map180/nzmap/nzrmedium.go @@ -1,18 +1,8 @@ +// Code generated by nzmap_gen_test.go. DO NOT EDIT. + 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 270f838..3a2923f 100644 --- a/map180/nzmap/nzsicon.go +++ b/map180/nzmap/nzsicon.go @@ -1,18 +1,8 @@ +// Code generated by nzmap_gen_test.go. DO NOT EDIT. + 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 +71,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 +203,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 +467,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 4613669..b662b5f 100644 --- a/map180/nzmap/nzsmedium.go +++ b/map180/nzmap/nzsmedium.go @@ -1,18 +1,8 @@ +// Code generated by nzmap_gen_test.go. DO NOT EDIT. + 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 +71,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 +203,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 +467,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 1876562..c88ad6f 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,28 +62,31 @@ 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 ( - 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 = "" + landPath = "" // used for drawing lakes ontop of landmasses. - lakePath = "" + lakePath = "" // fixed size SVG images (icons) - fixed = "Map of New Zealand." + fixed = "Map of New Zealand." // responsive responsive = "Map of New Zealand." ) @@ -149,12 +154,13 @@ 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)) 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") @@ -203,12 +209,13 @@ 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)) 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") @@ -260,12 +267,13 @@ 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)) 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") @@ -318,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") @@ -373,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") @@ -430,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") @@ -483,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")