Refine airport layer data
This commit is contained in:
parent
4b37e0fd55
commit
bb829d7a78
1 changed files with 15 additions and 3 deletions
|
|
@ -19,14 +19,26 @@ for airport_type in types:
|
|||
|
||||
for airport in airports:
|
||||
if airport['type'] == airport_type:
|
||||
geojson['features'].append({
|
||||
f = {
|
||||
"type": "Feature",
|
||||
"geometry": {
|
||||
"type": "Point",
|
||||
"coordinates": [float(airport['longitude_deg']), float(airport['latitude_deg'])]
|
||||
},
|
||||
"properties": airport, # TODO
|
||||
})
|
||||
"properties": {
|
||||
"ID": airport['ident'],
|
||||
"Name": airport['name'],
|
||||
"City": airport['municipality'],
|
||||
"Country": airport['iso_country'],
|
||||
"Region": airport['iso_region'],
|
||||
"Elevation (ft)": airport['elevation_ft'],
|
||||
}
|
||||
}
|
||||
if airport['wikipedia_link']:
|
||||
f['properties']['Wikipedia'] = airport['wikipedia_link']
|
||||
if airport['home_link']:
|
||||
f['properties']['Website'] = airport['home_link']
|
||||
geojson['features'].append(f)
|
||||
|
||||
with open(f'data/{airport_type}.geojson', 'w') as f:
|
||||
f.write(json.dumps(geojson))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue