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.
Did you read the Contributor Guide?
Is this PR related to a JIRA ticket?
[SEDONA-XXX] my subject
.What changes were proposed in this PR?
PySpark binding's RDD API now works with Shapely 2.0. This patch mainly involves adapting
Envelopes
andCircle
to Shapely 2.0, which enforces geometry objects to be immutable, and thus not friendly for inheriting.I've gone through several threads for migrating classes inheriting
shapely.geometry.BaseGeometry
objects from Shapely 1.8 to Shapely 2.0 (shapely/shapely#1313 and shapely/shapely#1698 (comment)), and finally decided to inherit from BaseGeometry while removing all custom fields. This is because all custom fields ofEnvelope
andCircle
could be derived from the base geometry, so we can implement custom fields as properties to keep backward compatibility, while not breaking the class hierarchy. Users can still call BaseGeometry methods onEnvelope
andCircle
objects when working with Shapely 2.0. There are some rounding errors when computing thecenterGeometry
andradius
properties ofCircle
objects. To my understanding, this won't be a big problem.How was this patch tested?
Updated GitHub workflow for Python to run with both Shapely 1.x and Shapely 2.x.
Did this PR include necessary documentation updates?