Teradata Package for Python Function Reference on VantageCloud Lake | 17.20 - 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 on VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Package for Python
Release Number
17.20
Publication Date
November 2022
Content Type
Programming Reference
Publication ID
B700-4500-112K
ft:locale
en-US
ft:lastEdition
2024-02-21
ft:sourceId
FTML
dita:id
TeradataPython_FxRef_Lake_1720
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]