简体   繁体   English

使用PostGIS检索附近的点

[英]Use PostGIS to retrieve the nearby points

I've tried to use PostGIS to retrieve the nearby points, however, I've gotten an error message from the pgAdmin3. 我尝试使用PostGIS来检索附近的点,但是,我从pgAdmin3收到一条错误消息。 Can you help me to debug the SQL queries (Postgresql+PostGIS) below? 您能帮我调试下面的SQL查询(Postgresql + PostGIS)吗? Thank you for your kindness help. 感谢您的帮助。

I've used the 3826 geometry. 我使用了3826几何。

"ERROR: parse error - invalid geometry HINT: "...79721.29349234176 2759680.13418412))" <-- parse error at position 44 within geometry" in the “错误:解析错误-无效的几何提示:“ ... 79721.29349234176 2759680.13418412))” <-解析几何中位置44的错误“

    SELECT *  FROM pointslight

    WHERE ST_DWithin(

            ST_Transform(ST_GeomFromText('POINT(279721.29349234176 2759680.13418412))',3826),26986),
            ST_Transform(location,26986), 50)
            ORDER BY ST_Distance(ST_GeomFromText('POINT(279721.29349234176 2759680.13418412))',3826), location);

In the string defining the point, you have one opening parenthesis an two closing one. 在定义该点的字符串中,您需要在一个圆括号中加上两个闭合的圆括号。 Remove one of the latter! 删除后者之一!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM