developmentseed/geojson-pydantic

Support GeometryCollection as an input for geometry field

Closed this issue · 2 comments

According to spec a Geojson should be able to have a GeometryCollection as a geometry in a feature.

I propose changing this line:

Geom = TypeVar("Geom", bound=Optional[Geometry])

from

Geom = TypeVar("Geom", bound=Optional[Geometry])

to

Geom = TypeVar("Geom", bound=Optional[Union[Geometry, GeometryCollection]])

Is there a reason we don't currently support this change?

I've written some tests locally that work with this change. I'm happy to submit a PR

Is there a reason we don't currently support this change?

No reason, just haven't implemented full coverage of the spec yet. PRs are appreciated!

closed in #72