- secgeo := ST_Buffer(geometry, diameter);
- x := insertLocationAreaLarge(partition, place_id, country_code, keywords, rank_search, rank_address, true, postcode, ST_Centroid(geometry), secgeo);
+ -- Create a bounding box with an extent computed from the radius (in meters).
+ secgeo := ST_Envelope(ST_Collect(
+ ST_Project(geometry, radius, 0.785398)::geometry,
+ ST_Project(geometry, radius, 3.9269908)::geometry));
+ PERFORM insertLocationAreaLarge(partition, place_id, country_code, keywords, rank_search, rank_address, true, postcode, geometry, secgeo);