[GH-2028] Implementations of GeographyCollection & ShapeIndexGeography on S2Geography Apache Sedona#2027
Merged
Merged
Conversation
- Import org.datasyslab s2-geometry-library - Clean up S2Geography abstract design - Update Encode/Decode inside each kind of geography
- Adding back EncodeTagged in S2Geography - Let each geography type calls its own encode / decode function - Change to use Kyro UnsafeInput and UnsafeOutput
Member
|
@ZhuochengShang please resolve the conflicts |
Kontinuation
reviewed
Jul 3, 2025
Kontinuation
reviewed
Jul 8, 2025
Kontinuation
approved these changes
Jul 9, 2025
Member
Kontinuation
left a comment
There was a problem hiding this comment.
It looks good to me. Can you update the description of this PR and remove unnecessary contents came from the PR template?
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for serializing collections of geographies and indexed geometries using S2ShapeIndex, along with tests to verify round-trip encoding/decoding.
- Introduce GeographyCollection for wrapping multiple S2Geography with full encode/decode support
- Implement ShapeIndexGeography and EncodedShapeIndexGeography classes to build and serialize shape indexes
- Update S2Geography.decode to route new GEOGRAPHY_COLLECTION and SHAPE_INDEX kinds properly
- Add GeographyIndex utility for mapping shapes to user values
- Provide unit tests covering collection behavior and shape-index serialization
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| common/src/test/java/org/apache/sedona/common/S2Geography/ShapeIndexGeographyTest.java | New tests for encode/decode round trip of shape-index geography |
| common/src/test/java/org/apache/sedona/common/S2Geography/GeographyCollectionTest.java | New tests for empty, mixed, and round-trip behaviors of GeographyCollection |
| common/src/main/java/org/apache/sedona/common/S2Geography/ShapeIndexGeography.java | Adds ShapeIndexGeography implementation and encode logic, stub decode |
| common/src/main/java/org/apache/sedona/common/S2Geography/EncodedShapeIndexGeography.java | Implements decode for encoded shape-index geography |
| common/src/main/java/org/apache/sedona/common/S2Geography/GeographyCollection.java | Implements GeographyCollection wrapping, encode/decode, and shape dispatch |
| common/src/main/java/org/apache/sedona/common/S2Geography/S2Geography.java | Updates static decode switch to handle GEOGRAPHY_COLLECTION and SHAPE_INDEX cases |
| common/src/main/java/org/apache/sedona/common/S2Geography/GeographyIndex.java | Introduces GeographyIndex for associating shapes with integer values |
| common/src/main/java/org/apache/sedona/common/S2Geography/PolygonGeography.java | Removes redundant commented line in encode override |
Member
|
@ZhuochengShang Please check if the copilot comments make sense or not |
jiayuasu
approved these changes
Jul 9, 2025
Kontinuation
pushed a commit
to Kontinuation/sedona
that referenced
this pull request
Jan 21, 2026
…ography on S2Geography (apache#2027) * Create object of S2Geography, and implement PoinGeography with its encoder/decoder * Add POLYLINE implementation on S2Geography * Add POLYGON implements on S2Geography * Match coding style * "Apply Spotless formatting to PolylineGeographyTest" * Redesign of S2Geography - Import org.datasyslab s2-geometry-library - Clean up S2Geography abstract design - Update Encode/Decode inside each kind of geography * clean up unnecessary files in current branch * Refine design of EncodeTagged in S2Geography - Adding back EncodeTagged in S2Geography - Let each geography type calls its own encode / decode function - Change to use Kyro UnsafeInput and UnsafeOutput * Modify encoder() and add new test cases * clean up code of encode and clarify comments * Update POLYGON to only take one polygon * Remove S2Regionwrapper & S2Shapewrapper * clean up minor issue * GeographyCollection and ShapeIndexGeography implementation * comcomment geography kind in S2Geography * format violation * Adjust Shapeindexgeography encode/decode and shapeID * Clean up format * change addIndex return type to void * minor changes for GeographyCollection encode * clear format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?