Postgresql 經緯度

增長一列:web

add column `location` geometry default 函數

st_setsrid(st_makepoint((0)::double precision, (0)::double precision), 4326)spa

 

 

使用距離過濾:ci

1. st_distance( geometry, geometry) it

這個函數有兩個坑點, 1,是使用 歐式空間, 2 則返回的單位不是以米或者kmio

2. st_distance_sphere(geometry, geometry)  class

返回的單位是meterwebkit

3. st_dwithin(geometry,geometry)margin

st_dwithin(geography,geography,100米)di

坑的是, geography實際上是有座標系的, 同一座標系才能計算距離

相關文章
相關標籤/搜索