I have two layers, one polygon of output areas in the UK and a point layer of retail centers. I want to use select by location to find out how many output areas are within 1 km from a retail center. The select by location tool does not have the precision parameter to enter the 1km distance. Does anyone have any suggestion whether there's a plugin that does this? I've done this on ArcGIS but I want to know how it is processed in QGIS.
The trick is to use the true distance between the point (in the CRS unit) instead of using a buffer, which is only an approximation.
One way to do the join is by using a virtual layer.
Go to the menu
Layer > Add Layer > Add/Edit Virtual Layer... and enter the following query.
If you want to keep polygons without nearby points, replace
select pg.*, count(*) as count_nearby_rail_centers FROM myPolygonLayer pg JOIN myPointLayer a ON ST_Distance(pg.geometry, b.geometry) <= 1000 group by pg.id