shapely.from_wkt

Contents

shapely.from_wkt#

from_wkt(geometry, on_invalid='raise', **kwargs)#

Creates geometries from the Well-Known Text (WKT) representation.

The Well-known Text format is defined in the OGC Simple Features Specification for SQL.

Parameters:
geometrystr or array_like

The WKT string(s) to convert.

on_invalid{“raise”, “warn”, “ignore”}, default “raise”
  • raise: an exception will be raised if WKT input geometries are invalid.

  • warn: a warning will be raised and invalid WKT geometries will be returned as None.

  • ignore: invalid WKT geometries will be returned as None without a warning.

**kwargs

See NumPy ufunc docs for other keyword arguments.

Examples

>>> from_wkt('POINT (0 0)')
<POINT (0 0)>