Skip to content

Commit

Permalink
Should have listened to Christian
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaraphael committed Oct 30, 2023
1 parent 8dcf82a commit 75b36bb
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions cerulean_cloud/cloud_run_orchestrator/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,14 +477,16 @@ async def _orchestrate(
async with db_client.session.begin():
LAND_MASK_BUFFER_M = 1000
for feat in merged_inferences.get("features"):
slick_gdf = (
gpd.GeoDataFrame(
geometry=[shape(feat["geometry"])], crs="EPSG:4326"
)
.to_crs("EPSG:3857")
.buffer(LAND_MASK_BUFFER_M)
buffered_gdf = gpd.GeoDataFrame(
geometry=[shape(feat["geometry"])], crs="EPSG:4326"
)
if get_landmask_gdf().intersects(slick_gdf).any():
buffered_gdf["geometry"] = buffered_gdf.to_crs(
"EPSG:3857"
).buffer(LAND_MASK_BUFFER_M)
intersecting_land = gpd.sjoin(
landmask_gdf, buffered_gdf, how="inner", op="intersects"
)
if not intersecting_land.empty:
feat["properties"]["inf_idx"] = 0
slick = await db_client.add_slick(
orchestrator_run,
Expand Down

0 comments on commit 75b36bb

Please sign in to comment.