[ ] Download tract shapefiles for 2014 (can just use that year)- https://www2.census.gov/geo/tiger/TIGER2014/TRACT/Notes: write code to scrape the links and save the zip file in "raw"-- has two-digit state codes; can mass unzip using command line
al_shapes = gpd.read_file(PATH_TO_INT_OUTPUTS + "tl_2016_01_tract")
ky_shapes = gpd.read_file(PATH_TO_INT_OUTPUTS + "tl_2016_21_tract")
la_shapes = gpd.read_file(PATH_TO_INT_OUTPUTS + "tl_2016_22_tract")
ms_shapes = gpd.read_file(PATH_TO_INT_OUTPUTS + "tl_2016_28_tract")
tn_shapes = gpd.read_file(PATH_TO_INT_OUTPUTS + "tl_2016_47_tract")
tx_shapes = gpd.read_file(PATH_TO_INT_OUTPUTS + "tl_2016_48_tract")
shapefile_crs = tx_shapes.crs
## intersections while setting the CRS/projection of the
## points to match the shapefiles CRS; could be made more efficient
## by storing the points and shapes in a length-2 list and then
## putting that list in a dict with state as key
al_join = sjoin(AL_points.set_crs(shapefile_crs), al_shapes, how="right", op = "intersects")
ky_join = sjoin(KY_points.set_crs(shapefile_crs), ky_shapes, how="right", op = "intersects")
ms_join = sjoin(MS_points.set_crs(shapefile_crs), ms_shapes, how="right", op = "intersects")
la_join = sjoin(LA_points.set_crs(shapefile_crs), la_shapes, how="right", op = "intersects")
tx_join = sjoin(TX_points.set_crs(shapefile_crs), tx_shapes, how="right", op = "intersects")
tn_join = sjoin(TN_points.set_crs(shapefile_crs), tn_shapes, how="right", op = "intersects")
[ ] Download tract shapefiles for 2014 (can just use that year)- https://www2.census.gov/geo/tiger/TIGER2014/TRACT/ Notes: write code to scrape the links and save the zip file in "raw"-- has two-digit state codes; can mass unzip using command line
[ ] Load and use
sjoin
for spatial intersection with the lat/longs- can adapt this code from here (https://github.com/rebeccajohnson88/qss20_s21_proj/blob/main/code/qss20_groupcode/geocoding_acs/01_geocode_mergewithACS_plot_studentversion.ipynb) and might need to use crosswalk to connect two-digit state code with state names (eunice i think has code related to that)