Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT *
- FROM my_table
- WHERE coordinates
- && -- intersects, gets more rows -- CHOOSE ONLY THE
- @ -- contained by, gets fewer rows -- ONE YOU NEED!
- ST_MakeEnvelope (
- xmin, ymin, -- bounding
- xmax, ymax, -- box limits
- my_srid)
- WHERE ST_MakeEnvelope (...)
- ~ -- contains, gets same fewer rows
- coordinates
- SELECT ST_Y(the_geom) AS latitude, ST_X(the_geom) as longitude
- from units u where the_geom && ST_MakeEnvelope(left, bottom, right, top, 4326)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement