0

我有一个多边形数据框: 在此处输入图像描述

使用顶点坐标:

43740.95    40726.46
43741.36    40720.19
43742.67    40729.28
43743.99    40716.16
43745.52    40730.97
43748.72    40714.19
43748.72    40731.14
43748.72    40714.19
43752.23    40714.76
43752.86    40729.43
43755.27    40716.68
43756.77    40723.24
43757.19    40719.73

R中是否有任何方法可以插入空间对象以使边界更平滑?

4

1 回答 1

3

您可以使用smoothr包来平滑 sf 对象。我根据您的数据创建了一个示例data,您提供的样本在哪里。因为你的多边形是不规则的形状,所以平滑看起来也很不规则。您可以根据需要调整平滑或更改平滑算法。但是,样条曲线可能适用于您的情况。

library(sf)
library(smoothr)

smooth_poly <- data %>% 
  st_as_sf(coords=c("x", "y")) %>% 
  st_union() %>% 
  st_convex_hull() %>% 
  smooth(method='spline', n=1000)

于 2020-06-06T05:57:55.747 回答