-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
addition of gridded livestock layers
- Loading branch information
1 parent
fddf30d
commit 05f765a
Showing
8 changed files
with
184 additions
and
2 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
cloud_functions/earth_engine_tiler/src/geeAssets/common-styles-utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export const GriddedLivestockCommonStyles = | ||
|
||
'<RasterSymbolizer>' + | ||
'<ColorMap type="ramp" extended="false">' + | ||
'<ColorMapEntry color="#FFFFFF" quantity="0" label="0" />' + | ||
'<ColorMapEntry color="#E0F7FA" quantity="5" label="≤ 5" />' + | ||
'<ColorMapEntry color="#B2EBF2" quantity="10" label="≤ 10" />' + | ||
'<ColorMapEntry color="#80DEEA" quantity="20" label="≤ 20" />' + | ||
'<ColorMapEntry color="#68B0C3" quantity="50" label="≤ 50" />' + | ||
'<ColorMapEntry color="#4A99B4" quantity="100" label="≤ 100" />' + | ||
'<ColorMapEntry color="#3F8B9C" quantity="250" label="≤ 250" />' + | ||
'<ColorMapEntry color="#c766fc" quantity="500" label="≤ 500" />' + | ||
'<ColorMapEntry color="#9c50c7" quantity="1000" label="≤ 1,000" />' + | ||
'<ColorMapEntry color="#883886" quantity="2500" label="≤ 2,500" />' + | ||
'<ColorMapEntry color="#390147" quantity="300000" label="> 2,500" />' + | ||
'</ColorMap>' + | ||
'</RasterSymbolizer>' |
30 changes: 30 additions & 0 deletions
30
cloud_functions/earth_engine_tiler/src/geeAssets/gridded-livestock-buffalo.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { CategoricalDataset } from './earth-engine-dataset'; | ||
import ee from '@google/earthengine'; | ||
import { EarthEngineUtils } from "../earth-engine-utils"; | ||
import { GriddedLivestockCommonStyles} from "./common-styles-utils"; | ||
|
||
export const GriddedLivestockBuffalo: CategoricalDataset = { | ||
assetPath: { | ||
default: "projects/gmvad-grass/assets/5_Bf_2015_Da" | ||
}, | ||
|
||
bandName: 'b1', | ||
|
||
sldStyles: GriddedLivestockCommonStyles, | ||
|
||
|
||
areYearsValid(startYear?: number, endYear?: number): boolean { | ||
// This Asset is static, and year selector is irrelevant | ||
return true; | ||
}, | ||
|
||
getEEAsset() { | ||
return ee.Image(this.assetPath.default); | ||
}, | ||
|
||
async getMapUrl(z, x, y) { | ||
const image = this.getEEAsset().select(this.bandName).sldStyle(this.sldStyles); | ||
const mapId = await EarthEngineUtils.getMapId(image); | ||
return ee.data.getTileUrl(mapId, x, y, z); | ||
}, | ||
}; |
30 changes: 30 additions & 0 deletions
30
cloud_functions/earth_engine_tiler/src/geeAssets/gridded-livestock-cattle.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { CategoricalDataset } from './earth-engine-dataset'; | ||
import ee from '@google/earthengine'; | ||
import { EarthEngineUtils } from "../earth-engine-utils"; | ||
import { GriddedLivestockCommonStyles} from "./common-styles-utils"; | ||
|
||
export const GriddedLivestockCattle: CategoricalDataset = { | ||
assetPath: { | ||
default: "projects/gmvad-grass/assets/5_Ct_2015_Da" | ||
}, | ||
|
||
bandName: 'b1', | ||
|
||
sldStyles: GriddedLivestockCommonStyles, | ||
|
||
|
||
areYearsValid(startYear?: number, endYear?: number): boolean { | ||
// This Asset is static, and year selector is irrelevant | ||
return true; | ||
}, | ||
|
||
getEEAsset() { | ||
return ee.Image(this.assetPath.default); | ||
}, | ||
|
||
async getMapUrl(z, x, y) { | ||
const image = this.getEEAsset().select(this.bandName).sldStyle(this.sldStyles); | ||
const mapId = await EarthEngineUtils.getMapId(image); | ||
return ee.data.getTileUrl(mapId, x, y, z); | ||
}, | ||
}; |
30 changes: 30 additions & 0 deletions
30
cloud_functions/earth_engine_tiler/src/geeAssets/gridded-livestock-goat.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { CategoricalDataset } from './earth-engine-dataset'; | ||
import ee from '@google/earthengine'; | ||
import { EarthEngineUtils } from "../earth-engine-utils"; | ||
import { GriddedLivestockCommonStyles} from "./common-styles-utils"; | ||
|
||
export const GriddedLivestockGoat: CategoricalDataset = { | ||
assetPath: { | ||
default: "projects/gmvad-grass/assets/5_Gt_2015_Da" | ||
}, | ||
|
||
bandName: 'b1', | ||
|
||
sldStyles: GriddedLivestockCommonStyles, | ||
|
||
|
||
areYearsValid(startYear?: number, endYear?: number): boolean { | ||
// This Asset is static, and year selector is irrelevant | ||
return true; | ||
}, | ||
|
||
getEEAsset() { | ||
return ee.Image(this.assetPath.default); | ||
}, | ||
|
||
async getMapUrl(z, x, y) { | ||
const image = this.getEEAsset().select(this.bandName).sldStyle(this.sldStyles); | ||
const mapId = await EarthEngineUtils.getMapId(image); | ||
return ee.data.getTileUrl(mapId, x, y, z); | ||
}, | ||
}; |
30 changes: 30 additions & 0 deletions
30
cloud_functions/earth_engine_tiler/src/geeAssets/gridded-livestock-horse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { CategoricalDataset } from './earth-engine-dataset'; | ||
import ee from '@google/earthengine'; | ||
import { EarthEngineUtils } from "../earth-engine-utils"; | ||
import { GriddedLivestockCommonStyles} from "./common-styles-utils"; | ||
|
||
export const GriddedLivestockHorse: CategoricalDataset = { | ||
assetPath: { | ||
default: "projects/gmvad-grass/assets/5_Ho_2015_Da" | ||
}, | ||
|
||
bandName: 'b1', | ||
|
||
sldStyles: GriddedLivestockCommonStyles, | ||
|
||
|
||
areYearsValid(startYear?: number, endYear?: number): boolean { | ||
// This Asset is static, and year selector is irrelevant | ||
return true; | ||
}, | ||
|
||
getEEAsset() { | ||
return ee.Image(this.assetPath.default); | ||
}, | ||
|
||
async getMapUrl(z, x, y) { | ||
const image = this.getEEAsset().select(this.bandName).sldStyle(this.sldStyles); | ||
const mapId = await EarthEngineUtils.getMapId(image); | ||
return ee.data.getTileUrl(mapId, x, y, z); | ||
}, | ||
}; |
30 changes: 30 additions & 0 deletions
30
cloud_functions/earth_engine_tiler/src/geeAssets/gridded-livestock-sheep.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { CategoricalDataset } from './earth-engine-dataset'; | ||
import ee from '@google/earthengine'; | ||
import { EarthEngineUtils } from "../earth-engine-utils"; | ||
import { GriddedLivestockCommonStyles} from "./common-styles-utils"; | ||
|
||
export const GriddedLivestockSheep: CategoricalDataset = { | ||
assetPath: { | ||
default: "projects/gmvad-grass/assets/5_Sh_2015_Da" | ||
}, | ||
|
||
bandName: 'b1', | ||
|
||
sldStyles: GriddedLivestockCommonStyles, | ||
|
||
|
||
areYearsValid(startYear?: number, endYear?: number): boolean { | ||
// This Asset is static, and year selector is irrelevant | ||
return true; | ||
}, | ||
|
||
getEEAsset() { | ||
return ee.Image(this.assetPath.default); | ||
}, | ||
|
||
async getMapUrl(z, x, y) { | ||
const image = this.getEEAsset().select(this.bandName).sldStyle(this.sldStyles); | ||
const mapId = await EarthEngineUtils.getMapId(image); | ||
return ee.data.getTileUrl(mapId, x, y, z); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters