result = []
for line in lines:
if input_format == MultiGeo.FORMAT_GUESS or input_format == MultiGeo.FORMAT_GEOCACHING:
- r = re.match('N ?(\d+)° ?(\d+\.\d+) +E ?(\d+)° ?(\d+\.\d+)', line)
+ r = re.match(r'N ?(\d+)° ?(\d+\.\d+) +E ?(\d+)° ?(\d+\.\d+)', line)
if r is not None:
g = r.groups()
result.append((float(g[0]) + float(g[1]) / 60, float(g[2]) + float(g[3]) / 60, None))
continue
if input_format == MultiGeo.FORMAT_GUESS or input_format == MultiGeo.FORMAT_WINTERRODELN:
- r = re.match('(\d+\.\d+) N (\d+\.\d+) E', line)
+ r = re.match(r'(\d+\.\d+) N (\d+\.\d+) E', line)
if not r is None:
result.append((float(r.groups()[0]), float(r.groups()[1]), None))
continue
if input_format == MultiGeo.FORMAT_GUESS or input_format == MultiGeo.FORMAT_GMAPPLUGIN:
- r = re.match('(\d+\.\d+), ?(\d+\.\d+)', line)
+ r = re.match(r'(\d+\.\d+), ?(\d+\.\d+)', line)
if r is not None:
result.append((float(r.groups()[0]), float(r.groups()[1]), None))
continue
result.append('%.6f, %.6f' % (latitude, longitude))
elif output_format == MultiGeo.FORMAT_GPX:
- if not height is None:
+ if height is not None:
result.append(
'<trkpt lat="%.6f" lon="%.6f"><ele>%.2f</ele></trkpt>' % (latitude, longitude, height))
else: