census

Get Census Tract from Lat/Lon using tigris

半世苍凉 提交于 2021-01-29 07:26:08
问题 I have a relatively large number of coordinates for which I'd like to get the census tract (in addition to the FIPS code). I know that I can look up individual lat/lon pairs using call_geolocator_latlon (as done here), but this seems impractical for my purposes as the function issues a single call to the census bureaus' API, and I imagine would take a very long time to run on my ~200,000 pairs. Is there a faster way to do this, perhaps by downloading shapefiles for each state using the block

Using ggplot to create a choropleth from a SpatialPolygonsDataFrame

你。 提交于 2020-01-13 18:54:19
问题 I have a SpatialPolygonsDataFrame that comes from the UScensus2010 package. I am trying to create a choropleth. When I do so, this works as expected: data(colorado.county10) choropleth(colorado.county10, "P0010001", color = list(fun = "rainbow", attr = list(4)), main="2010 US Counties", type="plot", border="black") but this fails due to 'P0010001' not being found data(colorado.county10) ggplot(colorado.county10, aes(long, lat, group = group)) + geom_polygon(aes(fill = P0010001), colour =

Downloaded Census Data using R

自作多情 提交于 2020-01-06 19:36:13
问题 I am trying to download only the table shown on this link: http://factfinder.census.gov/faces/tableservices/jsf/pages/productview.xhtml?src=CF but have not had success with the following code: library(RCurl) step1 = "http://factfinder.census.gov/faces/tableservices/jsf/pages/productview.xhtml?src=CF" step2 = getURL(step1) step3 = read.txt(textConnection(step2), header = FALSE) Any thoughts would be greatly appreciated! 回答1: If I were you, I would immediately download acs a wonderful package

Census Geocoder JSON output convert to Xml dataset using JSON.net in C#

佐手、 提交于 2019-12-29 09:21:53
问题 I am creating a .Net app in Visual Studio 2012 that queries an address table in my SQL dB and uses the Census Geocoding API to return the specific MSA for each address. I have existing code for the dB query, but I am having trouble with converting the Json output of the Census API to an Xml dataset. I am using Json.net to serialize the json output and then deserialize to .net in order to load into an XmlDocument. Unfortunately, I keep getting an XmlException error: Data at the root level is

Testing the Census Batch Geocoding API with Postman and getting an Internal Error

僤鯓⒐⒋嵵緔 提交于 2019-12-24 21:05:56
问题 I am using Postman to test the Census Batch Geocode API and I am using the csv file that they give you to test it but whenever I try to submit the request I get an internal error. Here is the picture of what I have in postman Census Batch API Postman Can anyone tell me what I am missing or doing wrong here? Thank you! 来源: https://stackoverflow.com/questions/54404257/testing-the-census-batch-geocoding-api-with-postman-and-getting-an-internal-erro

How to combine state-level shapefiles from the united states census bureau into a nationwide shape

牧云@^-^@ 提交于 2019-12-21 01:06:32
问题 The census bureau doesn't provide a nationwide shapefile of public use microdata areas (the smallest geography available on the American Community Survey). I tried combining them all with a few different methods, but even the one that de-dupes identifiers breaks once it hits California. Am I doing something silly or does this require a difficult workaround? Here's code to reproduce up to the point where things break. library(taRifx.geo) library(maptools) td <- tempdir() ; tf <- tempfile()

r tidycensus download all block groups

家住魔仙堡 提交于 2019-12-13 12:11:22
问题 I am looking to automate the process of downloading Census data from all block groups from the US using the tidycensus package. There is instructions from the developer to download all tracts within the US, however, block groups cannot be accessed using the same method. Here is my current code that does not work library(tidyverse) library(tidycensus) census_api_key("key here") # create lists of state and county codes data("fips_codes") temp <- data.frame(state = as.character(fips_codes$state

Leaflet R performance issues with large map

拜拜、爱过 提交于 2019-12-12 12:06:57
问题 I'm wondering if anyone else has experienced similar issues when plotting a large number of markers and polygons using leaflet package in R. This is what it normally should look like: However, when I zoom in/out of the map, the polygons and markers are clearly out of place (or you can say the base map does not adjust properly). An example is included below: I would not have this issue when I plotted a smaller area or few markers. I'm wondering if there is a way to improve the performance.

Exporting data from UScensus2010

别等时光非礼了梦想. 提交于 2019-12-12 01:42:32
问题 I need to extract Census 2010 data for CDPs (nationwide) and figured it would be simplest to use the UScensus2010 package to extract the key tables I need, one state at a time, and then export the resulting data. Towards this end I ran the following code library(UScensus2010) install.cdp("osx") demographics(dem="P0030001", state="oh",level="cdp") p3.race <- demographics(dem=c("P0010001", "P0030001", "P0030002", "P0030003", "P0030004", "P0030005", "P0030006"), state="oh",level="cdp") Note that

How do I use R to download LEHD data from the website?

女生的网名这么多〃 提交于 2019-12-12 01:38:03
问题 I would like to know how to download LEHD files from their FTP site. https://lehd.ces.census.gov/data/lodes/LODES7/ I need to download the data for multiple years, for both workplace and resident place locations. The files are named regularly, and the technical documentation can be found here: https://lehd.ces.census.gov/data/lodes/LODES7/LODESTechDoc7.2.pdf S000 references all workforce segments JT00 references all job types So a typical file name is: ca_wac_S000_JT00_2008.csv.gz In the