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

MultiPolygon "coordinates" member should support empty Polygon arrays inside of it. #145

Open
airbreather opened this issue May 1, 2024 · 0 comments
Assignees
Labels

Comments

@airbreather
Copy link
Member

This was first brought to my attention in #140, which identifies a specific subset ([[]]) supposedly produced by one specific tool (gdal-bin ogr2ogr) and resolves that to do the right thing.

While that PR is a good first step, we should fix the underlying issue more completely and generically, such that an empty Polygon array anywhere within the MultiPolygon's "coordinates" member will be handled properly. Examples for test cases:

  1. [[]] is a MultiPolygon that contains one empty Polygon in it (fixed by Deserialize MultiPolygon Array of Empty Coordinates Array #140)
  2. [[], []] is a MultiPolygon that contains nothing but two empty Polygons in it
  3. [[[[0, 0], [1, 0], [0, 1], [0, 0]]], []] is a MultiPolygon that contains one empty and one non-empty Polygon
  4. [[], [[[0, 0], [1, 0], [0, 1], [0, 0]]]] is equivalent to the previous row but in a different order (which matters for the spaghetti that implements this parsing logic)
  5. [[], [[[0, 0], [1, 0], [0, 1], [0, 0]]], []] is a combination of both of the previous rows
@airbreather airbreather added the bug label May 1, 2024
@airbreather airbreather self-assigned this May 1, 2024
airbreather pushed a commit that referenced this issue May 1, 2024
* Deserialize MultiPolygon Array of Empty Coordinates Array

* Change to MultiPolygon with empty Polygon

Part of #145
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant