Skip to content

Commit

Permalink
Grid distances unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ebocher committed Mar 5, 2024
1 parent 8d6e4ca commit 9ad3f1f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ class GridIndicatorsTests {

def values = h2GIS.firstRow("SELECT * EXCEPT(THE_GEOM) FROM $grid_scale WHERE id_row = 2 AND id_col = 2 ".toString())

def expectedValues = [ID_COL: 2, ID_ROW: 2, ID_GRID: 10, LCZ_PRIMARY: 2, LCZ_PRIMARY_N: 104, LCZ_PRIMARY_NE: 104, LCZ_PRIMARY_E: 104, LCZ_PRIMARY_SE: 104, LCZ_PRIMARY_S: 104, LCZ_PRIMARY_SW: 104, LCZ_PRIMARY_W: 104, LCZ_PRIMARY_NW: 104, ID_ROW_LOD_1: 1, ID_COL_LOD_1: 1, LCZ_WARM_LOD_1: 1, LCZ_COOL_LOD_1: 8, LCZ_PRIMARY_LOD_1: 104, LCZ_PRIMARY_N_LOD_1: 104, LCZ_PRIMARY_NE_LOD_1: 2, LCZ_PRIMARY_E_LOD_1: 104, LCZ_PRIMARY_SE_LOD_1: null, LCZ_PRIMARY_S_LOD_1: null, LCZ_PRIMARY_SW_LOD_1: null, LCZ_PRIMARY_W_LOD_1: null, LCZ_PRIMARY_NW_LOD_1: null, LCZ_WARM_N_LOD_1: null, LCZ_WARN_NE_LOD_1: 4, LCZ_WARN_E_LOD_1: null, LCZ_WARN_SE_LOD_1: null, LCZ_WARN_S_LOD_1: null, LCZ_WARN_SW_LOD_1: null, LCZ_WARN_W_LOD_1: null, LCZ_WARN_NW_LOD_1: null]
def expectedValues = [ID_COL:2, ID_ROW:2, ID_GRID:10, LCZ_PRIMARY:2, LCZ_PRIMARY_N:104, LCZ_PRIMARY_NE:104, LCZ_PRIMARY_E:104, LCZ_PRIMARY_SE:104, LCZ_PRIMARY_S:104, LCZ_PRIMARY_SW:104, LCZ_PRIMARY_W:104, LCZ_PRIMARY_NW:104, ID_ROW_LOD_1:1, ID_COL_LOD_1:0, LCZ_WARM_LOD_1:1, LCZ_COOL_LOD_1:8, LCZ_PRIMARY_LOD_1:104, LCZ_PRIMARY_N_LOD_1:104, LCZ_PRIMARY_NE_LOD_1:2, LCZ_PRIMARY_E_LOD_1:104, LCZ_PRIMARY_SE_LOD_1:null, LCZ_PRIMARY_S_LOD_1:null, LCZ_PRIMARY_SW_LOD_1:null, LCZ_PRIMARY_W_LOD_1:null, LCZ_PRIMARY_NW_LOD_1:null, LCZ_WARM_N_LOD_1:null, LCZ_WARN_NE_LOD_1:4, LCZ_WARN_E_LOD_1:null, LCZ_WARN_SE_LOD_1:null, LCZ_WARN_S_LOD_1:null, LCZ_WARN_SW_LOD_1:null, LCZ_WARN_W_LOD_1:null, LCZ_WARN_NW_LOD_1:null, ID_ROW_LOD_2:1, ID_COL_LOD_2:1, LCZ_WARM_LOD_2:10, LCZ_COOL_LOD_2:71, LCZ_PRIMARY_LOD_2:104, LCZ_PRIMARY_N_LOD_2:null, LCZ_PRIMARY_NE_LOD_2:null, LCZ_PRIMARY_E_LOD_2:null, LCZ_PRIMARY_SE_LOD_2:null, LCZ_PRIMARY_S_LOD_2:null, LCZ_PRIMARY_SW_LOD_2:null, LCZ_PRIMARY_W_LOD_2:null, LCZ_PRIMARY_NW_LOD_2:null, LCZ_WARM_N_LOD_2:null, LCZ_WARN_NE_LOD_2:null, LCZ_WARN_E_LOD_2:null, LCZ_WARN_SE_LOD_2:null, LCZ_WARN_S_LOD_2:null, LCZ_WARN_SW_LOD_2:null, LCZ_WARN_W_LOD_2:null, LCZ_WARN_NW_LOD_2:null]

assertTrue(values == expectedValues)

values = h2GIS.firstRow("SELECT * EXCEPT(THE_GEOM) FROM $grid_scale WHERE id_row = 5 AND id_col = 5 ".toString())

expectedValues = [ID_COL: 5, ID_ROW: 5, ID_GRID: 40, LCZ_PRIMARY: 102, LCZ_PRIMARY_N: 2, LCZ_PRIMARY_NE: 2, LCZ_PRIMARY_E: 2, LCZ_PRIMARY_SE: 104, LCZ_PRIMARY_S: 104, LCZ_PRIMARY_SW: 104, LCZ_PRIMARY_W: 104, LCZ_PRIMARY_NW: 2, ID_ROW_LOD_1: 2, ID_COL_LOD_1: 2, LCZ_WARM_LOD_1: 4, LCZ_COOL_LOD_1: 5, LCZ_PRIMARY_LOD_1: 2, LCZ_PRIMARY_N_LOD_1: 104, LCZ_PRIMARY_NE_LOD_1: 2, LCZ_PRIMARY_E_LOD_1: 104, LCZ_PRIMARY_SE_LOD_1: 104, LCZ_PRIMARY_S_LOD_1: 104, LCZ_PRIMARY_SW_LOD_1: 104, LCZ_PRIMARY_W_LOD_1: 104, LCZ_PRIMARY_NW_LOD_1: 104, LCZ_WARM_N_LOD_1: null, LCZ_WARN_NE_LOD_1: 5, LCZ_WARN_E_LOD_1: null, LCZ_WARN_SE_LOD_1: null, LCZ_WARN_S_LOD_1: null, LCZ_WARN_SW_LOD_1: 1, LCZ_WARN_W_LOD_1: null, LCZ_WARN_NW_LOD_1: null]
expectedValues = [ID_COL:5, ID_ROW:5, ID_GRID:40, LCZ_PRIMARY:102, LCZ_PRIMARY_N:2, LCZ_PRIMARY_NE:2, LCZ_PRIMARY_E:2, LCZ_PRIMARY_SE:104, LCZ_PRIMARY_S:104, LCZ_PRIMARY_SW:104, LCZ_PRIMARY_W:104, LCZ_PRIMARY_NW:2, ID_ROW_LOD_1:2, ID_COL_LOD_1:1, LCZ_WARM_LOD_1:4, LCZ_COOL_LOD_1:5, LCZ_PRIMARY_LOD_1:2, LCZ_PRIMARY_N_LOD_1:104, LCZ_PRIMARY_NE_LOD_1:2, LCZ_PRIMARY_E_LOD_1:104, LCZ_PRIMARY_SE_LOD_1:104, LCZ_PRIMARY_S_LOD_1:104, LCZ_PRIMARY_SW_LOD_1:104, LCZ_PRIMARY_W_LOD_1:104, LCZ_PRIMARY_NW_LOD_1:104, LCZ_WARM_N_LOD_1:null, LCZ_WARN_NE_LOD_1:5, LCZ_WARN_E_LOD_1:null, LCZ_WARN_SE_LOD_1:null, LCZ_WARN_S_LOD_1:null, LCZ_WARN_SW_LOD_1:1, LCZ_WARN_W_LOD_1:null, LCZ_WARN_NW_LOD_1:null, ID_ROW_LOD_2:1, ID_COL_LOD_2:1, LCZ_WARM_LOD_2:10, LCZ_COOL_LOD_2:71, LCZ_PRIMARY_LOD_2:104, LCZ_PRIMARY_N_LOD_2:null, LCZ_PRIMARY_NE_LOD_2:null, LCZ_PRIMARY_E_LOD_2:null, LCZ_PRIMARY_SE_LOD_2:null, LCZ_PRIMARY_S_LOD_2:null, LCZ_PRIMARY_SW_LOD_2:null, LCZ_PRIMARY_W_LOD_2:null, LCZ_PRIMARY_NW_LOD_2:null, LCZ_WARM_N_LOD_2:null, LCZ_WARN_NE_LOD_2:null, LCZ_WARN_E_LOD_2:null, LCZ_WARN_SE_LOD_2:null, LCZ_WARN_S_LOD_2:null, LCZ_WARN_SW_LOD_2:null, LCZ_WARN_W_LOD_2:null, LCZ_WARN_NW_LOD_2:null]

assertTrue(values == expectedValues)

Expand Down

0 comments on commit 9ad3f1f

Please sign in to comment.