class_docstr: A geometry type composed of one or more line segments.
  
  A LineString is a one-dimensional feature and has a non-zero length but
  zero area. It may approximate a curve and need not be straight. Unlike a
  LinearRing, a LineString is not closed.
  
  Parameters
  ----------
  coordinates : sequence
      A sequence of (x, y, [,z]) numeric coordinate pairs or triples, or
      an array-like with shape (N, 2) or (N, 3).
      Also can be a sequence of Point objects.
  
  Examples
  --------
  Create a LineString with two segments
  
  >>> a = LineString([[0, 0], [1, 0], [1, 1]])
  >>> a.length
  2.0
code: def __new__(self, coordinates=None):
      if coordinates is None:
          # empty geometry
          # TODO better constructor
          return shapely.from_wkt("LINESTRING EMPTY")
      elif isinstance(coordinates, LineString):
          if type(coordinates) == LineString:
              # return original objects since geometries are immutable
              return coordinates
          else:
              # LinearRing
              # TODO convert LinearRing to LineString more directly
              coordinates = coordinates.coords
      else:
          if hasattr(coordinates, "__array__"):
              coordinates = np.asarray(coordinates)
          if isinstance(coordinates, np.ndarray) and np.issubdtype(
              coordinates.dtype, np.number
          ):
              pass
          else:
              # check coordinates on points
              def _coords(o):
                  if isinstance(o, Point):
                      return o.coords[0]
                  else:
                      return [float(c) for c in o]
  
              coordinates = [_coords(o) for o in coordinates]
  
      if len(coordinates) == 0:
          # empty geometry
          # TODO better constructor + should shapely.linestrings handle this?
          return shapely.from_wkt("LINESTRING EMPTY")
  
      geom = shapely.linestrings(coordinates)
      if not isinstance(geom, LineString):
          raise ValueError(
              "Invalid values passed to LineString constructor"
          )
      return geom
  
file_path: shapely/shapely/geometry/linestring.py
imports: import numpy
  import shapely
  from shapely.geometry.base import BaseGeometry, JOIN_STYLE
  from shapely.geometry.point import Point
label_desc: Use image node_id 1 for calling the LineString obj's underlying member method code with example usage: obj.__new__(coordinates) and returns: geom, shapely, shapely, coordinates, o, unknown