ST_PointInsideCircle
What is ST_PointInsideCircle?
ST_PointInsideCircle returns true if a POINT geometry lies inside a circle defined by an (x, y) centre and a radius. The test is performed in the Cartesian plane using the point's own coordinate reference system.
ST_PointInsideCircle(geometry a_point, float center_x, float center_y, float radius) → booleanThe function accepts only POINT geometry. Radius and centre coordinates are in the same CRS units as the input point — which is why on lat/lon data this function is usually the wrong choice for real-world distances.
When would you use ST_PointInsideCircle?
Use ST_PointInsideCircle for quick planar circle-containment checks on projected data — for example on UTM or EPSG:3857 points where the units are metres. In most modern workflows, ST_DWithin(point, ST_MakePoint(x, y), radius) is a better choice because it is index-accelerated and supports geography for metre-accurate tests on lon/lat data.
1-- Points within 250 m of (485000, 4649000) in a metric CRS
2SELECT id FROM assets
3WHERE ST_PointInsideCircle(geom, 485000, 4649000, 250);FAQs
What units does the radius use?
The same CRS units as the input point. For EPSG:4326 that is degrees (rarely what you want); for UTM or EPSG:3857 it is metres. For metre-accurate proximity on lon/lat data, use ST_DWithin(geom::geography, ...) instead.
Does it use a spatial index?
No. ST_PointInsideCircle is a per-row predicate with no bounding-box integration. Prefer ST_DWithin when you have many candidates and an index.
Can I pass anything other than a POINT?
No. The function requires POINT geometry. For non-point containment checks, use ST_Contains(ST_Buffer(centre, radius), geom) or the more idiomatic ST_DWithin(centre, geom, radius).
Why does this function still exist?
It predates geography support and is retained for backwards compatibility and for the simple case of projected planar data. Most new code should use ST_DWithin for clarity and index acceleration.