[postgis-users] Finding points in a circle

Tony Elmore tonyelmore at me.com
Mon Apr 13 22:27:18 PDT 2009


Admittedly, I have not spent a tremendous amount of time with this yet  
- so I'm not really asking for a solution here, but would like some  
feedback to determine if I'm on the right track.

Is this scenario possible using postGIS?

i have many items (hundreds of thousands) with each item containing a  
lat / lng and a radius (each item could have a different radius).  The  
circle created by the lat / lng and radius for each item would in all  
likelihood overlap with other items.

Given a random point, is it possible to retrieve all of the rows where  
the random point is inside the circle created from the lat / lng and  
radius?

I would assume I should create the circle for each item first and  
store that as geometry.

Could someone please verify that this scenario is appropriate for  
postgis.

Regards,
Tony