0

我在哪里可以在 R 的 shapefile 中找到 EU NUTS 代码?

NUTS = 统计地域单位命名法

每个 NUTS 地区都有一个 NUTS 代码:

德国的示例图片.

您还可以在此 Excel 文件中找到详细的 NUTS 代码。

当我下载 NUTS shapefile 时,我找不到这个 NUTS 代码。

我从以下位置下载了 shapefile NUTS_2013_20M_SH.zip

ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units/nuts#nuts13

下载后,我使用以下代码将 shapefile 上传到 R 中:

library(sp)
library(rgdal)

dir <- setwd(getwd())

NUTS_shape = readOGR(dsn = (dsn = "~/NUTS_2013_20M_SH/data", layer = "NUTS_BN_20M_2013")

笔记:

  • dsn =是保存 shapefile 的文件夹的路径。
  • layer =是不带文件扩展名的文件名(例如,.shp)

如果我使用summary(NUTS_shape),我只找到一个“NUTS_BN_ID”但没有 NUTS 代码。此外,如果我使用str(NUTS_shape[4461,])查看示例项目 4461 的列表结构,似乎没有 NUTS 代码。

有谁知道 NUTS shapefile 是否包含 NUTS 代码,或者 NUTS_BN_ID 是否以某种方式链接到此代码?

4

1 回答 1

3

我找到了答案:

如果有人也在使用 NUTS 数据,那么您会发现 NUTS 代码不在“NUTS_BN_20M_2013”​​层中,但您必须使用另一层,即:“NUTS_RG_20M_2013”​​。

因此,使用代码:

NUTS_shape = readOGR(dsn = (dsn = "~/NUTS_2013_20M_SH/data", layer = "NUTS_RG_20M_2013")

然后,如果你写NUTS_shape@data,你会得到:

  NUTS_ID STAT_LEVL_  SHAPE_AREA SHAPE_LEN
0      AT          0 10.04269653 22.922441
1     AT1          1  2.84477225 10.876468
2    AT11          2  0.47903755  5.591853
3   AT111          3  0.08480488  1.178272
4   AT112          3  0.21836213  2.649698
5   AT113          3  0.17587054  2.276286

NUTS_ID 等于代码。

于 2016-09-06T16:50:28.800 回答