I have a GPS device, it moves around the country. It generates a large amount of data with coordinates that are sent and stored in the elastic. And I have a way points data (a static set of geo-coordinates). The GPS device can pass through the way points . I want to use one query to find all the points that appeared within a radius of 300 meters from the points of movement of my gps device. Please explain me by example how you can solve my problem?
Based on my research, I found the bad solution:
I first find all the coordinates of my device (for example, all the coordinates in one day). This query returns me a very large number of geo coordinates. Then, with this request, https://www.elastic.co/guide/en/elasticsearch/reference/6.1/query-dsl-geo-distance-query.html#_lat_lon_as_properties_3
I go through all the coordinates I found from the first query and look for a concrete wai points.
This creates a high load on my cluster and does not look like the optimal solution.