Point | Geospatial Types | Teradata Package for Python - Point - Teradata Package for Python

Teradata® Package for Python User Guide

Product
Teradata Package for Python
Release Number
17.10
Published
May 2022
Language
English (United States)
Last Update
2022-08-18
dita:mapPath
rsu1641592952675.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
B700-4006
lifecycle
previous
Product Category
Teradata Vantage

This function enables end user to create an object for the single Point using the coordinates. It allows user to use the same in GeoDataFrame manipulation and processing using any Geospatial function.

Optional argument:

coordinates: Specifies the coordinates of a point. Coordinates must be specified in positional fashion.
  • If coordinates are not passed, an object for empty point is created.
  • When coordinates are passed, you must pass one of the following:
    • Two values to define a point in 2-dimensions;
    • Three values to define a point in 3-dimensions.

Example 1: Create a Point in 2D, using x and y coordinates

>>> from teradataml import Point
>>> p1 = Point(0, 20)
>>> # Print the coordinates.
>>> print(p1.coords)
(0, 20)
>>> # Print the geometry type.
>>> p1.geom_type
'Point'

Example 2: Create a Point in 3D, using x, y and z coordinates

>>> from teradataml import Point
>>> p2 = Point(0, 20, 30)
>>> # Print the coordinates.
>>> print(p2.coords)
(0, 20, 30)

Example 3: Create an empty Point

>>> from teradataml import Point
>>> pe = Point()
>>> # Print the coordinates.
>>> print(pe.coords)
EMPTY