Teradata Package for Python Function Reference | 20.00 - end_point - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.
Teradata® Package for Python Function Reference - 20.00
- Deployment
- VantageCloud
- VantageCore
- Edition
- Enterprise
- IntelliFlex
- VMware
- Product
- Teradata Package for Python
- Release Number
- 20.00.00.03
- Published
- December 2024
- ft:locale
- en-US
- ft:lastEdition
- 2024-12-19
- dita:id
- TeradataPython_FxRef_Enterprise_2000
- lifecycle
- latest
- Product Category
- Teradata Vantage
- teradataml.geospatial.geodataframecolumn.GeoDataFrameColumn.end_point = end_point(self)
- DESCRIPTION:
Returns the end point of an ST_LineString or GeoSequence value.
Note:
* This method returns a point having a Z coordinate if the input
geometry is three-dimensional.
PARAMETERS:
None
SUPPORTED GEOMETRY TYPES:
ST_LineString and GeoSequence
RAISES:
TypeError, ValueError, TeradataMlException
RETURNS:
GeoDataFrameColumn
Resultant column contains a NULL, if the Geometry is an empty set.
EXAMPLES:
from teradataml import GeoDataFrame, load_example_data
from teradataml import Point, LineString, Polygon, GeometryCollection
# Load example data.
load_example_data("geodataframe", "sample_shapes")
# Create a GeoDataFrame.
geodf = GeoDataFrame("sample_shapes")
print(geodf)
# Example 1: Get the end points of (ST_Linestring) geometries in column
# 'linestrings'.
# Process the GeoDataFrameColumn to select only two columns, skey and linestrings and filter the
# rows where geometry type is ST_Linestring.
lines = geodf.select(["skey", "linestrings"])[geodf.linestrings.geom_type == "ST_Linestring"]
ep_expr = lines.geometry.end_point()
lines.assign(res = ep_expr)
# Example 2: Filter the rows where the end points of (ST_Linestring) geometries in column
# 'linestrings' is same as the specified Point GeometryType object.
# Create an object of Point GeometryType.
p1 = Point(0, 1)
# Execute the 'end_point()' on GeoDataFrameColumn pointed by geometry property and pass
# the Point object created above to the slice filter.
lines[lines.geometry.end_point() == p1]