Skip to content

Commit

Permalink
Improve multiscale grid
Browse files Browse the repository at this point in the history
  • Loading branch information
ebocher committed Mar 4, 2024
1 parent eda745b commit f960cc5
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ String gridPopulation(JdbcDataSource datasource, String gridTable, String popula
def outputTableName = postfix BASE_NAME

//Indexing table
datasource.createSpatialIndex(gridTable,"the_geom")
datasource.createSpatialIndex(populationTable,"the_geom")
datasource.createSpatialIndex(gridTable, "the_geom")
datasource.createSpatialIndex(populationTable, "the_geom")
def popColumns = []
def sum_popColumns = []
if (populationColumns) {
Expand Down Expand Up @@ -124,19 +124,19 @@ String multiscaleLCZGrid(JdbcDataSource datasource, String grid_indicators, int
def grid_scaling_indices = postfix("grid_scaling_indices")
def grid_levels_query = []
int grid_offset = 3
int offsetCol = 0
int offsetCol = 1
for (int i in 1..nb_levels) {
int level = Math.pow(grid_offset, i)
grid_levels_query << " (CAST (ABS(ID_ROW-1)/${level} AS INT)+1) AS ID_ROW_LOD_$i," +
"(CAST (ABS(ID_COL-1)/${level} AS INT)+$offsetCol) AS ID_COL_LOD_$i"
"(CAST (ABS(ID_COL-1)/${level} AS INT)+$offsetCol-1) AS ID_COL_LOD_$i"
offsetCol++
}

//Compute the indices for each levels and find the 8 adjacent cells
datasource.execute("""DROP TABLE IF EXISTS $grid_scaling_indices;
CREATE TABLE $grid_scaling_indices as SELECT *, ${grid_levels_query.join(",")},
(SELECT LCZ_PRIMARY FROM $grid_indicators WHERE ID_ROW = a.ID_ROW+1 AND ID_COL=a.ID_COL) AS LCZ_PRIMARY_N,
(SELECT LCZ_PRIMARY FROM $grid_indicators WHERE ID_ROW = a.ID_ROW+1 AND ID_COL+1=a.ID_COL) AS LCZ_PRIMARY_NE,
(SELECT LCZ_PRIMARY FROM $grid_indicators WHERE ID_ROW = a.ID_ROW+1 AND ID_COL=a.ID_COL+1) AS LCZ_PRIMARY_NE,
(SELECT LCZ_PRIMARY FROM $grid_indicators WHERE ID_ROW = a.ID_ROW AND ID_COL=a.ID_COL+1) AS LCZ_PRIMARY_E,
(SELECT LCZ_PRIMARY FROM $grid_indicators WHERE ID_ROW = a.ID_ROW-1 AND ID_COL=a.ID_COL+1) AS LCZ_PRIMARY_SE,
(SELECT LCZ_PRIMARY FROM $grid_indicators WHERE ID_ROW = a.ID_ROW-1 AND ID_COL=a.ID_COL) AS LCZ_PRIMARY_S,
Expand All @@ -145,9 +145,9 @@ String multiscaleLCZGrid(JdbcDataSource datasource, String grid_indicators, int
(SELECT LCZ_PRIMARY FROM $grid_indicators WHERE ID_ROW = a.ID_ROW+1 AND ID_COL=a.ID_COL-1) AS LCZ_PRIMARY_NW FROM
$grid_indicators as a; """.toString())

def tablesToDrop =[]
def tablesToDrop = []
def tableLevelToJoin = grid_scaling_indices
tablesToDrop<<grid_scaling_indices
tablesToDrop << grid_scaling_indices

//Process all level of details
for (int i in 1..nb_levels) {
Expand All @@ -158,7 +158,7 @@ String multiscaleLCZGrid(JdbcDataSource datasource, String grid_indicators, int
//Use the original grid to aggregate the data
//A weight is used to select the LCZ value when the mode returns more than one possibility
def lcz_count_lod = postfix("lcz_count_lod")
tablesToDrop<<lcz_count_lod
tablesToDrop << lcz_count_lod
datasource.execute("""
drop table if exists $lcz_count_lod;
CREATE TABLE $lcz_count_lod as
Expand All @@ -178,39 +178,49 @@ String multiscaleLCZGrid(JdbcDataSource datasource, String grid_indicators, int
//Select the LCZ values according the maximum number of cells and the weight
//Note that we compute the number of cells for urban and cool LCZ
def lcz_count_lod_mode = postfix("lcz_count_lod_mode")
tablesToDrop<<lcz_count_lod_mode
tablesToDrop << lcz_count_lod_mode
datasource.execute("""
create index on $lcz_count_lod(ID_ROW_LOD_${i}, ID_COL_LOD_${i});
DROP TABLE IF EXISTS $lcz_count_lod_mode;
CREATE TABLE $lcz_count_lod_mode as
select distinct on (ID_ROW_LOD_${i}, ID_COL_LOD_${i}) *,
(select sum(count) from $lcz_count_lod where
LCZ_PRIMARY in (1,2,3,4,5,6,7,8,9,10,105)
and ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i} and ID_COL_LOD_${i}= a.ID_COL_LOD_${i}) AS LCZ_PRIMARY_URBAN_LOD_${i},
and ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i} and ID_COL_LOD_${i}= a.ID_COL_LOD_${i}) AS LCZ_WARM_LOD_${i},
(select sum(count) from $lcz_count_lod where
LCZ_PRIMARY in (101,102,103,104,106,107)
and ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i} and ID_COL_LOD_${i}= a.ID_COL_LOD_${i}) AS LCZ_PRIMARY_COOL_LOD_${i},
and ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i} and ID_COL_LOD_${i}= a.ID_COL_LOD_${i}) AS LCZ_COOL_LOD_${i},
from $lcz_count_lod as a
order by ID_ROW_LOD_${i}, ID_COL_LOD_${i}, weight_lcz desc, count asc;""".toString())
order by count desc, ID_ROW_LOD_${i}, ID_COL_LOD_${i}, weight_lcz;""".toString())

