【发布时间】:2021-08-02 19:35:01
【问题描述】:
正如标题所说,我正在查询存储在 bigquery 中的共享单车数据 我能够提取数据并以正确的顺序排列以显示在路径图中。在数据中,只有开始和结束的经纬度协调,或者有时只开始经纬度,我如何删除少于 4 点的任何东西? 这是代码,我也仅限于选择
SELECT
routeID ,
json_extract(st_asgeojson(st_makeline( array_agg(st_geogpoint(locs.lon, locs.lat) order by locs.date))),'$.coordinates') as geo
FROM
howardcounty.routebatches
where unlockedAt between {{start_date}} and {{end_date}}
cross join UNNEST(locations) as locs
GROUP BY routeID
order by routeID
limit 10
【问题讨论】:
标签: sql google-bigquery gis