Created
March 7, 2020 13:28
-
-
Save wheresalice/c051f07c6ede8e6fcbe72df605ba4247 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def states_to_geojson(states): | |
geojson = {} | |
geojson['type'] = 'FeatureCollection' | |
geojson['features'] = [] | |
for state in states.states: | |
point = {} | |
point['type'] = 'Feature' | |
point['properties'] = {'icao': state.icao24, 'callsign': state.callsign, 'origin_country': state.origin_country, | |
'on_ground': state.on_ground, 'velocity': state.velocity, 'spi': state.spi} | |
point['geometry'] = {'type': 'Point', 'coordinates': [state.longitude, state.latitude]} | |
geojson['features'].append(point) | |
return geojson |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment