Methods | teradataml GeoDataFrameColumn | Teradata Vantage - GeoDataFrameColumn Methods - 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
March 2024
Language
English (United States)
Last Update
2024-04-09
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage

The following tables list methods of teradataml GeoDataFrameColumn. For more details and examples, see Teradata Package for Python Function Reference.

Methods specific to Geospatial Data (All Geometry Types)

Method Method Signature Purpose Return
buffer buffer(self, distance) Return all points whose distance from a Geometry value is less than or equal to a specified distance. teradataml GeoDataFrameColumn
contains contains(self, geom_column) Test if a Geometry value spatially contains another Geometry value. GeoDataFrameColumn
Resultant column contains:
  • 1, if the input geometry contains other geometry
  • 0, if the input geometry does not contain other geometry
crosses crosses(self, geom_column) Test if a Geometry value spatially crosses another Geometry value. GeoDataFrameColumn
Resultant column contains:
  • 1, if the geometries cross
  • 0, if the geometries do not cross
difference difference(self, geom_column) Return a Geometry value that represents the point set difference of two Geometry values. teradataml GeoDataFrameColumn
disjoint disjoint(self, geom_column) Test if a Geometry value is spatially disjoint from another Geometry value. GeoDataFrameColumn
Resultant column contains:
  • 1, if the geometries are spatially disjoint
  • 0, if the geometries are not spatially disjoint
distance distance(self, geom_column) Return the distance between two Geometry values. teradataml GeoDataFrameColumn
distance_3D distance_3D(self, geom_column) Return the distance between two Geometry values. Function considers Z coordinate values, if they exist in the geometries passed to it. GeoDataFrameColumn
Resultant column contains:
  • a NULL, if the Geometry is an empty set.
  • 0, if the two geometries intersect.
  • a float in all other cases. The distance units are those of the two input geometries.
envelope envelope(self) Return the bounding rectangle for the Geometry value. GeoDataFrameColumn with result column containing Geometry values
geom_equals geom_equals(self, geom_column) Test if a Geometry value is spatially equal to another Geometry value. GeoDataFrameColumn
Resultant column contains:
  • 1, if the geometries are spatially equal
  • 0, if the geometries are not spatially equal
intersection intersection(self, geom_column) Return a Geometry type where the value represents the point set intersection of two Geometry values. teradataml GeoDataFrameColumn
intersects intersects(self, geom_column) Test if a Geometry value spatially intersects another Geometry value. GeoDataFrameColumn
Resultant column contains:
  • 1, if the geometries intersect
  • 0, if the geometries do not intersect
make_2D make_2D(self, validate=False) Converts a 3D Geometry value to a 2D Geometry value, and optionally validates that the 2D geometry is well-formed. This method strips the z coordinate from 3D geometries. teradataml GeoDataFrameColumn
mbb mbb(self) Return the 3D minimum bounding box (MBB) that encloses a 3D Geometry. teradataml GeoDataFrameColumn
mbr mbr(self) Return the minimum bounding rectangle (MBR) of a Geometry value. teradataml GeoDataFrameColumn
overlaps overlaps(self, geom_column) Test if a Geometry value spatially overlaps another Geometry value. GeoDataFrameColumn
Resultant column contains:
  • 1, if the geometries overlap
  • 0, if the geometries do not overlap
relates relates(self, geom_column, amatrix) Test if a Geometry value is spatially related to another Geometry value. GeoDataFrameColumn
Resultant column contains:
  • 1, if the spatial relationship between the geometries corresponds

    to one of the acceptable values represented by "amatrix"

  • 0, if the spatial relationship between the geometries does not correspond to one of the acceptable values represented by "amatrix"
set_srid set_srid(self, srid) Set the spatial reference system identifier of the Geometry value. GeoDataFrameColumn

Resultant column contains the Geometry with the spatial reference system identifier set to the specified spatial reference system.

