Skip to main content

Point

This class represents a geometric point and provides functionality for managing 2D or 3D coordinates. It supports initialization from individual parameters or sequences and allows for the retrieval and modification of X, Y, and Z components through properties and tuple interfaces. The class integrates with GEOS geometry engines to handle spatial data and coordinate reference systems.

Attributes

AttributeTypeDescription
has_csbool = TrueIndicates that this geometry class supports coordinate sequences for internal data management.
coordsproperty = tupleAlias for the tuple property used to set or retrieve the point's coordinates.

Constructor

Signature

def Point(
x: float, int, list, tuple, or None = None,
y: float, int, or None = None,
z: float, int, or None = None,
srid: int or None = None
) - > null

Parameters

NameTypeDescription
xfloat, int, list, tuple, or None = NoneThe x-coordinate, or a sequence containing all coordinates.
yfloat, int, or None = NoneThe y-coordinate, used if x is a scalar.
zfloat, int, or None = NoneThe optional z-coordinate, used if x and y are scalars.
sridint or None = NoneThe Spatial Reference Identifier for the point.

Signature

def Point(
x: float|int|tuple|list = null,
y: float|int = null,
z: float|int = null,
srid: int = null
)

Parameters

NameTypeDescription
x`floatint
y`floatint` = null
z`floatint` = null
sridint = nullThe Spatial Reference System Identifier to associate with this geometry.

Methods


x()

@classmethod
def x() - > float

Return the X component of the Point.

Returns

TypeDescription
floatThe X coordinate value.

x()

@classmethod
def x(
value: float
) - > null

Set the X component of the Point.

Parameters

NameTypeDescription
valuefloatThe new value for the X coordinate.

Returns

TypeDescription
nullnull

y()

@classmethod
def y() - > float

Return the Y component of the Point.

Returns

TypeDescription
floatThe Y coordinate value.

y()

@classmethod
def y(
value: float
) - > null

Set the Y component of the Point.

Parameters

NameTypeDescription
valuefloatThe new value for the Y coordinate.

Returns

TypeDescription
nullnull

z()

@classmethod
def z() - > float|null

Return the Z component of the Point.

Returns

TypeDescription
`floatnull`

z()

@classmethod
def z(
value: float
) - > null

Set the Z component of the Point.

Parameters

NameTypeDescription
valuefloatThe new value for the Z coordinate.

Returns

TypeDescription
nullnull

tuple()

@classmethod
def tuple() - > tuple

Return a tuple of the point.

Returns

TypeDescription
tupleA tuple containing the X, Y, and optionally Z coordinates.

tuple()

@classmethod
def tuple(
tup: tuple
) - > null

Set the coordinates of the point with the given tuple.

Parameters

NameTypeDescription
tuptupleA tuple containing the new coordinate values.

Returns

TypeDescription
nullnull