0

I have to find some types of POIs around a given coordinates. Ideally, I want to find the nearest one of such POI around the given coordinates.

To meet my requirement I can search with either around

[out:json];
(
  node["public_transport"="platform"](around:500,48.2,16.3);
);
out body center qt;
>;
out skel qt;

or approximately with bbox

[out:json][bbox:48.19,16.29,48.21,16.31];
(
  node["public_transport"="platform"];
);
out body center qt;
>;
out skel qt;

My strategy to search quickly is to start search in a small area (short distance or smaller bbox), if I could not find anything then I will increase the search area. I search incrementally until something is found or a hard distance limit is reached.

I am not sure if Overpass-API implementation has done some performance tricks like cache of previous result.

Every time I increase search area I still search the previous smaller area. With bbox I can somehow split it and avoid already searched area, but I do not know I can achieve it with around.

How can I use around method to increase search area without covering old searched one?

update: to focus on search procedure itself. I will ignore the rate/resource limiting, latency, and so on, since I can eventually run my own instance instead of querying public one. I could perform queries in parallel or do some load balance among instance but it is just further optimisation options.

2
  • You need to define your performance requirements / expectations first. Concrete values, please. Also, do you run one or many requests? You might hit some rate limiting, which delays responses, and makes the server appear to be slow. Your question doesn't provide those crucial details.
    – mmd
    Commented Mar 24, 2021 at 11:51
  • @mmd you are right. I update the question and would focus on just around question. The overall system or application performance is not my main point.
    – rnd_nr_gen
    Commented Mar 25, 2021 at 10:18

1 Answer 1

1

After some research I still cannot find any solution to have such around query as I would like to have.

My current alternative solution is to use overpass API to query ALL possible desirable POIs from a specific area and then perform indexing/searching (e.g. with KD-tree) in my application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.