Teradata Package for Python Function Reference on VantageCloud Lake | 17.20 - spherical_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.geodataframe.GeoDataFrame.spherical_buffer = spherical_buffer(self, distance, radius=6371000.0)
DESCRIPTION:
    Returns 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.
    Notes:
        *  spherical_buffer() and spheroidal_buffer() basically perform
          the same 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
 
    radius:
        Optional Argument.
        Specifies the radius of the sphere used to model the earth.
        If omitted, the method uses a value of 6371000.0 meters.
        Default Value: 6371000.0
        Types: float, int, str, ColumnExpression
 
SUPPORTED GEOMETRY TYPES:
    ST_Point
 
RAISES:
    TypeError, ValueError, TeradataMlException
 
RETURNS:
    GeoDataFrame
 
EXAMPLES:
    from teradataml import GeoDataFrame, load_example_data
    from teradataml import Point, LineString, Polygon
    # 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 = 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.spherical_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 and radius as 6371000 from a
    #            ST_Point in columns 'points' with default values for rest of the arguments.
    points.spherical_buffer(distance=2.8, radius=6371000)