Teradata Package for Python Function Reference | 17.10 - MultiPolygon - 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.geometry_types.MultiPolygon = class MultiPolygon(GeometryType)
    teradataml.geospatial.geometry_types.MultiPolygon(polygons=None)
 
Class MultiPolygon enables end user to create an object holding multiple
Polygon geometry objects. Allows user to use the same in GeoDataFrame
manipulation and processing.
 
 
Method resolution order:
MultiPolygon
GeometryType
builtins.object

Methods defined here:
__init__(self, polygons=None)
DESCRIPTION:
    Enables end user to create an object holding the multiple Polygon
    geometry objects. Allows user to use the same in GeoDataFrame
    manipulation and processing using any Geospatial function.
 
PARAMETERS:
    polygons:
        Optional Argument.
        Specifies the list of polygons. If no polygons are passed, an
        object for empty MultiPolygon is created.
        Types: List of Polygon objects
 
RETURNS:
    MultiPolygon
 
RAISES:
    TeradataMlException, TypeError, ValueError
 
EXAMPLES:
    >>> from teradataml import Polygon, MultiPolygon
 
    # Example 1: Create a MultiPolygon in 2D, using x and y coordinates.
    >>> po1 = Polygon([(0, 0), (0, 20), (20, 20), (20, 0), (0, 0)])
    >>> po2 = Polygon([(0.6, 0.8), (0.6, 20.8), (20.6, 20.8), (20.6, 0.8), (0.6, 0.8)])
    >>> go1 = MultiPolygon([po1, po2])
    >>> # Print the coordinates.
    >>> print(go1.coords)
    [[(0, 0), (0, 20), (20, 20), (20, 0), (0, 0)], [(0.6, 0.8), (0.6, 20.8), (20.6, 20.8), (20.6, 0.8), (0.6, 0.8)]]
    >>> # Print the geometry type.
    >>> print(go1.geom_type)
    MultiPolygon
    >>>
 
    # Example 2: Create an empty MultiPolygon.
    >>> poe = MultiPolygon()
    >>> # Print the coordinates.
    >>> print(poe.coords)
    EMPTY
    >>>

Methods inherited from GeometryType:
__getattr__(self, item)
__str__(self)
Return String Representation for a Geometry object.

Readonly properties inherited from GeometryType:
coords
Returns the coordinates of the Geometry object.
geom_type
Returns the type of a Geometry.