Skip to content

Commit

Permalink
Addressing comments from pull request, basic clean-up, added info abo…
Browse files Browse the repository at this point in the history
…ut UTM reprojections
  • Loading branch information
cjthomas730 committed Nov 6, 2023
1 parent bb33c6d commit 82be448
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cerulean_cloud/cloud_run_orchestrator/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ async def _orchestrate(
print(f"Offset 2 offset_group_bounds: {offset_2_group_bounds}")

print(
f"Original tiles are {len(base_tiles)}, {len(offset_group_bounds)}, {len(offset_2_group_bounds)}"
f"Original tiles are {len(base_tiles)}, {len(offset_tiles_bounds)}, {len(offset_2_tiles_bounds)}"
)

# Filter out land tiles
Expand Down Expand Up @@ -425,7 +425,7 @@ async def _orchestrate(

offset_2_tiles_inference = await perform_inference(
offset_2_tiles_bounds,
cloud_run_inference.get_offset_tile_inference, # THIS FUNCTION NEEDS TO BE EDITTED
cloud_run_inference.get_offset_tile_inference,
20,
"offset2 tiles",
)
Expand Down Expand Up @@ -551,7 +551,7 @@ async def _orchestrate(
async with db_client.session.begin():
orchestrator_run.success = True
orchestrator_run.inference_end_time = end_time
# XXXC >> reduce num variables to a list of featureCollection, ala the merging approach

orchestrator_result = OrchestratorResult(
classification_base=out_fc,
classification_offset=out_fc_offset,
Expand Down
4 changes: 3 additions & 1 deletion cerulean_cloud/cloud_run_orchestrator/merging.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ def merge_inferences(
Parameters:
- feature_collections: A list of FeatureCollecitons to be merged, a primary and any secondary FeatureCollections
- isolated_conf_multiplier: A multiplier for the confidence of isolated features (default is 1 / len(feature_collections)).
- proximity_meters: The distance to check for neighboring features and expand the geometries (default is 500m).
- closing_meters: The distance to apply the morphological 'closing' operation (default is 0m).
- opening_meters: The distance to apply the morphological 'opening' operation (default is 0m).
Returns:
A merged geojson FeatureCollection.
"""
# We reproject to UTM for processing. This assumes that all offset images will either be in the same UTM zone as
# the input image chip, or that the difference that arise from an offset crossing into a second UTM zone will
# have little or no impact on comparison to the origina image.
gdfs_for_processing = [
reproject_to_utm(
gpd.GeoDataFrame.from_features(fc["features"], crs=4326).assign(fc_index=i)
Expand Down

0 comments on commit 82be448

Please sign in to comment.