diff --git a/layers/airports/get_data.py b/layers/airports/get_data.py index 9a00e40..ec19efd 100755 --- a/layers/airports/get_data.py +++ b/layers/airports/get_data.py @@ -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))