首页 > 其他分享 >Google Earth Engine (GEE) ——矢量转栅格初学者最易犯的错误

Google Earth Engine (GEE) ——矢量转栅格初学者最易犯的错误

时间:2023-04-16 10:00:56浏览次数:32  
标签:Engine 矢量 reducer feature 栅格 易犯 error properties


我们都知道有时候我们需要对矢量和栅格进行转化,这样做的目的就是为了方便我们影像统一操作或者其它处理。这里我们会用到GEE中的一个矢量转换栅格的函数,通过这个函数我们可以快速的将矢量转化未栅格,但是这里需要注意的是我们需要查看我们的矢量集合是否会有很多细节,也就是节点比较多,如果太多的话转换过程会很困难,有时候会出现超限的情况,这里建议在转换前大区域复杂的矢量集合需要进行simply进行简化,这样就可以了/、

reduceToImage(properties, reducer)

Creates an image from a feature collection by applying a reducer over the selected properties of all the features that intersect each pixel.

通过对与每个像素相交的所有特征的选定属性应用缩减器,从特征集合创建图像。

Arguments:

this:collection (FeatureCollection):

Feature collection to intersect with each output pixel.

properties (List):

Properties to select from each feature and pass into the reducer.

reducer (Reducer):

A Reducer to combine the properties of each intersecting feature into a final result to store in the pixel.

Returns: Image

 

simplify(maxError, proj)

Simplifies the geometry of a feature to within a given error margin. Note that this does not respect the error margin requested by the consumer of this algorithm, unless maxError is explicitly specified to be null.

This overrides the default Earth Engine policy for propagating error margins, so regardless of the geometry accuracy requested from the output, the inputs will be requested with the error margin specified in the arguments to this algorithm. This results in consistent rendering at all zoom levels of a rendered vector map, but at lower zoom levels (i.e. zoomed out), the geometry won't be simplified, which may harm performance.

将特征的几何简化到给定的误差范围内。 请注意,这不考虑该算法的使用者请求的误差幅度,除非 maxError 明确指定为 null。

这会覆盖用于传播误差范围的默认 Earth Engine 策略,因此无论从输出请求的几何精度如何,都将使用此算法的参数中指定的误差范围来请求输入。 这会导致在渲染矢量图的所有缩放级别上呈现一致的渲染,但在较低的缩放级别(即缩小)下,几何图形不会被简化,这可能会损害性能。

 

Arguments:

this:feature (Element):

The feature whose geometry is being simplified.

maxError (ErrorMargin):

The maximum amount of error by which the result may differ from the input.

proj (Projection, default: null):

If specified, the result will be in this projection. Otherwise it will be in the same projection as the input. If the error margin is in projected units, the margin will be interpreted as units of this projection

Returns: Feature

原始代码:

var feat_col = ee.FeatureCollection('users/spotter/fire_cnn/buffered_polys/2015')

print(feat_col.first())
Map.addLayer(feat_col, {}, 'Features ')

var img  =  feat_col.reduceToImage({
    properties: ['Year'],
    reducer: ee.Reducer.mean()
    })
    
print(img)

Map.addLayer(img, {}, 'Image')

错误代码:

var img  =  feat_col.reduceToImage({
    properties: ["Date",'Day',"ID","Month",'Year',"count","label"],
    reducer: ee.Reducer.mean()
    })
    
print(img)

Google Earth Engine (GEE) ——矢量转栅格初学者最易犯的错误_栅格

 另外一个错误就是不能进行多个属性赋值转化,只能选择单个属性进行转化

Google Earth Engine (GEE) ——矢量转栅格初学者最易犯的错误_开发语言_02

另外如果遇到转化影像的过程出现了只能转化其中一个的时候,我们需要在本地将矢量集合进行合并,然后再上传,这样就可以进行完整的矢量转栅格了。 

标签:Engine,矢量,reducer,feature,栅格,易犯,error,properties
From: https://blog.51cto.com/u_15654855/6193334

相关文章

  • ELEC3115 ENGINEERING
    ELEC3115–ELECTROMAGNETICENGINEERINGPartBassignment–T12023DueDate:23:59pm,Monday24thApril2020(Week11)AssignmentssubmittedaftertheDueDatewillbepenalizedbya20%marksreduction.CutoffDate:23:59pm,Tuesday25thApril2020(Week11)......
  • MegEngine 使用小技巧:使用 Optimizer 优化参数
    神经网络的学习的目的是找到使损失函数的值尽可能小的参数。这是寻找最优参数的问题,解决这个问题的过程称为优化(optimization)。而由于参数空间复杂、参数数量庞大等原因,使得神经网络的优化问题非常难。MegEngine的optimizer模块中实现了大量的优化算法,其中Optimizer是所有优......
  • MegEngine 使用小技巧:使用 Optimizer 优化参数
    神经网络的学习的目的是找到使损失函数的值尽可能小的参数。这是寻找最优参数的问题,解决这个问题的过程称为优化(optimization)。而由于参数空间复杂、参数数量庞大等原因,使得神经网络的优化问题非常难。MegEngine的optimizer模块中实现了大量的优化算法,其中Optimizer是所有......
  • Cadence应用笔记:调整栅格
    说明栅格是在设计中非常常用的工具,修改栅格大小和显示可以通过如下操作:空白处右键选择设置Grid设置层叠各层的栅格大小或者全局大小通过该按键可以隐藏或者显示栅格......
  • Cesium中显示栅格数据查询结果
    Cesium通过wms或者wmts服务加载发布的矢量数据,点选数据时会有一个属性框,如图:而对于栅格数据则不会出现这个框,为了解决这个问题,需要创建一个空的Entity,当点击时就会出现这个框了。像这样: 实现方法参考了geoserver里面基于openlayer的图层预览:url=url+......
  • 记首次用Cheat Engine修改游戏内存
    记得第一次见到ce修改器还是因为听闻ce修改器可以修改百度网盘下载速度,但是测试了一下发现确实可行(虽然不知道现在修复了没)。最近想起来得好好研究它的功能。最后我发现了了一片讲的很细的CE修改器教程入门篇,作者用ce自带的一个练习程序详细的讲解了几种修改方式。学习之后为了实......
  • UnrealEngine - 网络同步入门
    1网络同步机制UE提供了强大的网络同步机制:RPC:可以在本地调用,对端执行属性同步:标记一个属性为UPROPERTY(Replicated)就可以自动将其修改后的值同步到客户端移动复制:Actor开启了移动复制后会自动复制位置,旋转和速度创建和销毁:Server创建Actor时根据其权限会在所有连......
  • AI Prompt Engineering 提示工程:提升你的创意与效率
    参考引言AI工具种类也开始进入大繁荣时代。根据There'sanAIForThat网站显示,自2002年-至今,AI社区已经构建了超过2400个AI工具,覆盖577种用途类别(当然,还有很多未收录的AI工具)。虽然AI工具已经有了,但如何用好这些工具却是另外一回事。本文将向您推荐一种名为AIProm......
  • tengine安装及配置
    1.下载http://tengine.taobao.org/download_cn.html2.上传linux目录并解压[root@zk1tengine]#tar-zxvftengine-2.3.3.tar.gz3.cd到解压目录并配置安装[root@zk1tengine]#cdtengine-2.3.3[[email protected]]#lsAUTHORS.teCHANGESCHANGES.tecon......
  • SuperSocket 服务端 和 SuperSocket.ClientEngine 客户端及普通客户端
    internalclassProgram{//staticvoidMain(string[]args)//{//byte[]arr=newbyte[1024];//1.创建socket对象//Socketsocket=newSocket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolTyp......