Welcome to mirror list, hosted at ThFree Co, Russian Federation.

decode_id.py « mwm « python « tools - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 376c91295f4125bc0fd8f60b4771d0077fc05d0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env python3
import sys
import mwm

if len(sys.argv) < 2:
    print('This script unpacks maps.me OSM id to an OSM object link.')
    print('Usage: {} <id>'.format(sys.argv[0]))

osm_id = mwm.unpack_osmid(int(sys.argv[1]))
type_abbr = {'n': 'node', 'w': 'way', 'r': 'relation'}
print('https://www.openstreetmap.org/{}/{}'.format(
    type_abbr[osm_id[0]], osm_id[1]))