(path, ftid)
| 98 | |
| 99 | |
| 100 | def ft2osm(path, ftid): |
| 101 | with open(path, "rb") as f: |
| 102 | ft2osm = read_osm2ft(f, ft2osm=True) |
| 103 | |
| 104 | type_abbr = {"n": "node", "w": "way", "r": "relation"} |
| 105 | ftid = int(ftid) |
| 106 | if ftid in ft2osm: |
| 107 | return f"https://www.openstreetmap.org/{type_abbr[ft2osm[ftid][0]]}/{ft2osm[ftid][1]}" |
| 108 | return None |