Teradata Package for Python Function Reference | 20.00 - disjoint - 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.geodataframecolumn.GeoDataFrameColumn.disjoint = disjoint(self, geom_column)
- DESCRIPTION:
Tests if a Geometry value is spatially disjoint from another Geometry
value.
PARAMETERS:
geom_column:
Required Argument.
Specifies the other Geometry value.
Types: str, ColumnExpression, GeometryType
SUPPORTED GEOMETRY TYPES:
All Geometry types.
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:
GeoDataFrameColumn
Resultant column contains:
* 1, if the geometries are spatially disjoint
* 0, if the geometries are not spatially disjoint
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 few columns from GeoDataFrame.
points_lines = geodf.select(["skey", "points", "linestrings"])
# Example 1: Check whether the ST_Linestring/ST_MultiLinestring geometries in column
# 'linestrings' and ST_Point/ST_MultiPoint geometries in column 'points'
# are disjoint or not.
disjoint1_expr = points_lines.linestrings.disjoint(geom_column=points_lines.points)
points_lines.assign(res = disjoint1_expr)
# Example 2: Check whether the ST_Linestring/ST_MultiLinestring geometries in column
# 'linestrings' and the geometry specified by a GeometryType object - LineString,
# are disjoint or not.
# Create an object of Linestring GeometryType.
l1 = LineString([(3, 1), (0,2)])
# Pass the LineString() GeometryType object as input to "geom_column" argument.
disjoint2_expr = points_lines.linestrings.disjoint(geom_column=l1)
points_lines.assign(res = disjoint2_expr)
# Example 3: Filter rows where ST_Linestring/ST_MultiLinestring geometries in column
# 'linestrings' and ST_Point/ST_MultiPoint geometries in column 'points'
# are disjoint.
disjoint1_expr = points_lines.linestrings.disjoint(geom_column=points_lines.points)
points_lines[disjoint1_expr == 1]