Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New indicators to investigate LCZ classification #937

Merged
merged 13 commits into from
Mar 14, 2024

Conversation

ebocher
Copy link
Member

@ebocher ebocher commented Feb 22, 2024

This PR proposes new indicators to investigate the characteristics of a territory: spatial distribution of objects, measurement of heterogeneity, neighborhood analyses, distribution of objects according to geographical directions, distances between objects...

Below some outputs on Dijon

Extract sprawl areas

dijon_icu_tache

Inside distances to sprawl areas

dijon_distances_tache_urbaine

Outside distances to sprawl areas

dijon_distances_tache_urbaine_out

Inside cool LCZ distances to sprawl areas

dijon_distances_cool_areas

Multiscale grid with adajacent cell values (3*3)

dijon_grid_scales

Sprawl surface by compass direction
image

ebocher added 4 commits February 2, 2024 14:26
… a territory: spatial distribution of objects, measurement of heterogeneity, neighborhood analyses, distribution of objects according to geographical directions, distances between objects...
@ebocher ebocher self-assigned this Feb 22, 2024
Copy link
Collaborator

@j3r3m1 j3r3m1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job !

tablesToDrop << lcz_count_lod
datasource.execute("""
drop table if exists $lcz_count_lod;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation ? For readability reason, would be better further right

tablesToDrop << lcz_count_lod_mode
datasource.execute("""
create index on $lcz_count_lod(ID_ROW_LOD_${i}, ID_COL_LOD_${i});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

tablesToDrop << grid_lod_level_final
datasource.execute("""
CREATE INDEX on $lcz_count_lod_mode(ID_ROW_LOD_${i}, ID_COL_LOD_${i});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

* Create a multi-scale grid and aggregate the LCZ_PRIMARY indicators for each level of the grid.
* For each level, the adjacent cells are preserved as well as the number of urban and natural cells.
* To distinguish between LCZ cells with the same count per level, a weight is used corresponding
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a weight is used TO SELECT ONLY ONE LCZ TYPE, corresponding...

* @param datasource connection to the database
* @param grid_indicators a grid that contains for each cell the LCZ_PRIMARY
* @param nb_levels number of aggregate levels. Default is 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the default value 2 instead of 1 ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope 1



/**
* @author Erwan Bocher (CNRS)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suppose to be in spatial unit class ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class will be deleted

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a new class ? I suppose having those in grid indicators would make the job ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand well, everything will be moved in the spatial unit class ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was the initial code. All methods will be moved in the good place.

void multiscaleLCZGridTest() {
//Data for test
h2GIS.execute("""
--Grid values
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure but is this test have an equal number of LCZ for one situation and thus has to use the weights to check that the weigths are OK ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weights are always used

@@ -225,4 +227,128 @@ class SpatialUnitsTests {
def countRows = postGIS.firstRow "select count(*) as numberOfRows from $outputTable"
assert 100 == countRows.numberOfRows
}

@Test
void sprawlAreasTest1() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is in one test for sprawling you test the "collapsing distance" to remove some objects being long but so thin that they disappear ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would not it be more reasonable to have these tests in gridIndicatorsTest since the methods belong to the gridIndicator class ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class will be removed

Copy link
Member Author

@ebocher ebocher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all super comments

* @param datasource connection to the database
* @param grid_indicators a grid that contains for each cell the LCZ_PRIMARY
* @param nb_levels number of aggregate levels. Default is 1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope 1

void multiscaleLCZGridTest() {
//Data for test
h2GIS.execute("""
--Grid values
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weights are always used

@@ -225,4 +227,128 @@ class SpatialUnitsTests {
def countRows = postGIS.firstRow "select count(*) as numberOfRows from $outputTable"
assert 100 == countRows.numberOfRows
}

@Test
void sprawlAreasTest1() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

@ebocher ebocher marked this pull request as ready for review March 14, 2024 15:48
@ebocher ebocher merged commit 7a51ba3 into orbisgis:master Mar 14, 2024
1 check passed
@ebocher ebocher deleted the master_sprawl branch June 21, 2024 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants