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

Product
Teradata Package for Python
Release Number
17.10
Published
May 2022
Language
English (United States)
Last Update
2022-08-18
dita:mapPath
rsu1641592952675.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
B700-4006
lifecycle
previous
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"))