Skip to main content

LineString

This class represents a linear geometry composed of a sequence of points. It supports initialization from various data structures including lists, tuples, NumPy arrays, or Point objects, requiring a minimum of two coordinates. The class provides sequence-like interfaces to access and iterate over coordinates, with support for both 2D and 3D spatial data.

Attributes

AttributeTypeDescription
has_csboolean = trueA boolean flag indicating that this geometry class utilizes a coordinate sequence for internal storage.
coordstupleReturn a tuple version of the geometry from the coordinate sequence.

Constructor

Signature

def LineString(
*args: Any,
**kwargs: Any
) - > null

Parameters

NameTypeDescription
*argsAnyA variable number of arguments which can be a single sequence of coordinates or multiple individual coordinate arguments.
**kwargsAnyKeyword arguments, specifically supporting 'srid' to define the Spatial Reference Identifier.

Signature

def LineString(
*args: Any,
**kwargs: Any
)

Parameters

NameTypeDescription
*argsAnyA sequence of coordinates or Point objects used to define the LineString path.
**kwargsAnyKeyword arguments, such as 'srid' to define the spatial reference system identifier.

Methods


tuple()

@classmethod
def tuple() - > tuple

Return a tuple version of the geometry from the coordinate sequence.

Returns

TypeDescription
tupleA nested tuple containing all coordinates of the LineString.

array()

@classmethod
def array() - > numpy.ndarray

Return a numpy array for the LineString.

Returns

TypeDescription
numpy.ndarrayA NumPy array representation of all coordinates in the LineString.

x()

@classmethod
def x() - > list | numpy.ndarray

Return a list or numpy array of the X variable.

Returns

TypeDescription
`listnumpy.ndarray`

y()

@classmethod
def y() - > list | numpy.ndarray

Return a list or numpy array of the Y variable.

Returns

TypeDescription
`listnumpy.ndarray`

z()

@classmethod
def z() - > list | numpy.ndarray | None

Return a list or numpy array of the Z variable.

Returns

TypeDescription
`listnumpy.ndarray