Skip to content

Conversation

@otan
Copy link
Collaborator

@otan otan commented May 18, 2020

  • Add Empty() to the T interface, which is defined on all geom.T types.
  • Add interface assertions for all the types, makes unimplemented
    interface errors easier to read at compile time.
  • In PostGIS (at least), its possible for a GeometryCollection to have
    multiple Empty elements and still be considered empty, e.g.
    GEOMETRYCOLLECTION(POINT EMPTY, LINESTRING EMPTY). This check changes
    the Empty check such that GeometryCollection's Empty() also checks for
    these cases.

@twpayne
Copy link
Owner

twpayne commented May 18, 2020

Ah, this feels like the proper way to implement #155.

Copy link
Owner

@twpayne twpayne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just one minor nit about where to put the tests. Once those are addressed I'll merge it :)

* Add Empty() to the T interface, which is defined on all geom.T types.
* Add interface assertions for all the types, makes unimplemented
interface errors easier to read at compile time.
* In PostGIS (at least), its possible for a GeometryCollection to have
multiple Empty elements and still be considered empty, e.g.
`GEOMETRYCOLLECTION(POINT EMPTY, LINESTRING EMPTY)`. This check changes
the Empty check such that GeometryCollection's Empty() also checks for
these cases.
@otan otan changed the title expand handling of Empty for GeometryCollection add Empty to T interface and correct Empty for GeometryCollection May 18, 2020
@twpayne twpayne merged commit 078e8ab into twpayne:master May 18, 2020
@twpayne
Copy link
Owner

twpayne commented May 18, 2020

Thanks for this great contribution :) I've tagged v1.1.0 that includes this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants