Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ID | Coordinate
- -----------------------------
- 1 | POINT(192.938 -28.348)
- 2 | POINT(57.349 -88.482)
- SELECT * FROM places WHERE ST_DWithin(places.Coordinate, ST_GeographyFromText('POINT(195.888 -28.348)'), 16093.4);
- SELECT
- id,
- coordinate,
- v2.geogwkt,
- ST_DWithin(
- coordinate::geography,
- geogwkt::geography,
- 16093.4
- ),
- ST_Distance( coordinate::geography, geogwkt::geography )
- FROM ( VALUES
- ( 1, 'POINT(192.938 -28.348)' ),
- ( 2, 'POINT(57.349 -88.482)' )
- ) AS v1(id, coordinate)
- CROSS JOIN ( VALUES ('POINT(195.888 -28.348)') )
- AS v2(geogwkt);
- id | coordinate | geogwkt | st_dwithin | st_distance
- ----+------------------------+------------------------+------------+------------------
- 1 | POINT(192.938 -28.348) | POINT(195.888 -28.348) | f | 289222.77513405
- 2 | POINT(57.349 -88.482) | POINT(195.888 -28.348) | f | 6992543.20903735
- (2 rows)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement