Run a Single Geospatial Function | Teradata Vantage - Use Case 1: Run a Single Geospatial Function - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00
Published
December 2024
ft:locale
en-US
ft:lastEdition
2025-01-23
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage
To run a single Geospatial function, first create GeoDataFrame on a table containing Geospatial data.
geoDF = GeoDataFrame("sample_shapes")

Assume geoDF.geometry points to "geom_col1".

This approach requires user to use GeoDataFrame.assign() function.

Syntax 1: Using 'geometry' property to invoke the function

This syntax uses 'geometry' property of GeoDataFrame to invoke the function.

geoDF.assign(intersect_result = geoDF.geometry.intersects(geoDF.geom_col2))

Syntax 2: Using actual ColumnExpression of a column to invoke the function

This syntax uses actual ColumnExpression, also known as GeoDataFrameColumn object of a column 'geom_col1'.

geoDF.assign(intersect_result = geoDF.geom_col1.intersects(geoDF.geom_col2))

Syntax 3: Passing the column name instead of the GeoDataFrameColumn object as value

This syntax uses the column name as is, instead of passing GeoDataFrameColumn object for 'geom_col2'.

geoDF.assign(intersect_result = geoDF.geometry.intersects("geom_col2"))