code: def to_wkt(
      geometry,
      rounding_precision=6,
      trim=True,
      output_dimension=3,
      old_3d=False,
      **kwargs,
  ):
      """
      Converts to the Well-Known Text (WKT) representation of a Geometry.
  
      The Well-known Text format is defined in the `OGC Simple Features
      Specification for SQL <https://www.opengeospatial.org/standards/sfs>`__.
  
      The following limitations apply to WKT serialization:
  
      - for GEOS <= 3.8 a multipoint with an empty sub-geometry will raise an exception
      - for GEOS <= 3.8 empty geometries are always serialized to 2D
      - for GEOS >= 3.9 only simple empty geometries can be 3D, collections are still
        always 2D
  
      Parameters
      ----------
      geometry : Geometry or array_like
      rounding_precision : int, default 6
          The rounding precision when writing the WKT string. Set to a value of
          -1 to indicate the full precision.
      trim : bool, default True
          If True, trim unnecessary decimals (trailing zeros).
      output_dimension : int, default 3
          The output dimension for the WKT string. Supported values are 2 and 3.
          Specifying 3 means that up to 3 dimensions will be written but 2D
          geometries will still be represented as 2D in the WKT string.
      old_3d : bool, default False
          Enable old style 3D/4D WKT generation. By default, new style 3D/4D WKT
          (ie. "POINT Z (10 20 30)") is returned, but with ``old_3d=True``
          the WKT will be formatted in the style "POINT (10 20 30)".
      **kwargs
          See :ref:`NumPy ufunc docs <ufuncs.kwargs>` for other keyword arguments.
  
      Examples
      --------
      >>> from shapely import Point
      >>> to_wkt(Point(0, 0))
      'POINT (0 0)'
      >>> to_wkt(Point(0, 0), rounding_precision=3, trim=False)
      'POINT (0.000 0.000)'
      >>> to_wkt(Point(0, 0), rounding_precision=-1, trim=False)
      'POINT (0.0000000000000000 0.0000000000000000)'
      >>> to_wkt(Point(1, 2, 3), trim=True)
      'POINT Z (1 2 3)'
      >>> to_wkt(Point(1, 2, 3), trim=True, output_dimension=2)
      'POINT (1 2)'
      >>> to_wkt(Point(1, 2, 3), trim=True, old_3d=True)
      'POINT (1 2 3)'
  
      Notes
      -----
      The defaults differ from the default of the GEOS library. To mimic this,
      use::
  
          to_wkt(geometry, rounding_precision=-1, trim=False, output_dimension=2)
  
      """
      if not np.isscalar(rounding_precision):
          raise TypeError(
              "rounding_precision only accepts scalar values"
          )
      if not np.isscalar(trim):
          raise TypeError("trim only accepts scalar values")
      if not np.isscalar(output_dimension):
          raise TypeError("output_dimension only accepts scalar values")
      if not np.isscalar(old_3d):
          raise TypeError("old_3d only accepts scalar values")
  
      return lib.to_wkt(
          geometry,
          np.intc(rounding_precision),
          np.bool_(trim),
          np.intc(output_dimension),
          np.bool_(old_3d),
          **kwargs,
      )
  
file_path: shapely/shapely/io.py
imports: import numpy
  from shapely import lib
  from shapely._enum import ParamEnum
  from shapely._ragged_array import from_ragged_array, to_ragged_array
  from shapely.decorators import requires_geos
  from shapely.errors import UnsupportedGEOSVersionError
label_desc: Use image node_id 1 for calling a global function with example usage: to_wkt(geometry, rounding_precision, trim, output_dimension, old_3d) and returns: lib