Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import overpy
- api = overpy.Overpass()
- # fetch all ways and nodes
- def coordinatefinder(n,e,s,w):
- query = """way(""" + str(n) + """,""" + str(e) + """,""" + str(s) + ""","""+ str(w) + """) ["highway"];(._;>;);out body;"""
- result = api.query(query)
- f = open('test.tsp','w')
- count=1
- for way in result.ways:
- for node in way.nodes:
- f.write('\n' + str(count) + " %f %f" % (node.lat, node.lon))
- count += 1
- def main():
- coordinatefinder(50.746,7.154,50.748,7.157)
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement