簡體   English   中英

R 中的多邊形邊界插值

[英]Polygon boundary interpolation in R

我有一個多邊形 dataframe: 在此處輸入圖像描述

使用頂點坐標:

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 中是否有任何方法可以插入空間對象以使邊界更平滑?

您可以使用平滑器 package來平滑 sf object。 我根據您的數據創建了一個示例,其中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)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM