Teradata Package for Python Function Reference on VantageCloud Lake | 17.20 - geom_component - 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.geom_component = geom_component(self, position)
DESCRIPTION:
    Returns the geometry of one component member of a composite geometry
    type (ST_GeomCollection, ST_MultiPoint, ST_MultiLineString, or
    ST_MultiPolygon). The element to be returned is specified by position
    with the collection.
 
PARAMETERS:
    position:
        Required Argument.
        Specifies a value representing the position in the collection of the
        geometry to be returned. The position of the first element in the
        collection is number 1.
        Types: int, str, ColumnExpression
 
SUPPORTED GEOMETRY TYPES:
    ST_GeomCollection, ST_MultiPoint, ST_MultiLineString, and ST_MultiPolygon
 
RAISES:
    TypeError, ValueError, TeradataMlException
 
RETURNS:
    GeoDataFrame with result column containing Geometry values
 
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: Get the geometry component at position 1 in ST_GeometryCollection, a composite geometry type,
    #            geometries in column 'geom_collections'.
    geom_collections = geodf.select(["skey", "geom_collections"])
    geom_collections.geom_component(position=1)