在r中计数相同值的像素
我需要在R中计算相同值的像素的帮助。我正在做一个主论文,其中一部分是在洪水之前和之后计算一个区域的NDWI,因此我可以计算出水下的表面。从高于0之后的洪水值之后的NDWI的结果中,在水下,低于0的结果不在。因此,我有点卡在这里BCS,我不知道如何计算高于值0的所有像素。
I need help with counting pixels of the same value in R. I'm doing a master thesis and part of it is calculating the NDWI of an area before and after floods so I can calculate the surface under water. From the results of NDWI after the flood values that are above 0 are under water and those under 0 are not. So I'm kinda stuck here bcs I can't figure out how to calculate all pixels above value 0.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用您的Dropbox数据:
表方法来自 sof-gis?s ,让您开始。
Using your dropbox data:
Table approach is from SOF-GIS ?s, and get you started.
您的数据
可以用大于零(或不)的值计数单元格:
true == 1
,因此您拥有21,157个单元格,值大于零。但是要准确地计算这些单元格所覆盖的区域,您需要首先获取每个单元的区域:
然后
在这种情况下总和这些区域,这类似于(错误)假设 naminal naminal 空间分辨率对每个网格单元都是有效的。
Your data
You could count the cells with values that are larger than zero (or not) like this:
TRUE == 1
, so you have 21,157 cells with a value larger than zero.But to accurately compute the area covered by these cells, you need to first get the area of each cell:
And then sum these areas
In this case, that is similar to (incorrectly) assuming that the nominal spatial resolution is valid for each grid cell.