//Find the 8 adjacent cells for the current level
def grid_lod_level_final = postfix("grid_lod_level_final")
tablesToDrop<<grid_lod_level_final
tablesToDrop << grid_lod_level_final
datasource.execute("""
CREATE INDEX on $lcz_count_lod_mode(ID_ROW_LOD_${i}, ID_COL_LOD_${i});
DROP TABLE IF EXISTS $grid_lod_level_final;
CREATE TABLE $grid_lod_level_final as select * EXCEPT(LCZ_PRIMARY, COUNT, weight_lcz), LCZ_PRIMARY AS LCZ_PRIMARY_LOD_${i},
(SELECT LCZ_PRIMARY FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i}+1 AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}) AS LCZ_PRIMARY_N_LOD_${i},
(SELECT LCZ_PRIMARY FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i}+1 AND ID_COL_LOD_${i}+1=a.ID_COL_LOD_${i}) AS LCZ_PRIMARY_NE_LOD_${i},
(SELECT LCZ_PRIMARY FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i}+1 AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}+1) AS LCZ_PRIMARY_NE_LOD_${i},
(SELECT LCZ_PRIMARY FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i} AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}+1) AS LCZ_PRIMARY_E_LOD_${i},
(SELECT LCZ_PRIMARY FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i}-1 AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}+1) AS LCZ_PRIMARY_SE_LOD_${i},
(SELECT LCZ_PRIMARY FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i}-1 AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}) AS LCZ_PRIMARY_S_LOD_${i},
(SELECT LCZ_PRIMARY FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i}-1 AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}-1) AS LCZ_PRIMARY_SW_LOD_${i},
(SELECT LCZ_PRIMARY FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i} AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}-1) AS LCZ_PRIMARY_W_LOD_${i},
(SELECT LCZ_PRIMARY FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i}+1 AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}-1) AS LCZ_PRIMARY_NW_LOD_${i} FROM
$lcz_count_lod_mode as a; """.toString())
(SELECT LCZ_PRIMARY FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i}+1 AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}-1) AS LCZ_PRIMARY_NW_LOD_${i},
(SELECT LCZ_WARM_LOD_${i} FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i}+1 AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}) AS LCZ_WARM_N_LOD_${i},
(SELECT LCZ_WARM_LOD_${i} FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i}+1 AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}+1) AS LCZ_WARN_NE_LOD_${i},
(SELECT LCZ_WARM_LOD_${i} FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i} AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}+1) AS LCZ_WARN_E_LOD_${i},
(SELECT LCZ_WARM_LOD_${i} FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i}-1 AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}+1) AS LCZ_WARN_SE_LOD_${i},
(SELECT LCZ_WARM_LOD_${i} FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i}-1 AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}) AS LCZ_WARN_S_LOD_${i},
(SELECT LCZ_WARM_LOD_${i} FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i}-1 AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}-1) AS LCZ_WARN_SW_LOD_${i},
(SELECT LCZ_WARM_LOD_${i} FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i} AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}-1) AS LCZ_WARN_W_LOD_${i},
(SELECT LCZ_WARM_LOD_${i} FROM $lcz_count_lod_mode WHERE ID_ROW_LOD_${i} = a.ID_ROW_LOD_${i}+1 AND ID_COL_LOD_${i}=a.ID_COL_LOD_${i}-1) AS LCZ_WARN_NW_LOD_${i},
FROM $lcz_count_lod_mode as a; """.toString())

tableLevelToJoin<<grid_lod_level_final
tableLevelToJoin << grid_lod_level_final

//Join the final grid level with the original grid
def grid_level_join = postfix("grid_level_join")
Expand All @@ -223,27 +233,8 @@ String multiscaleLCZGrid(JdbcDataSource datasource, String grid_indicators, int
where a.ID_ROW_LOD_${i} = b.ID_ROW_LOD_${i} and a.ID_COL_LOD_${i}= b.ID_COL_LOD_${i}
group by a.ID_ROW_LOD_${i}, a.ID_COL_LOD_${i}, a.the_geom;
""".toString())
tableLevelToJoin=grid_level_join
tableLevelToJoin = grid_level_join
}

