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
| Attribute | Type | Description |
|---|---|---|
| has_cs | bool = True | Indicates that this geometry class supports coordinate sequences for internal data management. |
| coords | property = tuple | Alias 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
| Name | Type | Description |
|---|---|---|
| x | float, int, list, tuple, or None = None | The x-coordinate, or a sequence containing all coordinates. |
| y | float, int, or None = None | The y-coordinate, used if x is a scalar. |
| z | float, int, or None = None | The optional z-coordinate, used if x and y are scalars. |
| srid | int or None = None | The 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
| Name | Type | Description |
|---|---|---|
| x | `float | int |
| y | `float | int` = null |
| z | `float | int` = null |
| srid | int = null | The Spatial Reference System Identifier to associate with this geometry. |
Methods
x()
@classmethod
def x() - > float
Return the X component of the Point.
Returns
| Type | Description |
|---|---|
float | The X coordinate value. |
x()
@classmethod
def x(
value: float
) - > null
Set the X component of the Point.
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The new value for the X coordinate. |
Returns
| Type | Description |
|---|---|
null | null |
y()
@classmethod
def y() - > float
Return the Y component of the Point.
Returns
| Type | Description |
|---|---|
float | The Y coordinate value. |
y()
@classmethod
def y(
value: float
) - > null
Set the Y component of the Point.
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The new value for the Y coordinate. |
Returns
| Type | Description |
|---|---|
null | null |
z()
@classmethod
def z() - > float|null
Return the Z component of the Point.
Returns
| Type | Description |
|---|---|
| `float | null` |
z()
@classmethod
def z(
value: float
) - > null
Set the Z component of the Point.
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The new value for the Z coordinate. |
Returns
| Type | Description |
|---|---|
null | null |
tuple()
@classmethod
def tuple() - > tuple
Return a tuple of the point.
Returns
| Type | Description |
|---|---|
tuple | A 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
| Name | Type | Description |
|---|---|---|
| tup | tuple | A tuple containing the new coordinate values. |
Returns
| Type | Description |
|---|---|
null | null |