Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SEDONA-503] Support Shapely 2.0 #1254

Merged
merged 1 commit into from
Feb 27, 2024
Merged

Conversation

Kontinuation
Copy link
Member

@Kontinuation Kontinuation commented Feb 26, 2024

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

What changes were proposed in this PR?

PySpark binding's RDD API now works with Shapely 2.0. This patch mainly involves adapting Envelopes and Circle 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 of Envelope and Circle 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 on Envelope and Circle objects when working with Shapely 2.0. There are some rounding errors when computing the centerGeometry and radius properties of Circle 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?

  • No, this PR does not affect any public API so no need to change the docs.

@jiayuasu jiayuasu added this to the sedona-1.6.0 milestone Feb 27, 2024
@jiayuasu jiayuasu merged commit 5885ef1 into apache:master Feb 27, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants