【发布时间】:2020-06-18 17:03:44
【问题描述】:
我想从我的数据中的地址获取城市的人口普查代码。问题是我找不到佛罗里达州盖恩斯维尔的可用 shapefile。所以我试图使用参加调查的人的地址来获取人口普查代码,一旦我有了人口普查代码,我会 substr 到前 11 位数字以匹配 tidycensus 包的 GEOID,它给出县人口普查和 shapefile 到最低层次。
因为我只有城市居民的 GEOID,所以我会得到那些 shapefile,而不是整个县。所以我做了以下只是为了获得人口普查代码:
library(tigris)
library(readr)
gainsville_df2 <- readr::read_csv("311_Service_Requests__myGNV_.csv")
#gainsville_df2 is the dataframe of the csv file
jio<- apply(gainsville_df2["Address"], 1, function(row) tigris::call_geolocator(row, "Gainesville", "FL", zip = NA))
#It ran for ~1.5 hours, parsing through 1892 addresses, then I got this error out of nowhere:
#Error in tigris::call_geolocator(row, "Gainesville", "FL", zip = NA) :
# Internal Server Error (HTTP 500).
#Called from: httr::stop_for_status(r)
指向the data is here 的链接。我有 ~9200 个地址要解析,这发生在 ~1800 年。环顾四周,发现需要一些超时设置,不幸的是,我不知道该怎么做。
我需要 shapefile 来完成我个人项目的关键部分。
【问题讨论】:
标签: r geocoding census tigris tidycensus