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-207] Fix ambiguity of empty multi-geometries and multi geometries containing only empty geometries #766

Merged
merged 1 commit into from
Feb 14, 2023

Conversation

Kontinuation
Copy link
Member

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

What changes were proposed in this PR?

This pull request fixes the handling of empty multi-geometries in the geometry serializer. In the current implementation, we omitted structure data for multi-geometries containing only empty geometries, such as MULTILINESTRING (EMPTY, EMPTY). In this case, we cannot tell if it is an empty multi-geometry or multi-geometry containing only empty geometries. This patch fixes the problem by always writing structure data for multi geometries.

This patch also fixes other issues with the geometry serializer:

  • Python geometry serializer will drop M coordinates when deserializing XYM/XYZM geometries, instead of raising an exception.
  • Avoid allocating a huge amounts of memory when deserializing malformed data.

How was this patch tested?

Unit tests were added to test this patch.

Did this PR include necessary documentation updates?

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

…ng only empty geometries;

Reject large integer values read from geometry buffer, which prevents from OOM when reading malformed data;
Fixed interoperability bugs in Python serde; drop M dimension when deserializing XYM or XYZM geometries instead of raising an exception.
@jiayuasu jiayuasu added this to the sedona-1.4.0 milestone Feb 14, 2023
@jiayuasu jiayuasu merged commit ff56182 into apache:master Feb 14, 2023
zongsizhang pushed a commit that referenced this pull request Feb 19, 2023
@Kontinuation Kontinuation deleted the fix-serde-for-multi-geoms branch August 23, 2023 15:02
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.

None yet

2 participants