Teradata Package for Python Function Reference | 17.10 - 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
- Product
- Teradata Package for Python
- Release Number
- 17.10
- Published
- April 2022
- Language
- English (United States)
- Last Update
- 2022-08-19
- lifecycle
- previous
- 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)