Implement a spatial indexing algorithm, such as a quadtree or R-tree, to efficiently query objects within a bounding box for Neara.
Use a quadtree for point objects. The function receives objects as dictionaries with unique id, x, and y fields, plus an inclusive bounding box [min_x, min_y, max_x, max_y]. Return matching IDs in their original input order. Define the function as def query_objects(objects, bbox):.
def query_objects(objects, bbox):