MCPcopy Create free account
hub / github.com/comaps/comaps / read_osm2ft

Function read_osm2ft

tools/python/mwm/ft2osm.py:85–97  ·  view source on GitHub ↗

Reads mwm.osm2ft file, returning a dict of feature id <-> osm id.

(f, ft2osm=False, tuples=True)

Source from the content-addressed store, hash-verified

83
84
85def read_osm2ft(f, ft2osm=False, tuples=True):
86 """Reads mwm.osm2ft file, returning a dict of feature id <-> osm id."""
87 header = read_uint(f, 4)
88 is_new_format = header == 0xFFFFFFFF
89 if is_new_format:
90 version = read_uint(f, 1)
91 if version == 1:
92 return _read_osm2ft_v1(f, ft2osm, tuples)
93 else:
94 raise Exception("Format {0} is not supported".format(version))
95 else:
96 f.seek(0)
97 return _read_osm2ft_v0(f, ft2osm, tuples)
98
99
100def ft2osm(path, ftid):

Callers 2

load_osm2ftFunction · 0.90
ft2osmFunction · 0.85

Calls 4

read_uintFunction · 0.90
_read_osm2ft_v1Function · 0.85
_read_osm2ft_v0Function · 0.85
formatMethod · 0.80

Tested by

no test coverage detected