Teradata Package for Python Function Reference | 20.00 - mbb_filter - 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
- lifecycle
- latest
- Product Category
- Teradata Vantage
- teradataml.geospatial.geodataframe.GeoDataFrame.mbb_filter = mbb_filter(self, geom_column)
- DESCRIPTION:
Tests whether the MBBs of two 3D geometries spatially intersect.
PARAMETERS:
geom_column:
Required Argument.
Specifies a 3D Geometry.
Types: str, ColumnExpression, GeometryType
SUPPORTED GEOMETRY TYPES:
All 3D Geometry types.
RAISES:
TypeError, ValueError, TeradataMlException
RETURNS:
GeoDataFrame
Resultant column contains:
* 1, if the MBB of the input 3D geometry intersects the MBB
of the geometry passed to the method.
* 0, if the MBB of the input 3D geometry does not intersect
the MBB of the geometry passed to the method.
* Returns an error if either geometry is not 3D (does not
have a z coordinate).
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.
points_lines = geodf[geodf.skey.isin([1004, 1005, 1006])].select(["skey", "points", "linestrings"])
# Example 1: Check whether MBBs of geometries in column 'points' and 'lienstrings'
# spatially intersect or not.
points_lines.mbb_filter(points_lines.linestrings)
# Example 2: Check whether MBBs of geometries in column 'linestrings' and GeometryType object
# Linestring spatially intersect or not.
# Set the geometry property of GeoDataFrame to point to 'linestrings' column.
points_lines.geometry = points_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.
points_lines.mbb_filter(l1)