Skip to content

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

Description

@airbreather

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions