Postgresql经纬度增加⼀列:
add column `location` geometry default
st_tsrid(st_makepoint((0)::double precision, (0)::double precision), 4326)
使⽤距离过滤:
1. st_distance( geometry, geometry)
这个函数有两个坑点, 1,是使⽤ 欧式空间, 2 则返回的单位不是以⽶或者km
2. st_distance_sphere(geometry, geometry)
返回的单位是meter
3. st_dwithin(geometry,geometry)
st_dwithin(geography,geography,100⽶)
坑的是, geography其实是有坐标系的, 同⼀坐标系才能计算距离