Teradata Package for Python Function Reference on VantageCloud Lake | 17.20 - clip - 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.clip = clip(self, start_timestamp, end_timestamp)
DESCRIPTION:
    Returns a GeoSequence type containing the subset of points and
    associated data that lie between the two timestamp input arguments.
 
PARAMETERS:
    start_timestamp:
        Required Argument.
        Specifies a TIMESTAMP value as the beginning timestamp.
        Types: str
 
    end_timestamp:
        Required Argument.
        Specifies a TIMESTAMP value as the ending timestamp.
        Types: str
 
SUPPORTED GEOMETRY TYPES:
    GeoSequence
 
RAISES:
    TypeError, ValueError, TeradataMlException
 
RETURNS:
    GeoDataFrameColumn
 
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)
    
    # Let's select only skey and geosequence columns from GeoDataFrame, as clip() function works
    # with only ST_Geosequence geometry type.
    geoseq = geodf.select(["skey", "geosequence"])
 
    # Example 1: clip the geometries of type ST_Geosequence in column 'geosequence', within the
    #            timestamp "TIMESTAMP '2007-03-14 01:35:00'" and "TIMESTAMP '2007-03-14 01:35:08'".
    geo_clip = geoseq.geosequence.clip(start_timestamp="TIMESTAMP '2007-03-14 01:35:00'",
    end_timestamp="TIMESTAMP '2007-03-14 01:35:08'")
    geoseq.assign(res = geo_clip)