Aggregating (x,y) coordinate point clouds in PostgreSQL

前端 未结 2 704
無奈伤痛
無奈伤痛 2020-12-01 20:42

I have a a PostgreSQL database table with the following simplified structure:

  • Device Id varchar
  • Pos_X (int)
  • Pos_Y (int)

Basica

2条回答
  •  情深已故
    2020-12-01 21:06

    select [some aggregates] group by (pos_x/5, pos_y/5); 
    

    Where instead of 5 you can have any number depending how much aggregation you need/

提交回复
热议问题