Hi, OSM crew. I'm newbie here. I try to count each POI nodes around specific GPS coordinates. This is my code for loading node around specific lat and lon using Python
From this code, I get every nodes around that specific area. But I have more than 50,000 place to find. I want to know how can I use some variables instead of typing every coordinates in my code. Moreover, I just want to count every POI node separated by its amenity tag such as 'drinking_water' or 'cafe' but I can't find tag index in data Thanks for any help. asked 02 Oct '18, 11:41 Krawan |
Your current query is for all nodes, so most of them don't have tags. You probably want to restrict that a bit. Something like this will only return nodes with an amenity tag or a tourism tag (they don't have to have both):
Generating the query is more a python question, there's lots of ways to do string substitution over there. In Python 3 I tend to use format strings anymore, so you could replace the coordinates in your query with some variables:
Then you'd substitute in the values:
You might also consider using the answered 02 Oct '18, 21:25 maxerickson |