docstr: Splits a geometry by another geometry and returns a collection of geometries. This function is the theoretical
  opposite of the union of the split geometry parts. If the splitter does not split the geometry, a collection
  with a single geometry equal to the input geometry is returned.
  The function supports:
    - Splitting a (Multi)LineString by a (Multi)Point or (Multi)LineString or (Multi)Polygon
    - Splitting a (Multi)Polygon by a LineString
  
  It may be convenient to snap the splitter with low tolerance to the geometry. For example in the case
  of splitting a line by a point, the point must be exactly on the line, for the line to be correctly split.
  When splitting a line by a polygon, the boundary of the polygon is used for the operation.
  When splitting a line by another line, a ValueError is raised if the two overlap at some segment.
  
  Parameters
  ----------
  geom : geometry
      The geometry to be split
  splitter : geometry
      The geometry that will split the input geom
  
  Example
  -------
  >>> pt = Point((1, 1))
  >>> line = LineString([(0,0), (2,2)])
  >>> result = split(line, pt)
  >>> result.wkt
  'GEOMETRYCOLLECTION (LINESTRING (0 0, 1 1), LINESTRING (1 1, 2 2))'
docstr_tok: ["Splits","a","geometry","by","another","geometry","and","returns","a","collection","of","geometries",".","This","function","is","the","theoretical","opposite","of","the","union","of","the","split","geometry","parts",".","If","the","splitter","does","not","split","the","geometry",",","a","collection","with","a","single","geometry","equal","to","the","input","geometry","is","returned",".","The","function","supports",":","-","Splitting","a","(","Multi",")","LineString","by","a","(","Multi",")","Point","or","(","Multi",")","LineString","or","(","Multi",")","Polygon","-","Splitting","a","(","Multi",")","Polygon","by","a","LineString","It","may","be","convenient","to","snap","the","splitter","with","low","tolerance","to","the","geometry",".","For","example","in","the","case","of","splitting","a","line","by","a","point",",","the","point","must","be","exactly","on","the","line",",","for","the","line","to","be","correctly","split",".","When","splitting","a","line","by","a","polygon",",","the","boundary","of","the","polygon","is","used","for","the","operation",".","When","splitting","a","line","by","another","line",",","a","ValueError","is","raised","if","the","two","overlap","at","some","segment",".","Parameters","--","--","--","--","--","geom",":","geometry","The","geometry","to","be","split","splitter",":","geometry","The","geometry","that","will","split","the","input","geom","Example","--","--","--","-",">",">",">","pt","=","Point","(","(","1",",","1",")",")",">",">",">","line","=","LineString","(","[","(","0,0",")",",","(","2,2",")","]",")",">",">",">","result","=","split","(","line",",","pt",")",">",">",">","result.wkt","'GEOMETRYCOLLECTION","(","LINESTRING","(","0","0",",","1","1",")",",","LINESTRING","(","1","1",",","2","2",")",")","'"]
code: def split(geom, splitter):
      """
      Splits a geometry by another geometry and returns a collection of geometries. This function is the theoretical
      opposite of the union of the split geometry parts. If the splitter does not split the geometry, a collection
      with a single geometry equal to the input geometry is returned.
      The function supports:
        - Splitting a (Multi)LineString by a (Multi)Point or (Multi)LineString or (Multi)Polygon
        - Splitting a (Multi)Polygon by a LineString
  
      It may be convenient to snap the splitter with low tolerance to the geometry. For example in the case
      of splitting a line by a point, the point must be exactly on the line, for the line to be correctly split.
      When splitting a line by a polygon, the boundary of the polygon is used for the operation.
      When splitting a line by another line, a ValueError is raised if the two overlap at some segment.
  
      Parameters
      ----------
      geom : geometry
          The geometry to be split
      splitter : geometry
          The geometry that will split the input geom
  
      Example
      -------
      >>> pt = Point((1, 1))
      >>> line = LineString([(0,0), (2,2)])
      >>> result = split(line, pt)
      >>> result.wkt
      'GEOMETRYCOLLECTION (LINESTRING (0 0, 1 1), LINESTRING (1 1, 2 2))'
      """
  
      if geom.geom_type in ("MultiLineString", "MultiPolygon"):
          return GeometryCollection(
              [
                  i
                  for part in geom.geoms
                  for i in SplitOp.split(part, splitter).geoms
              ]
          )
  
      elif geom.geom_type == "LineString":
          if splitter.geom_type in (
              "LineString",
              "MultiLineString",
              "Polygon",
              "MultiPolygon",
          ):
              split_func = SplitOp._split_line_with_line
          elif splitter.geom_type == "Point":
              split_func = SplitOp._split_line_with_point
          elif splitter.geom_type == "MultiPoint":
              split_func = SplitOp._split_line_with_multipoint
          else:
              raise GeometryTypeError(
                  f"Splitting a LineString with a {splitter.geom_type} is not supported"
              )
  
      elif geom.geom_type == "Polygon":
          if splitter.geom_type == "LineString":
              split_func = SplitOp._split_polygon_with_line
          else:
              raise GeometryTypeError(
                  f"Splitting a Polygon with a {splitter.geom_type} is not supported"
              )
  
      else:
          raise GeometryTypeError(
              f"Splitting {geom.geom_type} geometry is not supported"
          )
  
      return GeometryCollection(split_func(geom, splitter))
  
imports: from warnings import warn
  import shapely
  from shapely.algorithms.polylabel import polylabel
  from shapely.errors import GeometryTypeError, ShapelyDeprecationWarning
  from shapely.geometry import GeometryCollection, LineString, MultiLineString, MultiPoint, Point, Polygon, shape
  from shapely.geometry.base import BaseGeometry, BaseMultipartGeometry
  from shapely.geometry.polygon import orient
  from shapely.prepared import prep
label_desc: Use image node_id 5 for calling the SplitOp obj's underlying member method code with example usage: obj.split(geom, splitter) and returns: GeometryCollection, GeometryCollection