我试图找出与给定圆相交或重叠的数据库中存储的所有圆圈(圆圈遍布世界各地)。我已经存储了这样的圈子:
CREATE TABLE circles(gid serial PRIMARY KEY, name varchar, code integer, the_geog geography(POLYGON,4326) );
INSERT INTO circles (gid, name, code, the_geog) VALUES (1,"hello", 11,geometry(ST_Buffer(geography(ST_GeomFromText('POINT(48.732084 -3.459144)')), 1000)));
现在,当我试图查找与给定圈子相交的所有圈子时,我收到此错误:
ERROR: Only lon/lat coordinate systems are supported in geography.
我使用此查询获取数据:
select * from circles where st_intersects (circles.the_geog,ST_Buffer(ST_Transform(ST_GeomFromText('POINT(-105.04428 39.74779)', 4326), 2877), 1500));
谁能告诉我我做错了什么?
答案 0 :(得分:0)
我通过使用:
来实现这一目标select * from circles where st_intersects (circles.the_geog,geometry(ST_Buffer(geography(ST_GeomFromText('POINT(13.28527 52.521711)')), 1000)));