select t.nu as Nu, t. name as Name, ST_Distance( ST_SetSRID(ST_MakePoint(#{Longitude},#{Latitude}),4326)::geography, ST_SetSRID(ST_MakePoint(t.longitude,t.latitude),4326)::geography ) as a from 表a as t /*where ST_DWithin( ST_SetSRID(ST_MakePoint(#{Longitude},#{Latitude}),4326)::geography, ST_SetSRID(ST_MakePoint(t.longitude,t.latitude),4326)::geography 1000)*/ order by ST_Distance( ST_SetSRID(ST_MakePoint(#{Longitude},#{Latitude}),4326)::geography, ST_SetSRID(ST_MakePoint(t.longitude,t.latitude),4326)::geography limit 1
postsql计算固定点到N个点最近距离的sql语句
最新推荐文章于 2024-07-09 06:59:41 发布