Skip to content

Commit

Permalink
Update 3dtiles converter remove flagged duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
robyngit committed Nov 1, 2022
1 parent 08e173f commit 0beb3b1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pdg_workflow/StagedTo3DConverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def staged_to_3dtile(self, path):
logger.warning(
f'Vector tile {path} is empty. 3D tile will not be'
' created.')
return
return None, None

# Remove polygons with centroids that are outside the tile boundary
prop_cent_in_tile = self.config.polygon_prop(
Expand All @@ -105,16 +105,16 @@ def staged_to_3dtile(self, path):

# Deduplicate if required
if dedup_here and (dedup_method is not None):
dedup_config = self.config.get_deduplication_config(gdf)
dedup = dedup_method(gdf, **dedup_config)
gdf = dedup['keep']
prop_duplicated = self.config.polygon_prop('duplicated')
if prop_duplicated in gdf.columns:
gdf = gdf[~gdf[prop_duplicated]]

# The tile could theoretically be empty after deduplication
if len(gdf) == 0:
logger.warning(
f'Vector tile {path} is empty after deduplication.'
' 3D Tile will not be created.')
return
return None, None

# Create & save the b3dm file
ces_tile, ces_tileset = TreeGenerator.leaf_tile_from_gdf(
Expand All @@ -132,6 +132,7 @@ def staged_to_3dtile(self, path):
except Exception as e:
logger.error(f'Error creating 3D Tile from {path}.')
logger.error(e)
return None, None

def parent_3dtiles_from_children(self, tiles, bv_limit=None):
"""
Expand Down

0 comments on commit 0beb3b1

Please sign in to comment.