openforis / fra-platform

7 stars 6 forks source link

GEO: Calculate aligned tree cover area percentage of selected layers #3753

Open yaguzmang opened 2 months ago

yaguzmang commented 2 months ago

From @pengchenglai:

is there any possibility that we have the feature in the geo-spatial tool that allows users to see the aligned tree cover area(percentage) between different (selected) sources, which may also include user-uploaded GEE ID?

TODO:

yaguzmang commented 2 months ago

@minotogna Just had a call with Pengcheng, and this functionality is covered by the ESTIMATE CUSTOM AGREEMENT AREA button, so there is no need to implement an extra feature. We can close this issue.

drawing
pengchenglai commented 2 months ago

@yaguzmang @minotogna

Yes, it does work, as demonstrated in the call, but when I try it, there is an error: image

yaguzmang commented 2 months ago

@pengchenglai I will look into it

yaguzmang commented 2 months ago

I was able to reproduce in the review platform (with another country):

Image

It seems to be related to the allowed computations that can be done at the same time in GEE. After waiting for a bit, I made the request again and got back the result:

Image

pengchenglai commented 2 months ago

It might work for a country with a relatively smaller land area, but for medium-sized and larger countries, the same approach does not seem to work and might exceed the computational power regardless of the waiting time. image

pengchenglai commented 2 months ago

@yaguzmang

minotogna commented 2 months ago

It might work for a country with a relatively smaller land area, but for medium-sized and larger countries, the same approach does not seem to work and might exceed the computational power regardless of the waiting time.

image

@pengchenglai @yaguzmang We need to talk on how to fix this . Maybe some big machine with cloud computing , but must be done outside the platform ?

yaguzmang commented 2 months ago

We need to talk on how to fix this . Maybe some big machine with cloud computing , but must be done outside the platform ?

Would revising the way we calculate these areas be an option? From the documentation, if we adjust scales we could improve the speed: image

"This silly example is just for demonstration. The purpose of this error is to ask you whether you really want to reduce 80300348117 (that's 80 billion) pixels."

Noting that changing the scale would affect accuracy.

pengchenglai commented 1 month ago

@yaguzmang

Possible to try removing the validation of waiting time? Maybe it can help, like below:

var area1 = ee.Number(calculateArea(agreement6to9)).format('%,.2f').evaluate(function (result) { print('Agreement 6+ layers', result + ' ha')});

minotogna commented 1 month ago

@yaguzmang @pengchenglai can I close this issue ?

yaguzmang commented 1 month ago

@pengchenglai Unfortunately you last suggestion wouldn't fix the issue for big countries. The only options I see would be to have a cloud computing machine as Mino suggested, or reduce the accuracy significantly.

pengchenglai commented 1 month ago

@yaguzmang I see the situation: if using cloud computing is not feasible, then we could consider reducing the resolution to the extent that a medium-sized country(in terms of land area), such as the DRC, could be computed to get a rough estimate.