Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP User-Agent #1

Closed
mmd-osm opened this issue Jan 17, 2018 · 3 comments
Closed

HTTP User-Agent #1

mmd-osm opened this issue Jan 17, 2018 · 3 comments
Assignees

Comments

@mmd-osm
Copy link

mmd-osm commented Jan 17, 2018

Your Overpass API requests contain a generic HTTP User-Agent only at this time. Could you please add some information about your app here, so it's easier to contact you in case of issues?

similar to e.g. https://stackoverflow.com/a/5027588/3501889

@Teester
Copy link
Owner

Teester commented Jan 18, 2018

I've released version 0.7 which adds "User-Agent = whatsnearby/0.7" to the request headers.

I'm interested in the potential impact of the app on the Overpass api. I can't find any way to measure it apart from measuring the length of time a request takes. The requests are all of a form similar to http://overpass-turbo.eu/s/rA1. My testing has shown that they generally take less than 1s each and are around 5Kb or less per request. The app should not query Overpass more often than once per hour and then only if the user has moved far enough from the last location, so I'm expecting around 8-10 requests per user per day at most. And even this might prove to be too much from the perspective of annoying the user with notifications.

I'm going to close this issue as the User-Agent issue has been resolved, but I would appreciate any input you might have regarding the above

@Teester Teester closed this as completed Jan 18, 2018
@Teester Teester reopened this Jan 18, 2018
@Teester Teester self-assigned this Jan 18, 2018
@Teester Teester closed this as completed Jan 18, 2018
@mmd-osm
Copy link
Author

mmd-osm commented Jan 18, 2018

I'm going to close this issue as the User-Agent issue has been resolved

Great, thanks for the quick fix.

The number of requests shouldn't cause any issues then. You could maybe experiment with regular expressions and a global bounding box, instead of (around:...) and many single query statements. This should be the fastest way to get query results. The global bounding box should of course somehow match the previous radius.

[out:json][timeout:25]
[bbox:{{bbox}}];
(
  
  node[~"^(shop|amenity|tourism|leisure)$"~"."];
  way[~"^(shop|amenity|tourism|leisure)$"~"."];
  relation[~"^(shop|amenity|tourism|leisure)$"~"."];
);
out center;

@Teester
Copy link
Owner

Teester commented Jan 19, 2018

Interesting. Thanks for your input.

I have briefly experimented with using a similar regexp, but given the short query time, it was difficult to see what impact it had. Using a larger bbox (or around value) might provide a better understanding.

In any case, from the perspective of the app, the query time is not particularly important. The user only becomes aware that query has even been run when they are notified about results from it, so it doesn't make much difference if the query time is 0.5s or 5.0s (unless it impacts their data plan).

If using regexp and/or a bbox reduces the load on overpass, I'll definitely consider them. In particular, using the regexp should simplify query generation for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants