Skip to content

Shapely stubs for CoordinateSequence do not cover 2.5D case #13422

Closed
@kveretennicov

Description

@kveretennicov

Shapely allows coordinates, such as Point or LineString vertices, to be either 2-part (x, y) or 3-part (x, y, z).

Thus the following code is valid:

linestring = LineString([(1, 2, 3), (4, 5, 6)])
...
for x, y, z in linestring.coords:
  ...

Shapely stubs, however, only cover 2-part coordinates. So the code above does not type check and complains about trying to unpack a 2-tuple into 3 items. This makes the stubs unusable for projects that heavily rely on 3-part coordinates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions