Created
March 28, 2024 21:41
-
-
Save fhk/57ff696d2f36f2245df361aece9b493d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Some quick snippets for points to lines | |
address_df = pd.DataFrame([[0, Point([c for c in h3.cell_to_latlng(h3_8)[::-1]])]], columns=['id', 'geometry']) | |
address_gdf = gpd.GeoDataFrame(address_df, geometry="geometry", crs="epsg:4326") | |
gdf = gpd.read_file( | |
"./data/all_the_data.fgb", | |
engine="pyogrio", bbox=location_box) | |
gdf = gdf.to_crs('epsg:3310') # https://epsg.io/3310 | |
print(gdf.sindex) | |
sjoin = gpd.sjoin_nearest(left_df=address_gdf, right_df=gdf, how="left", max_distance=10000) | |
sjoin = sjoin.dropna() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment