shapely.get_type_id#

get_type_id(geometry, **kwargs)#

Returns the type ID of a geometry.

  • None (missing) is -1

  • POINT is 0

  • LINESTRING is 1

  • LINEARRING is 2

  • POLYGON is 3

  • MULTIPOINT is 4

  • MULTILINESTRING is 5

  • MULTIPOLYGON is 6

  • GEOMETRYCOLLECTION is 7

Parameters
geometryGeometry or array_like
**kwargs

For other keyword-only arguments, see the NumPy ufunc docs.

See also

GeometryType

Examples

>>> from shapely import LineString, Point
>>> get_type_id(LineString([(0, 0), (1, 1), (2, 2), (3, 3)]))
1
>>> get_type_id([Point(1, 2), Point(2, 3)]).tolist()
[0, 0]