Add GPX generation
This commit is contained in:
+9
-2
@@ -29,6 +29,8 @@ def get_megalithic_data(country=1):
|
||||
'lat': row['lat'],
|
||||
'lng': row['lng'],
|
||||
'name': row['Name'],
|
||||
'type': row['Type'],
|
||||
'url': 'https://megalithic.co.uk/article.php?sid={}'.format(row['SID']),
|
||||
})
|
||||
|
||||
return data
|
||||
@@ -52,11 +54,16 @@ def get_stone_circles_data():
|
||||
data.append({
|
||||
'lat': item[0],
|
||||
'lng': item[1],
|
||||
'name': re.match(r'.+<a .+>(.+)</a>', item[2]).groups()[0],
|
||||
'name': re.sub(r'<.+?>', '', re.match(r'<b>(.+)</b>', item[2]).groups()[0]),
|
||||
'type': re.sub(r'.+>', '', item[2].replace('<br>', ' ')),
|
||||
'url': 'http://www.stone-circles.org.uk/stone/{}'.format(re.search(r'href=([a-zA-Z.]+)', item[2]).groups()[0]),
|
||||
})
|
||||
|
||||
return data
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
all_data = get_megalithic_data() + get_stone_circles_data()
|
||||
all_data = get_stone_circles_data() # + get_megalithic_data()
|
||||
|
||||
with open('data.json', 'w') as f:
|
||||
json.dump(all_data, f)
|
||||
|
||||
Reference in New Issue
Block a user