【问题标题】:Extract coordinates of raster cells that overlap with multilinestring提取与多线串重叠的栅格单元的坐标
【发布时间】:2021-09-09 13:31:39
【问题描述】:

我正在使用 R,并且我有一个栅格 (population),其中包含每个单元格上的人口密度数据和一个代表国际边界的多线串 (border_365_366)。我想提取与国际边界重叠的栅格单元的坐标。 有谁知道如何提取这个?我认为这里的主要问题之一是我正在使用多字符串而不是带有坐标的 data.frame。

> class(border_365_366)
[1] "sf"         "data.frame"

> class(population)
[1] "RasterLayer"
attr(,"package")

[1] "raster"
> border_365_366
Simple feature collection with 1 feature and 0 fields
geometry type:  MULTILINESTRING
dimension:      XY
bbox:           xmin: 27.32998 ymin: 57.52933 xmax: 28.21014 ymax: 59.46253
geographic CRS: WGS 84
                        geometry
1 MULTILINESTRING ((27.66656 ...

> population
class      : RasterLayer 
dimensions : 21600, 34926, 754401600  (nrow, ncol, ncell)
resolution : 0.01030751, 0.01046373  (x, y)
extent     : -180, 180, -120.053, 105.9636  (xmin, xmax, ymin, ymax)
crs        : +proj=longlat +datum=WGS84 +no_defs 
names      : pop_new 
values     : 0, 107475  (min, max)

【问题讨论】:

    标签: coordinates extract raster multilinestring


    【解决方案1】:

    我可以通过将线转换为线串来解决这个问题

    border_365_366<- st_cast(border_365_366,'LINESTRING')

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-06-29
      • 2019-12-04
      • 2022-06-15
      • 2021-09-16
      • 1970-01-01
      • 2019-09-16
      • 1970-01-01
      相关资源
      最近更新 更多