rebeccajohnson88 / qss20_s21_proj

Repo for DOL Summer Data Challenge on equity in H-2A oversight
Creative Commons Zero v1.0 Universal
2 stars 2 forks source link

Geocoding next steps #15

Closed rebeccajohnson88 closed 3 years ago

rebeccajohnson88 commented 3 years ago
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")