Skip to main content
3 of 6
added 307 characters in body
Sean
  • 4.2k
  • 20
  • 24

You don't give any information about your tables. Assuming the point isn't in a table and venues has fields id, radius, geom...

select
   venue.id
from
   venue
where
   st_intersects( 'POINT(0 0)'::geometry, st_buffer(venu.geom, venue.radius) )

This goes through the venues table and

  • reads the point geometry stored for the venue in venues.geom,
  • draws a circle around that point with the radius stored in venues.radius,
  • and tests whether the POINT(0 0) intersects that circle.

It returns the venue.id if they intersect.

I recommend playing with SpatiaLite to learn about the basic geometry operations. It's easier to set up and get going than PostGIS. They have a nice tutorial, too. Most of the functions are the same if only named differently.

Sean
  • 4.2k
  • 20
  • 24