Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT AddGeometryColumn('cities', 'geom', 4326, 'POINT', 2);
- UPDATE cities SET geom = ST_SetSRID(ST_MakePoint(longitude, latitude), 4326);
- SELECT *
- FROM cities
- WHERE ST_DWithin(geom, ST_MakePoint(79.3832,43.6532)::geography, 50000);
- WHERE ST_DWithin(geom::geography, ST_SetSRID(ST_MakePoint(79.3832,43.6532),4326)::geography, 50000);
- WHERE ST_DWithin(geom::geography, ST_GeogFromText('SRID=4326;Point(79.3832 43.6532)'), 50000);
- WHERE ST_DWithin(geom::geography, ST_GeogFromText('SRID=4326;Point(-79.3832 43.6532)'), 50000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement