You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documentation example code invalid for latest library version #628
Confirmed against current master (677c8cebcff11ba11accc0b02005bc214e06e9fd): the published example still fails because GetContainingShapes() yields const S2Shape*, and S2Shape no longer has id().
The existing VisitContainingShapeIds() API supplies the IDs directly, so the inner loop can preserve the original polygon lookup:
query.VisitContainingShapeIds(point, [&](int shape_id) {
S2Polygon* polygon = polygons[shape_id];
// Use point and polygon here.returntrue;
});
Returning true keeps visiting matches. This lookup assumes the fresh index is populated in the same order as polygons, as in the example.
I checked the original and corrected snippets with C++20, Apple Clang 21, and the repository-required Abseil LTS 20260526.0. The original reproduces both errors; the corrected version passes -fsyntax-only. Existing Abseil deprecation warnings remain; this was a compile check, not a runtime or full-library test.
Where is the website's developer-guide source maintained so this correction can be submitted in the right place?
Activity
rksharma-owg commentedon Oct 14, 2026
Confirmed against current master (
677c8cebcff11ba11accc0b02005bc214e06e9fd): the published example still fails becauseGetContainingShapes()yieldsconst S2Shape*, andS2Shapeno longer hasid().The existing
VisitContainingShapeIds()API supplies the IDs directly, so the inner loop can preserve the original polygon lookup:Returning
truekeeps visiting matches. This lookup assumes the fresh index is populated in the same order aspolygons, as in the example.I checked the original and corrected snippets with C++20, Apple Clang 21, and the repository-required Abseil LTS 20260526.0. The original reproduces both errors; the corrected version passes
-fsyntax-only. Existing Abseil deprecation warnings remain; this was a compile check, not a runtime or full-library test.Where is the website's developer-guide source maintained so this correction can be submitted in the right place?