Teradata Package for Python Function Reference on VantageCloud Lake | 17.20 - set_link - 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.geodataframe.GeoDataFrame.set_link = set_link(self, index, link_id)
DESCRIPTION:
    Set the link ID of a specified point in a GeoSequence.
 
PARAMETERS:
    index:
        Required Argument.
        Specifies the index of the point in the GeoSequence, where the index of the
        first point is 1.
        Types: int, str, ColumnExpression
 
    link_id:
        Required Argument.
        Specifies the new link ID of the specified point in the GeoSequence. The data type
        of linkID is DECIMAL(18,0).
        Types: float
 
SUPPORTED GEOMETRY TYPES:
    GeoSequence
 
RAISES:
    TypeError, ValueError, TeradataMlException
 
RETURNS:
    GeoDataFrame
 
EXAMPLES:
    from teradataml import GeoDataFrame, load_example_data
    from teradataml import Point, LineString, Polygon
    # Load example data.
    load_example_data("geodataframe", "sample_shapes")
    # Create a GeoDataFrame.
    geodf = GeoDataFrame("sample_shapes")
    print(geodf)
    
    # Example 1: Set the link ID for the point at the 1st index in geometries in column 'geosequence'.
    # Let's select only few columns from GeoDataFrame.
    geoseq = geodf.select(["skey", "geosequence"])[geodf.skey.isin([1001, 1002])]
    geoseq.set_link(index=1, link_id=20.2)