美文网首页开源GIS相关
postgis 求离点最近的线

postgis 求离点最近的线

作者: 不玩了啊 | 来源:发表于2019-11-21 17:06 被阅读0次

With inputPoint AS

(Select st_geomfromtext('POINT(114.19061431884767 22.543833325111848)', 4326) as pnt )

select buffer.* from (

select r.* from road as r,inputPoint as p

      where st_intersects(r.geom,ST_Buffer(Geography(p.pnt), 100,'quad_segs=8')::geometry) ) as buffer,inputPoint as p

order by ST_distance(geom,p.pnt) limit 1

————————————————

版权声明:本文为CSDN博主「hey laosha」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/geol200709/article/details/102931463

相关文章

网友评论

    本文标题:postgis 求离点最近的线

    本文链接:https://www.haomeiwen.com/subject/ajbtwctx.html