I'm in a process of making a game based on OSM data. I will have the player starting in a random city. I have something that is kinda working. It is not producing a result every time, it is slow, and possibly stressful for the server:
I am generating a random coordinates and search for any node with Can you see any way to improve this query? Can you suggest entirely different method of finding a random city? asked 02 Feb '16, 07:30 ivanatora |
How about retrieving all cities of the world once, storing them in a list and choosing a random list element every time you need it? This seems to be a better approach since there isn't a new city appearing every 5 minutes. answered 03 Feb '16, 08:14 scai ♦ 1
This might be getting me to some place. I managed to filter world cities based on population between 100000 - 399999 and it seems there are only 800 cities matching this criteria. I did not mean to use the pop filter in the game, but it is okay way to reduce the size of the list that will be kept locally. http://overpass-turbo.eu/s/e8c
(02 Feb '16, 08:32)
ivanatora
|