【问题标题】:r - Grid Coordinates in library(sp) makegrid functionr - library(sp) makegrid 函数中的网格坐标
【发布时间】:2019-08-01 21:01:36
【问题描述】:

我正在哈里斯县(德克萨斯州休斯顿)上创建一个栅格,例如:How to create a grid of spatial points。 我的代码:

library(sp)
library(rgdal)
library(raster)

us <- getData('GADM', country = 'US', level = 2)
us$NAME_2
harris = us[us$NAME_1 == "Texas" & (us$NAME_2 == "Harris"),]

该示例表明像元大小为 0.01(以地图为单位)。

grid <- makegrid(harris, cellsize = 0.01) # cellsize in map units!
grid <- SpatialPoints(grid, proj4string = CRS(proj4string(harris)))

但是当我单独执行“网格”时:

grid

它给出“空间点”x1 和 x2:

SpatialPoints:
        x1    x2
[1,] -95.96 29.50
[2,] -95.95 29.50
[3,] -95.94 29.50
[4,] -95.93 29.50
[5,] -95.92 29.50
[6,] -95.91 29.50
[7,] -95.90 29.50
[8,] -95.89 29.50
...
...
...

问题:这些是网格点的经度和纬度吗?

【问题讨论】:

    标签: r raster sp rgdal


    【解决方案1】:

    是的,因为

    > proj4string(harris)
    [1] "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多