我使用st_distance计算点和多边形之间的几何距离。由于St_ExteriorRing适用于几何体,我使用了几何体,但问题是这个距离id与ArcGIS中的距离不同! 你能让我知道如何获得地理距离!
select ST_Distance(
(select ST_ExteriorRing(geom) AS ering from osm_art_shops where gid =1),
(select geom from art_shops_flickr where id=5124.00000000)
);
结果:0.0341673143905709
但ArcGIS中的距离为:2,787.07米
答案 0 :(得分:0)
是的,可以通过使用:: geography将几何体投射到地理位置来实现。 这是一个例子
select ST_Distance(
(SELECT ST_ExteriorRing(geom) AS ering from osm_art_shops where gid =1)::Geography,
(select geom from art_shops_flickr where id=5124.00000000)::Geography
);
距离:2790.108402858米,与ArcMap中计算的距离几乎相同