Skip to content

Implement tileHashes pattern in OctreeTiler to match QuadtreeTiler#249

Closed
Copilot wants to merge 4 commits intomd5_implementationfrom
copilot/sub-pr-244-another-one
Closed

Implement tileHashes pattern in OctreeTiler to match QuadtreeTiler#249
Copilot wants to merge 4 commits intomd5_implementationfrom
copilot/sub-pr-244-another-one

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

Implements the same tileHashes pattern used in QuadtreeTiler for OctreeTiler to accurately track and update tile bounding boxes based on actual geometry extents.

Changes

  • Added tileHashes HashSet in both CreateTileForLargestGeometries3D and CreateTile3D to track which geometries are placed in each specific tile
  • Implemented UpdateTileBoundingBox3D method that recalculates tile bounding boxes based on actual geometry extents using GeometryRepository.GetGeometriesBoundingBox
  • Updated tileBounds dictionary entries to reflect accurate 3D bounding boxes of the geometries in each tile
  • Added conditional guard to only call UpdateTileBoundingBox3D when !tilingSettings.UseImplicitTiling, matching the QuadtreeTiler optimization pattern
// Pattern implementation
var tileHashes = new HashSet<string>();

foreach (var geom in geometriesToProcess.Where(geom => !string.IsNullOrEmpty(geom.Hash))) {
    localProcessedGeometries.Add(geom.Hash);
    tileHashes.Add(geom.Hash);  // Track geometries in THIS tile
}

// After writing tile, update bounding box based on actual geometries (only when not using implicit tiling)
if (!tilingSettings.UseImplicitTiling) {
    UpdateTileBoundingBox3D(tile, tileBounds, tileHashes, where);
}

This is important for handling geometries where the centroid is in one tile but the geometry extends into neighboring areas. The accurate bounding boxes ensure correct rendering and spatial queries, matching the behavior already present in QuadtreeTiler. The conditional update avoids unnecessary database queries when implicit tiling is enabled.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: bertt <538812+bertt@users.noreply.github.com>
@bertt
Copy link
Member

bertt commented Feb 5, 2026

@copilot implement like the quadtreetiler does it

Copilot AI changed the title [WIP] Address feedback on size-based geometry prioritization Remove unused tileHashes variable from OctreeTiler Feb 5, 2026
Copilot AI requested a review from bertt February 5, 2026 11:10
Co-authored-by: bertt <538812+bertt@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 5, 2026

@copilot implement like the quadtreetiler does it

Implemented in commit d013a3f. The OctreeTiler now follows the same pattern as QuadtreeTiler:

  • tileHashes tracks geometries in each tile
  • UpdateTileBoundingBox3D recalculates bounding boxes based on actual geometries
  • Bounding boxes are updated in tileBounds dictionary (similar to how QuadtreeTiler updates tile.BoundingBox)

Copilot AI changed the title Remove unused tileHashes variable from OctreeTiler Implement tileHashes pattern in OctreeTiler to match QuadtreeTiler Feb 5, 2026
@bertt bertt marked this pull request as ready for review February 5, 2026 11:39
@bertt
Copy link
Member

bertt commented Feb 5, 2026

@copilot only call updateTileBox when not useImplicitTiling

Co-authored-by: bertt <538812+bertt@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 5, 2026

@copilot only call updateTileBox when not useImplicitTiling

Fixed in commit f3470e3. UpdateTileBoundingBox3D is now only called when !tilingSettings.UseImplicitTiling, matching the QuadtreeTiler pattern.

@bertt bertt closed this Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants