PostGIS算法示例

1 点的最近点查询

select smoke, ST_AsGeoJSON(geom) as geom, company, address from power t order by ST_Distance(t.geom,ST_GeometryFromText('POINT(113.77990722656251 34.63320791137959)',4326))  limit 1

4326为坐标系编号;原理是根据距离找最近的一个记录

转载自:https://blog.csdn.net/GISuuser/article/details/79102591

You may also like...

退出移动版