datasource.save(tableLevelToJoin, "/tmp/tableLevelToJoin.geojson", true)

for (int i in 1..nb_levels) {

def grid_lod = postfix("grid_lod")
tablesToDrop << grid_lod
datasource.execute("""
create index on $tableLevelToJoin(ID_ROW_LOD_${i}, ID_COL_LOD_${i});
DROP TABLE IF EXIsTS $grid_lod;
CREATE TABLE $grid_lod AS
SELECT ST_UNION(ST_ACCUM(THE_GEOM)) AS THE_GEOM
from $tableLevelToJoin
group by ID_ROW_LOD_${i}, ID_COL_LOD_${i};
""".toString())

datasource.save(grid_lod, "/tmp/grid_lod_${i}.geojson", true)
}

datasource.dropTable(tablesToDrop)

return tableLevelToJoin
Expand All @@ -259,6 +250,7 @@ String multiscaleLCZGrid(JdbcDataSource datasource, String grid_indicators, int
* @param grid a regular grid
* @param id_grid name of the unique identifier column for the cells of the grid
* @author Erwan Bocher (CNRS)
* TODO : convert this method as a function table in H2GIS
*/
String gridDistances(JdbcDataSource datasource, String input_polygons, String grid, String id_grid) {
if (!input_polygons) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,11 +609,13 @@ String createGrid(JdbcDataSource datasource, Geometry geometry, double deltaX, d


/**
* This method allows to compute a sprawl areas layer
* This method allows to compute a sprawl areas layer from a regular grid that
* contains the fraction area of each LCZ type for each cell.
*
* A sprawl geometry represents a continous areas of urban LCZs (1 to 10 plus 105)
* @param datasource connexion to the database
* @param grid_indicators a grid that contains the LCZ fractions
* @param fraction value to select the cells of the grid to be included in the sprawl areas
* @param fraction value to select the cells of the grid to be included in the sprawl areas.
* @param distance value to erode (delete) small sprawl areas
* @author Erwan Bocher (CNRS)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.orbisgis.geoclimate.geoindicators

import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.io.TempDir
import org.orbisgis.data.H2GIS
Expand Down Expand Up @@ -54,20 +55,44 @@ class GridIndicatorsTests {
UPDATE grid SET lcz_primary= 2 WHERE id_row = 7 AND id_col = 8;
UPDATE grid SET lcz_primary= 2 WHERE id_row = 7 AND id_col = 9;
""".toString())
String grid_scale = Geoindicators.GridIndicators.multiscaleLCZGrid(h2GIS, "grid", 1)
String grid_scale = Geoindicators.GridIndicators.multiscaleLCZGrid(h2GIS, "grid", 2)

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

def expectedValues=[ID_GRID:10, ID_ROW:2, ID_COL:2, 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_PRIMARY_URBAN_LOD_1:1, LCZ_PRIMARY_COOL_LOD_1:8, LCZ_PRIMARY_LOD_1:104, LCZ_PRIMARY_N_LOD_1:104, LCZ_PRIMARY_NE_LOD_1:null, 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]
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]

assertTrue(values == expectedValues)

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

expectedValues=[ID_GRID:40, ID_ROW:5, ID_COL:5, 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_PRIMARY_URBAN_LOD_1:4, LCZ_PRIMARY_COOL_LOD_1:5, LCZ_PRIMARY_LOD_1:104, LCZ_PRIMARY_N_LOD_1:104, LCZ_PRIMARY_NE_LOD_1:104, 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]
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]

assertTrue(values == expectedValues)

h2GIS.dropTable("grid")
}

@Test
@Disabled
//Todo a test that shows how to create the a geom layer for each lod
void multiscaleLCZGridGeomTest() {
String grid_indicators = h2GIS.load("/home/ebocher/Autres/data/geoclimate/uhi_lcz/Dijon/grid_indicators.geojson", true)
int nb_levels= 3
String grid_scale = Geoindicators.GridIndicators.multiscaleLCZGrid(h2GIS, grid_indicators, nb_levels)

for (int i in 1..nb_levels) {
def grid_lod = "grid_lod_$i"
h2GIS.execute("""
create index on $grid_scale(ID_ROW_LOD_${i}, ID_COL_LOD_${i});
DROP TABLE IF EXIsTS $grid_lod;
CREATE TABLE $grid_lod AS
SELECT ST_UNION(ST_ACCUM(THE_GEOM)) AS THE_GEOM, MAX(LCZ_PRIMARY_LOD_${i}) AS LCZ_PRIMARY
from $grid_scale
group by ID_ROW_LOD_${i}, ID_COL_LOD_${i};
""".toString())
h2GIS.save(grid_lod, "/tmp/grid_lod_${i}.geojson", true)
h2GIS.dropTable(grid_lod)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,21 @@ class SpatialUnitsTests {

@Test
void sprawlAreasTest() {
String grid_indicators = h2GIS.load("/home/ebocher/Autres/data/geoclimate/uhi_lcz/Dijon/grid_indicators.geojson", true)
String sprawl_areas = Geoindicators.SpatialUnits.computeSprawlAreas(h2GIS, grid_indicators)
//Data for test
h2GIS.execute("""
--Grid values
DROP TABLE IF EXISTS grid;
CREATE TABLE grid AS SELECT * EXCEPT(ID), id as id_grid, 0 AS LCZ_PRIMARY_1, 1 AS LCZ_PRIMARY_104 FROM
ST_MakeGrid('POLYGON((0 0, 9 0, 9 9, 0 0))'::GEOMETRY, 100, 100);
--Center cell urban
UPDATE grid SET LCZ_PRIMARY_1= 1 , LCZ_PRIMARY_104 =0 WHERE id_row = 5 AND id_col = 5;
UPDATE grid SET LCZ_PRIMARY_1= 1 , LCZ_PRIMARY_104 =0 WHERE id_row = 6 AND id_col = 4;
UPDATE grid SET LCZ_PRIMARY_1= 1 , LCZ_PRIMARY_104 =0 WHERE id_row = 6 AND id_col = 5;
UPDATE grid SET LCZ_PRIMARY_1= 1 , LCZ_PRIMARY_104 =0 WHERE id_row = 6 AND id_col = 6;
UPDATE grid SET LCZ_PRIMARY_1= 1 , LCZ_PRIMARY_104 =0 WHERE id_row = 5 AND id_col = 6;
""".toString())
//String grid_indicators = h2GIS.load("/home/ebocher/Autres/data/geoclimate/uhi_lcz/Dijon/grid_indicators.geojson", true)
String sprawl_areas = Geoindicators.SpatialUnits.computeSprawlAreas(h2GIS, "grid", 0.65, 10)

h2GIS.save(sprawl_areas, "/tmp/sprawl_areas.geojson", true)

Expand Down

0 comments on commit f960cc5

Please sign in to comment.