CesiumGS / CesiumGS/cesium-native
Improve accuracy of `withinPolygons` test
- Dominant language
- C++
- Stars
- 623
- Forks
- 277
- PR merge metrics
- No merged PRs in 30d
Description
`RasterizedPolygonsOverlay` and `RasterizedPolygonsTileExluder` both use a simple test to exclude tiles that fall entirely inside a polygon that is meant to be used for clipping:
1. Determine a `GlobeRectangle` representing the bounds of the Tile.
2. Check if the `GlobeRectangle` lies entirely inside the polygon.
But step 1 is not very accurate when the Tile's bounding volume is not a region. Just like in #383, the rectangle is determined by projecting edges of the Tile's bounding volume. This is inaccurate in that it may indicate too big a region, and also it's possible for parts of the tile to extend outside the computed region (especially for big tiles).
Unlike #383, though, there are no easy and performant solutions (to my knowledge). The solution will probably involve computing some kind of Cartesian-space bounding volume for the polygon that we can test other Cartesian-space bounding volumes against. That's already tricky because the polygon is 2D and meant to apply to geometry at any height.
Contributor guide
Assessment
This issue has not been assessed yet.