To create a polygon around a pair of lat+lon coordinates I'd expect to be able to buffer the geogpoint:
eg 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!
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 libraryTurf.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.
ST_Buffer is now available (in preview) https://cloud.google.com/bigquery/docs/reference/standard-sql/geography_functions#st_buffer
There is also ST_BufferWithTolerance which allows one to specify approximation tolerance, rather than number of segments in polygon approximating the buffer.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.