Teradata Package for Python Function Reference on VantageCloud Lake | 17.20 - spheroidal_buffer - 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 on VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Package for Python
Release Number
17.20
Publication Date
November 2022
Content Type
Programming Reference
Publication ID
B700-4500-112K
ft:locale
en-US
ft:lastEdition
2024-02-21
ft:sourceId
FTML
dita:id
TeradataPython_FxRef_Lake_1720
Product Category
Teradata Vantage
teradataml.geospatial.geodataframecolumn.GeoDataFrameColumn.spheroidal_buffer = spheroidal_buffer(self, distance, semimajor=6378137.0, invflattening=298.257223563)
DESCRIPTION:
    Returns 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.
    Notes:
        *  For the MBR calculation, the planet is modeled as a spheroid. If you
          do not pass in values for the "semimajor" and "invflattening" arguments,
          the computation uses the semimajor axis and the inverse flattening
          ratio from the World Geodetic System, WGS84. A value of 6,378,137.0
          meters is used for the semimajor axis, and a value of 298.257223563
          is used for the inverse flattening ratio.
        *  spherical_buffer() and spheroidal_buffer() perform a similar
          function, but with different performance and accuracy.
          spherical_buffer() models the earth as a simple sphere, so it
          performs better than spheroidal_buffer(), but with less accuracy.
          spheroidal_buffer() models the earth as a spheroid, so it returns
          a more accurate MBR, but it runs slower than spherical_buffer().
        *  The returned MBR cannot cross the longitude value of +/-180 or the
          latitude value of +/-90. The MBR cannot cover more than 180 degrees
          of latitude or longitude on the sphere or spheroid.
 
PARAMETERS:
    distance:
        Required Argument.
        Specifies the distance, in meters, from the point to
        calculate the MBR.
        Types: float, int, str, ColumnExpression
 
    semimajor:
        Optional Argument.
        Specifies the length, in meters, of the semimajor axis of
        the spheroid. If omitted, the method uses the WGS84 value of
        6,378,137.0 meters.
        Default Value: 6378137.0
        Types: float, int
 
    invflattening:
        Optional Argument.
        Specifies the inverse flattening ratio of the spheroid. If
        omitted, the method uses the WGS84 value of 298.257223563.
        Default Value: 298.257223563
        Types: float, int
 
SUPPORTED GEOMETRY TYPES:
    ST_Point
 
RAISES:
    TypeError, ValueError, TeradataMlException
 
RETURNS:
    GeoDataFrameColumn
 
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_df = geodf.select(["skey", "points"])[geodf.skey.isin([1001, 1002, 1003])]
 
    # Example 1: Get an MBR that represents the minimum and maximum latitude and longitude of
    #            all points within a given distance of 2.8 from a ST_Point in columns 'points'
    #            with default values for other arguments.
    points_df.assign(res = points_df.points.spheroidal_buffer(distance=2.8))
 
    # Example 2: Get an MBR that represents the minimum and maximum latitude and longitude of
    #            all points within a given distance of 2.8, semimajor as 637813 and invflattening
    #            as 298 from a ST_Point in columns 'points'.
    points_df.assign(res = points_df.points.spheroidal_buffer(distance=2.8, semimajor=637813, invflattening=298))