Skip to content

Commit

Permalink
feat: added filters for land coverage type groups
Browse files Browse the repository at this point in the history
  • Loading branch information
santilland committed Oct 29, 2024
1 parent 1397681 commit 21e3c1d
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions app/src/config/gtif.js
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,34 @@ export const globalIndicators = [
max: 100,
range: [0, 100],
},
forests: {
display: true,
type: 'boolfilter',
label: 'Forest type coverage',
id: 'forests',
value: 0,
},
crops: {
display: true,
type: 'boolfilter',
label: 'Crop type coverage',
id: 'crops',
value: 0,
},
grasslands: {
display: true,
type: 'boolfilter',
label: 'Grassland type coverage',
id: 'grasslands',
value: 0,
},
settlements: {
display: true,
type: 'boolfilter',
label: 'Settlement type coverage',
id: 'settlements',
value: 0,
},
},
},
display: [
Expand All @@ -1360,6 +1388,10 @@ export const globalIndicators = [
variables: {
varMin: 0,
varMax: 100,
forests: 0,
crops: 0,
grasslands: 0,
settlements: 0,
},
color: [
'case',
Expand All @@ -1375,6 +1407,24 @@ export const globalIndicators = [
['*', ['var', 'varMax'], 2.55],
*/
],
// if no coverage filter is selected show all data
[
'case',
['all',
['==', ['var', 'forests'], 0],
['==', ['var', 'crops'], 0],
['==', ['var', 'grasslands'], 0],
['==', ['var', 'settlements'], 0],
],
1,
[
'any',
['all', ['==', ['var', 'forests'], 1], ['between', ['band', 3], 100, 200]],
['all', ['==', ['var', 'crops'], 1], ['between', ['band', 3], 200, 300]],
['all', ['==', ['var', 'grasslands'], 1], ['between', ['band', 3], 300, 400]],
['all', ['==', ['var', 'settlements'], 1], ['between', ['band', 3], 500, 600]],
],
],
],
[
'interpolate',
Expand Down

0 comments on commit 21e3c1d

Please sign in to comment.