每个多边形覆盖的单元格面积

huangapple go评论62阅读模式
英文:

Area of each cell covered by polygons

问题

有没有一种方法/函数可以计算由多边形覆盖的每个栅格单元的比例?这些多边形通常比单个单元格大,我正在处理的景观相当大。我希望能够在不将栅格转换为单元格多边形和执行st_union/st_join的情况下完成这个任务,但我不确定是否可能。

我希望的输出是一个栅格,其中的单元格值显示每个单元格被多边形图层覆盖的比例。

英文:

Is there a way/function to calculate the proportion of each raster cell covered by a polygon? The polygons are usually larger than single cells and the landscape I'm working on is pretty big. I'll like to do it without converting the raster into cell-polygons and st_union/st_join, but I'm not sure if it's possible.

The output I'm looking for is a raster with cell values showing the proportion of each cell covered by the polygons layer.

答案1

得分: 1

谢谢评论。
最后,应用于多边形图层的terra::rasterize()函数,使用cover = T参数,正好符合我的要求...而且速度超快。

我能够将所有操作保持在“栅格方面”,避免了将栅格模板矢量化并进行相交/空间连接的更强烈处理。

英文:

Thanks for the comments.
At the end the terra::rasterize() function with the cover = T parameter applied on the polygons layer does exactly what I was looking for... and it's super fast.

I was able to keep it all on the "raster side" and avoid the more intense processing of vectorizing the raster template and doing intersects/spatial joins.

huangapple
  • 本文由 发表于 2023年6月1日 23:40:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76383596.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定