CesiumGS / CesiumGS/cesium-native
Access violation when re-adding or sharing `GeoJsonDocumentRasterOverlay` across multiple tilesets
- Dominant language
- C++
- Stars
- 623
- Forks
- 277
- PR merge metrics
- No merged PRs in 30d
Description
# Access violation when re-adding or sharing GeoJsonDocumentRasterOverlay
## Description
A crash (Access Violation) occurs when attempting to re-add a `GeoJsonDocumentRasterOverlay` to a tileset after it has been removed, or when trying to add the same overlay instance to multiple tilesets simultaneously.
## Environment
- **OS:** Windows
- **Compiler:** MSVC (Visual Studio 2026)
## Context & Discussion
This issue has been discussed in the Cesium community forum:
[Can a GeoJsonDocumentRasterOverlay be re-added after removal?](https://community.cesium.com/t/can-a-geojsondocumentrasteroverlay-be-re-added-after-removal/45999/)
## Steps to Reproduce
### Scenario A: Re-adding after removal
1. Create a `GeoJsonDocumentRasterOverlay`.
2. Add it to a `Cesium3DTileset`.
3. Remove it from the tileset.
4. Attempt to add the same instance back to the tileset.
5. **Result:** Access Violation / Crash.
### Scenario B: Sharing across multiple tilesets
1. Create a single `GeoJsonDocumentRasterOverlay` instance.
2. Add it to `Tileset A`.
3. Attempt to add the same instance to `Tileset B`.
4. **Result:** Access Violation / Crash.
## Expected Behavior
The overlay should be reusable after removal or, if sharing is not supported, it should fail gracefully (e.g., via an error message or documentation) rather than causing a memory access violation.
## Additional Information
I would be glad to help by providing more information or creating a PR to solve this issue.
Contributor guide
Research direction
Start by reproducing both scenarios described in the issue, then trace the GeoJsonDocumentRasterOverlay add and removal lifecycle in Cesium3DTileset. Done means re-adding after removal no longer crashes, and sharing across tilesets either works safely or fails gracefully with a clear error or documented limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100