Teradata Package for Python Function Reference | 20.00 - overlaps - 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 - 20.00

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00.00.03
Published
December 2024
ft:locale
en-US
ft:lastEdition
2024-12-19
dita:id
TeradataPython_FxRef_Enterprise_2000
Product Category
Teradata Vantage
teradataml.geospatial.geodataframe.GeoDataFrame.overlaps = overlaps(self, geom_column)
DESCRIPTION:
    Tests if a Geometry value spatially overlaps another Geometry value.
    Note:
        *  Using a geospatial index can greatly improve the performance of
          queries that use this method.
 
PARAMETERS:
    geom_column:
        Required Argument.
        Specifies the other Geometry value.
        Types: str, ColumnExpression, GeometryType
 
SUPPORTED GEOMETRY TYPES:
    Valid on all Geometry types, except geometry collections.
    Note:
        This method can be called on 3D geometries (those that include Z
        coordinates). However, the Z coordinate is ignored in method
        calculations.
 
RAISES:
    TypeError, ValueError, TeradataMlException
 
RETURNS:
    GeoDataFrame
    Resultant column contains:
        * 1, if the geometries overlap
        * 0, if the geometries do not overlap
 
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)
    
    # Let's select only few columns from GeoDataFrame.
    pols_lines = geodf.select(["skey", "polygons", "linestrings"])
 
    # Example 1: Check whether geometries in column 'polygons' and 'lienstrings'
    #            overlaps or not.
    # Set the geometry property of GeoDataFrame to point to 'polygons' column.
    pols_lines.geometry = pols_lines.polygons
    pols_lines.overlaps(geom_column=pols_lines.linestrings)
 
    # Example 2: Check whether geometries in column 'lienstrings' columns and
    #            a Linestring GeometryType object overlaps or not.
    # Set the geometry property of GeoDataFrame to point to 'linestrings' column.
    pols_lines.geometry = pols_lines.linestrings
    # Create an object of Linestring GeometryType.
    l1 = LineString([(1,3,6), (3,0,6), (6,0,1)])
    # Pass the LineString() GeometryType object as input to "geom_column" argument.
    pols_lines.overlaps(l1)