import json
import math

from haversine import haversine


class Distances(object):
    def __init__(self):
        airport_json = open("./alaska_airports.json", "r").read()
        self.alaska_airports = json.loads(airport_json)

    def toRadians(self, degrees):
        return degrees * math.pi / 180

    def distance(self, location1, location2):
        return haversine(location1, location2)

    def get_coords(self, airport_code):
        lat = float()
        lon = float()

        for airport in self.alaska_airports:
            if airport['LocationID'] == airport_code:
                lat = airport['Lat']
                lon = airport['Lon']

        print("{}, {}".format(lat,lon))
        return(lat, lon)


Distances().get_coords('ADK')
# coords = Distances(get_coords('AQY'))

2b25f6a63b40d9e557d43c91604fc03280e346d6
<mask token>


class Distances(object):

    def __init__(self):
        airport_json = open('./alaska_airports.json', 'r').read()
        self.alaska_airports = json.loads(airport_json)

    def toRadians(self, degrees):
        return degrees * math.pi / 180
    <mask token>

    def get_coords(self, airport_code):
        lat = float()
        lon = float()
        for airport in self.alaska_airports:
            if airport['LocationID'] == airport_code:
                lat = airport['Lat']
                lon = airport['Lon']
        print('{}, {}'.format(lat, lon))
        return lat, lon


<mask token>

<mask token>


class Distances(object):

    def __init__(self):
        airport_json = open('./alaska_airports.json', 'r').read()
        self.alaska_airports = json.loads(airport_json)

    def toRadians(self, degrees):
        return degrees * math.pi / 180

    def distance(self, location1, location2):
        return haversine(location1, location2)

    def get_coords(self, airport_code):
        lat = float()
        lon = float()
        for airport in self.alaska_airports:
            if airport['LocationID'] == airport_code:
                lat = airport['Lat']
                lon = airport['Lon']
        print('{}, {}'.format(lat, lon))
        return lat, lon


<mask token>

<mask token>


class Distances(object):

    def __init__(self):
        airport_json = open('./alaska_airports.json', 'r').read()
        self.alaska_airports = json.loads(airport_json)

    def toRadians(self, degrees):
        return degrees * math.pi / 180

    def distance(self, location1, location2):
        return haversine(location1, location2)

    def get_coords(self, airport_code):
        lat = float()
        lon = float()
        for airport in self.alaska_airports:
            if airport['LocationID'] == airport_code:
                lat = airport['Lat']
                lon = airport['Lon']
        print('{}, {}'.format(lat, lon))
        return lat, lon


Distances().get_coords('ADK')

import json
import math
from haversine import haversine


class Distances(object):

    def __init__(self):
        airport_json = open('./alaska_airports.json', 'r').read()
        self.alaska_airports = json.loads(airport_json)

    def toRadians(self, degrees):
        return degrees * math.pi / 180

    def distance(self, location1, location2):
        return haversine(location1, location2)

    def get_coords(self, airport_code):
        lat = float()
        lon = float()
        for airport in self.alaska_airports:
            if airport['LocationID'] == airport_code:
                lat = airport['Lat']
                lon = airport['Lon']
        print('{}, {}'.format(lat, lon))
        return lat, lon


Distances().get_coords('ADK')

import json
import math

from haversine import haversine


class Distances(object):
    def __init__(self):
        airport_json = open("./alaska_airports.json", "r").read()
        self.alaska_airports = json.loads(airport_json)

    def toRadians(self, degrees):
        return degrees * math.pi / 180

    def distance(self, location1, location2):
        return haversine(location1, location2)

    def get_coords(self, airport_code):
        lat = float()
        lon = float()

        for airport in self.alaska_airports:
            if airport['LocationID'] == airport_code:
                lat = airport['Lat']
                lon = airport['Lon']

        print("{}, {}".format(lat,lon))
        return(lat, lon)


Distances().get_coords('ADK')
# coords = Distances(get_coords('AQY'))
