如何选择与geojson列不同?

时间:2016-11-21 01:20:26

标签: postgresql

我在pgsql表中有超过10,000个geojson行,我想知道如何选择不同的坐标?

以下是pgsql中的geojson列的片段:

"{"type":"Point","coordinates":[40.7245597839355,-73.9956512451172]}"
"{"type":"Point","coordinates":[40.7349281311035,-73.9920043945312]}"
"{"type":"Point","coordinates":[40.725212097168,-73.9776840209961]}"
"{"type":"Point","coordinates":[40.7429084777832,-73.9770584106445]}"
"{"type":"Point","coordinates":[40.7393226623535,-74.0081176757812]}"

1 个答案:

答案 0 :(得分:0)

我没有看到任何问题

select distinct
json_field #>> '{coordinates, 0}' as latitude,
json_field #>> '{coordinates, 1}' as longitude
from some_table;