Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/instancemaker/mergeinstances.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,19 @@ def process_tile_at(self, target_tile):
logging.warning(f"No polygons found for tile {target_tile}")
return False



# Combine all polygons
logging.debug("Combining polygons from adjacent tiles")
all_combine = pd.concat(retrieved_polygons,
ignore_index=True).unary_union
polygons = list(all_combine.geoms)
logging.debug(f"Combined into {len(polygons)} polygons")
all_combine = pd.concat(
retrieved_polygons,
ignore_index=True
).geometry.union_all()

if all_combine.geom_type == "Polygon":
polygons = [all_combine]
else:
polygons = list(all_combine.geoms)


# Assign polygons to tiles
tile_polygons = {tile['tilename']: [] for tile in adjacent_tiles}
Expand Down