简体   繁体   中英

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. Can you help me to debug the SQL queries (Postgresql+PostGIS) below? Thank you for your kindness help.

I've used the 3826 geometry.

"ERROR: parse error - invalid geometry HINT: "...79721.29349234176 2759680.13418412))" <-- parse error at position 44 within geometry" in the

    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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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