simplify simplify(self, tolerance) Simplify a geometry by removing points that would fall within a specified distance tolerance. teradataml GeoDataFrameColumn
sym_difference sym_difference(self, geom_column) Return a Geometry value that represents the point set symmetric difference of two Geometry values. teradataml GeoDataFrameColumn
to_binary to_binary(self) Return the well-known binary (WKB) representation of a Geometry value. GeoDataFrameColumn with result column containing BLOB value
to_text to_text(self) Return the well-known text (WKT) representation of a Geometry value. GeoDataFrameColumn with result column containing CLOB value
touches touches(self, geom_column) Test if a Geometry value spatially touches another Geometry value. GeoDataFrameColumn
Resultant column contains:
  • 1, if the geometries touch
  • 0, if the geometries do not touch
transform transform(self, to_wkt_srs, from_wkt_srs, to_srsid=-12345) Return a Geometry value transformed to the specified spatial reference system. teradataml GeoDataFrameColumn
union union(self, geom_column) Return a Geometry value that represents the point set union of two Geometry values. teradataml GeoDataFrameColumn
within within(self, geom_column) Test if a Geometry value is spatially within another Geometry value. GeoDataFrameColumn
Resultant column contains:
  • 1, if the geometry is within other geometry
  • 0, if the geometry is not within other geometry
wkb_geom_to_sql wkb_geom_to_sql(self, column) Return a specified Geometry value. teradataml GeoDataFrameColumn
wkt_geom_to_sql wkt_geom_to_sql(self, column) Return a specified Geometry value. teradataml GeoDataFrameColumn

Methods for Point Geometry

Method Method Signature Purpose Return
spherical_buffer spherical_buffer(self, distance, radius=6371000.0) Return an MBR that represents the minimum and maximum latitude and longitude of all points within a given distance from a point. The earth is modeled as a sphere. teradataml GeoDataFrameColumn
spherical_distance spherical_distance(self, geom_column) Return the spherical distance between two spherical coordinates on the planet using the Haversine Formula. Both coordinates must be specified as ST_Point values. teradataml GeoDataFrameColumn
spheroidal_buffer spheroidal_buffer(self, distance, semimajor=6378137.0, invflattening=298.257223563) Return an MBR that represents the minimum and maximum latitude and longitude of all points within a given distance from the point. The earth is modeled as a spheroid. teradataml GeoDataFrameColumn
spheroidal_distance spheroidal_distance(self, geom_column, semimajor=6378137.0, invflattening=298.257223563) Return the distance, in meters, between two spherical coordinates. teradataml GeoDataFrameColumn
set_x set_x(self, xcoord) Set the X coordinate of an ST_Point value. teradataml GeoDataFrameColumn
set_y set_y(self, ycoord) Set the Y coordinate of an ST_Point value. teradataml GeoDataFrameColumn
set_z set_z(self, zcoord) Set the Z coordinate of an ST_Point value. teradataml GeoDataFrameColumn

Methods for LineString Geometry

Method Method Signature Purpose Return
end_point end_point(self) Return the end point of an ST_LineString or GeoSequence value. GeoDataFrameColumn

Resultant column contains a NULL, if the Geometry is an empty set.

length length(self) Return the length measurement of a Geometry type that represents an ST_LineString, GeoSequence, or ST_MultiLineString value. teradataml GeoDataFrameColumn
length_3D length_3D(self) Return the length of a 3D LineString or MultiLineString, taking into account the Z coordinates in the calculation. GeoDataFrameColumn

Resultant column contains a 0, if the LineString or MultiLineString is an empty set.

line_interpolate_point line_interpolate_point(self, proportion) Return a point interpolated along a Geometry type that represents an ST_LineString or GeoSequence value, given a proportional distance along that line. GeoDataFrameColumn with result column containing ST_Point Geometry values
num_points num_points(self) Return the number of points in a Geometry type that represents an ST_LineString or GeoSequence value. GeoDataFrameColumn

Resultant column contains a NULL, if the Geometry is an empty set.

point point(self, position) Return the specified point from a Geometry type that represents an ST_LineString or GeoSequence value. teradataml GeoDataFrameColumn
start_point start_point(self) Return the start point of an ST_LineString or GeoSequence value.
This method returns a point having a Z coordinate if the input geometry is three-dimensional.
teradataml GeoDataFrameColumn

Methods for Polygon Geometry

Method Method Signature Purpose Return
interiors interiors(self, position) Return the specified interior ring of a Geometry type that represents an ST_Polygon value. GeoDataFrameColumn with result column containing ST_LineString Geometry values
num_interior_ring num_interior_ring(self) Return the number of interior rings of a Geometry type that represents an ST_Polygon value. teradataml GeoDataFrameColumn
point_on_surface point_on_surface(self) Return a point that is guaranteed to spatially intersect an ST_Polygon, or at least one of the component polygons of an ST_MultiPolygon. teradataml GeoDataFrameColumn

Methods for GeometryCollection Geometry

Method Method Signature Purpose Return
geom_component geom_component(self, position) Return the geometry of one component member of a composite geometry type (ST_GeomCollection, ST_MultiPoint, ST_MultiLineString, or ST_MultiPolygon). The element to be returned is specified by position with the collection. teradataml GeoDataFrameColumn
num_geometry num_geometry(self) Return the number of distinct geometries that constitute a composite geometry type (ST_GeomCollection, ST_MultiPoint, ST_MultiLineString, or ST_MultiPolygon). teradataml GeoDataFrameColumn

Methods for GeoSequence Geometry

Method Method Signature Purpose Return
clip clip(self, start_timestamp, end_timestamp) Return a GeoSequence type containing the subset of points and associated data that lie between the two timestamp input arguments. teradataml GeoDataFrameColumn
get_final_timestamp get_final_timestamp(self) Return the TimeStamp of the last point of a GeoSequence. teradataml GeoDataFrameColumn
get_init_timestamp get_init_timestamp(self) Return the TimeStamp of the first point of a GeoSequence. teradataml GeoDataFrameColumn
get_link get_link(self, index) Get the link ID of a specified point in a GeoSequence. teradataml GeoDataFrameColumn
get_user_field get_user_field(self, field_index, index) Return the user field specified by "field_index" for the point specified by "index" for a GeoSequence type. teradataml GeoDataFrameColumn
get_user_field_count get_user_field_count(self) Return the number of user fields associated with each point of a GeoSequence. teradataml GeoDataFrameColumn
point_heading point_heading(self, index) Return the heading for the specified point of a GeoSequence.

The value is calculated as the angle (in degrees) between a vertical line and the line segment from the specified point to the next point clockwise from the North.

teradataml GeoDataFrameColumn
set_link set_link(self, index, link_id) Set the link ID of a specified point in a GeoSequence. teradataml GeoDataFrameColumn
speed speed(self, index=None, begin_index=None, end_index=None) Return the approximate speed at a specified point (speed(index INTEGER)) or between two points (speed(iBegin INTEGER, iEnd INTEGER)) for a GeoSequence type. teradataml GeoDataFrameColumn

Filtering Functions and Methods

Method Method Signature Purpose Return
intersects_mbb intersects_mbb(self, geom_column) Test whether a 3D geometry spatially intersects a specified MBB. GeoDataFrameColumn
Resultant column contains:
  • 1, if the input 3D geometry intersects the MBB argument.
  • 0, if the input 3D geometry does not intersect the MBB argument.
  • Return an error if the input geometry is not 3D (does not have a z coordinate).
mbb_filter mbb_filter(self, geom_column) Test whether the MBBs of two 3D geometries spatially intersect. GeoDataFrameColumn
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.
  • Return an error if either geometry is not 3D (does not have a z coordinate).
mbr_filter mbr_filter(self, geom_column) Test whether the MBRs of two 2D geometries spatially intersect. GeoDataFrameColumn
Resultant column contains:
  • 1, if the MBR of the input geometry intersects the MBR of the geometry passed to the method.
  • 0, if the MBR of the input geometry does not intersect the MBR of the geometry passed to the method.
within_mbb within_mbb(self, geom_column) Test whether a 3D geometry is spatially within the bounds of a specified MBB. GeoDataFrameColumn
Resultant column contains:
  • 1, if the input 3D geometry is spatially within MBB argument.
  • 0, if the input 3D geometry is not spatially within the MBB argument.
  • Return an error if the input geometry is not 3D (does not have a z coordinate).