File: get_nodes.py

package info (click to toggle)
python-overpy 0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 556 kB
  • sloc: python: 2,235; xml: 1,055; makefile: 150
file content (22 lines) | stat: -rwxr-xr-x 539 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env python
import overpy

api = overpy.Overpass()

# We can also see a node's metadata:
jet_deau = 60018172
result = api.query(f"node({jet_deau}); out meta;")
node = result.get_node(jet_deau)

print(
    "The node for the famous Geneva {} ({},{}) was:".format(
        node.tags['name'],
        node.lat,
        node.lon
    )
)
attrs = node.attributes

print("* last modified {}".format(attrs['timestamp']))
print("* by {} (uid: {})".format(attrs['user'], attrs['uid']))
print("* in changeset {}".format(attrs['changeset']))