【发布时间】:2018-11-21 13:36:06
【问题描述】:
您好,我希望使用 httr 包将来自英国国家统计局 API 的 geojson FeatureCollection 带入 data.frame。
library(httr)
HealthGeog <- GET("https://opendata.arcgis.com/datasets/f0095af162f749ad8231e6226e1b7e30_0.geojson")
并获得成功的响应:
> HealthGeog
Response [https://opendata.arcgis.com/datasets/f0095af162f749ad8231e6226e1b7e30_0.geojson]
Date: 2018-11-21 13:28
Status: 200
Content-Type: application/json; charset=utf-8
Size: 9.59 MB
但是刚接触 JSON,不知道如何导航到 FeatureCollection 中的列表并将其加载到 data.frame 中?
【问题讨论】:
-
sf <- geojsonsf::geojson_sf( 'https://opendata.arcgis.com/datasets/f0095af162f749ad8231e6226e1b7e30_0.geojson' )也会直接将geojson文件读入sf对象