在Google Earth Engine中使用屏蔽功能

时间:2018-05-07 17:28:44

标签: javascript google-earth-engine

我有一篇论文,我正在写关于河流冰覆盖变化的文章,我决定使用谷歌地球引擎。

我已经有一个算法可以检查像素是否结冰。但问题是我必须将其掩盖,只能在河流上计算,而不是在其他地方计算。

我对JavaScript知之甚少,并查找了API以找到屏蔽的解决方案。我试图将示例合并到我的代码中,但它给了我一个错误" updatemask" 未在此范围内定义。

那我该如何定义这个面具呢?因为目前我只是创建一个包含河流区域的变量并将其分配给面具。

var datamask = ShapeFile;      // Uploaded.
var mask     = datamask.eq(1); // As I understand this is where you tell the mask which part to use.
var dif      = updatemask(datamask);

1 个答案:

答案 0 :(得分:0)

首先,该函数名为 select o.orderid, o.orderdate, o.shippingmethodid, p1.productcode as prod1code, p1.productname as prod1desc, p1.quantity as prod1qty, p1.productprice as prod1price, p2.productcode as prod2code, p2.productname as prod2desc, p2.quantity as prod2qty, p2.productprice as prod2price, p3.productcode as prod3code, p3.productname as prod3desc, p3.quantity as prod3qty, p3.productprice as prod3price from Orders o outer apply ( select * from ( select *, ROW_NUMBER() OVER (PARTITION BY od.orderid ORDER BY od.productname) as rn from OrderDetails od where o.orderid = od.orderid ) t where rn = 1 ) as p1 outer apply ( select * from ( select *, ROW_NUMBER() OVER (PARTITION BY od.orderid ORDER BY od.productname) as rn from OrderDetails od where o.orderid = od.orderid ) t where rn = 2 ) as p2 outer apply ( select * from ( select *, ROW_NUMBER() OVER (PARTITION BY od.orderid ORDER BY od.productname) as rn from OrderDetails od where o.orderid = od.orderid ) t where rn = 3 ) as p3 where o.orderstatus = 'Ready To Ship' 。其次,它是updateMask对象的实例方法,它返回另一个ee.Image对象。因此,您需要为特定图像设置遮罩。假设您可能有一个代表冰的图像,您可能会执行类似

的操作
ee.Image