bigframes.bigquery.st_buffer#

bigframes.bigquery.st_buffer(series: Series | GeoSeries, buffer_radius: float, num_seg_quarter_circle: float = 8.0, use_spheroid: bool = False) Series[source]#

Computes a GEOGRAPHY that represents all points whose distance from the input GEOGRAPHY is less than or equal to distance meters.

Note

BigQuery’s Geography functions, like st_buffer, interpret the geometry data type as a point set on the Earth’s surface. A point set is a set of points, lines, and polygons on the WGS84 reference spheroid, with geodesic edges. See: https://cloud.google.com/bigquery/docs/geospatial-data

Examples:

>>> import bigframes.geopandas
>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> from shapely.geometry import Point
>>> series = bigframes.geopandas.GeoSeries(
...         [
...             Point(0, 0),
...             Point(1, 1),
...         ]
... )
>>> series
0    POINT (0 0)
1    POINT (1 1)
dtype: geometry
>>> buffer = bbq.st_buffer(series, 100)
>>> bbq.st_area(buffer) > 0
0    True
1    True
dtype: boolean
Parameters:
  • series (bigframes.pandas.Series | bigframes.geopandas.GeoSeries) – A series containing geography objects.

  • buffer_radius (float) – The distance in meters.

  • num_seg_quarter_circle (float, optional) – Specifies the number of segments that are used to approximate a quarter circle. The default value is 8.0.

  • use_spheroid (bool, optional) – Determines how this function measures distance. If use_spheroid is FALSE, the function measures distance on the surface of a perfect sphere. The use_spheroid parameter currently only supports the value FALSE. The default value of use_spheroid is FALSE.

Returns:

A series of geography objects representing the buffered geometries.

Return type:

bigframes.pandas.Series