Several bugs are related to terrain subdivision and raster tiles fetching - for instance #2159 ; #2214 and the following behaviour that can sometimes happen (unfortunately I can't share the terrain source for this one for now):
The terrain subdivision code (mostly in TiledGeometryLayer) has become quite complex, is hard to understand (see discussions in #2159 and #2344 for instance) and is buggy (see aforementioned issues).
Proposed Solution
I think we need to:
Refactor and simplify this part of the code that has a high cognitive complexity
Extract and document the algorithms that control tile subdivision and raster tiles fetching
That should eventually facilitate related bug fixing
I've started to work on a refactoring and simplification on this branch
Context
Several bugs are related to terrain subdivision and raster tiles fetching - for instance #2159 ; #2214 and the following behaviour that can sometimes happen (unfortunately I can't share the terrain source for this one for now):
https://github.com/user-attachments/assets/625c57ff-cb5c-4288-847f-800961df8221
The terrain subdivision code (mostly in TiledGeometryLayer) has become quite complex, is hard to understand (see discussions in #2159 and #2344 for instance) and is buggy (see aforementioned issues).
Proposed Solution
I think we need to:
I've started to work on a refactoring and simplification on this branch