Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ST_BUFFER in google bigquery?

To create a polygon around a pair of lat+lon coordinates I'd expect to be able to buffer the geogpoint:

e.g. ST_BUFFER(ST_GEOGPOINT(lat, lon), 1000)

This creates a circular polygon with a radius of 1000m.

Bigquery doesn't seem to have the buffer function, which seems like a really basic one - am I missing something? Thanks!

like image 219
Alex Petrie Avatar asked Aug 25 '26 02:08

Alex Petrie


1 Answers

As for now, ST_BUFFER function is not supported in query engine yet. All available geography functions in Standard SQL you can see here. Additionally, you can think about using buffer function from the open source library Turf.JS to make buffers and use it in BigQuery:

jslibs.turf.ST_BUFFER(geometry_to_buffer GEOGRAPHY, radius NUMERIC, units STRING, steps NUMERIC)

Please follow carto tutorial to learn more about using this function.

like image 170
aga Avatar answered Aug 27 '26 17:08

aga