Calculating Area in Earth Engine
HTML-код
- Опубликовано: 26 авг 2024
- We try to learn to calculate area in #earthengine. We follow the blog from spatial thoughts. Please follow the links for more.
* * * * *
earth engine tutorial: developers.goo...
blog: spatialthought...
* * * * *
some practice:
checking the crop area and urban area in Nepal
/ 1569781629115322368
( codes in the pinned comment )
// Some practice here:
var mod = ee.ImageCollection("MODIS/006/MCD12Q1")
var filtered = mod.map(function(img){
return img.select('LC_Type1').eq(12)
}).toBands()
// var arearesult = filtered.map(function(img){
var areaImage = filtered.multiply(ee.Image.pixelArea()).divide(1e6)
var areaAgri = areaImage.reduceRegion({
reducer: ee.Reducer.sum(),
geometry: npl.geometry(), //npl = nepal shape file
scale: 500,
maxPixels: 1e10
})
// print(areaAgri)
var chart = ui.Chart.array.values({
array: areaAgri.values(),
axis: 0,
xLabels: areaAgri.keys()
}).setChartType('LineChart')
.setOptions({
title: 'Crop Lands are rapidly decreasing in Nepal.',
// hAxis: {title: 'Years (2001-2020'},
vAxis: {title: 'Area (sq. km.)'},
legend: { position: "none" },
lineWidth: 1,
pointSize: 3
});
print(chart);
///////////////
///////////////////
var filtered = mod.map(function(img){
return img.select('LC_Type1').eq(13)
}).toBands()
// var arearesult = filtered.map(function(img){
var areaImage = filtered.multiply(ee.Image.pixelArea()).divide(1e6)
var areaUrban = areaImage.reduceRegion({
reducer: ee.Reducer.sum(),
geometry: npl.geometry(),
scale: 500,
maxPixels: 1e10
})
//print(areaUrban)
var chart = ui.Chart.array.values({
array: areaUrban.values(),
axis: 0,
xLabels: areaUrban.keys()
}).setChartType('LineChart')
.setOptions({
title: 'Urban Areas are in increasing trends in Nepal.',
//hAxis: {format:'short'},
vAxis: {title: 'Area (sq. km.)'},
legend: { position: "none" },
lineWidth: 1,
pointSize: 3
});
print(chart);
Thank you very much!
Thank very my for your explanation. Helpful to do my project. From India.
Hello, thankyou for checking. Please follow the related blog for more. :)
@@ksabmagar7 for sure 😃
Thanks for sharing, by any chance have you already worked with Random forest trees and how to graph their importance variables?, Gretings from Mexico
Can you plot random forest?
There was one content earlier, hyperparameter tuning. You sure have checked that. One way is that. I have some basic knowledge I should say. We can check some books in R doing such things.
Thanks for uploading this.
Please upload Machine learning Approachs and gis many types models created in python
Hope to learn more. Thanks for the comments.