# Path: lib/geocoder.py
# class Geocoder():
#     class TexasAm:
#     def __init__(self, service, opts=None):
#     def lookup(self, **params):
#     def reverse_lookup(self, lat, lng, **kwargs):
#     def check_for_data(self):
#         def check_for_data_and_call(self, *args, **kwargs):
#     def lat_long(self):
#     def street_address(self):
#     def city(self):
#     def state(self):
#     def zip5(self):
#     def zip4(self):
#     def address(self):
#         def __init__(self, opts=None):
#         def lookup(self, **params):
#         def reverse_lookup(self, lat, lng, **kwargs):
#         def address(self):
#         def street_address(self):
#         def city(self):
#         def state(self):
#         def zip5(self):
#         def zip4(self):
#         def lat_long(self):
#         TEXAS_AM_BASE_URL = 'https://geoservices.tamu.edu/Services/Geocode/WebService/GeocoderWebServiceHttpNonParsed_V04_01.aspx'
#         TEXAS_AM_REVERSE_BASE_URL = 'https://geoservices.tamu.edu/Services/ReverseGeocoding/WebService/v04_01/HTTP/default.aspx'


from django.conf import settings
from lib import geocoder


def geolocate(**kwargs):
    try:
        geo = geocoder.Geocoder('TexasAm', {'apiKey': settings.CONFIG_DICT['api_keys']['texas_am']})
        geo.lookup(**kwargs)
        return geo.lat_long()
    except KeyError:
        raise
        # TODO robust error handling


def reverse_geolocate(lat, lng, state=''):
    try:

# Path: lib/geocoder.py
# class Geocoder():
#     class TexasAm:
#     def __init__(self, service, opts=None):
#     def lookup(self, **params):
#     def reverse_lookup(self, lat, lng, **kwargs):
#     def check_for_data(self):
#         def check_for_data_and_call(self, *args, **kwargs):
#     def lat_long(self):
#     def street_address(self):
#     def city(self):
#     def state(self):
#     def zip5(self):
#     def zip4(self):
#     def address(self):
#         def __init__(self, opts=None):
#         def lookup(self, **params):
#         def reverse_lookup(self, lat, lng, **kwargs):
#         def address(self):
#         def street_address(self):
#         def city(self):
#         def state(self):
#         def zip5(self):
#         def zip4(self):
#         def lat_long(self):
#         TEXAS_AM_BASE_URL = 'https://geoservices.tamu.edu/Services/Geocode/WebService/GeocoderWebServiceHttpNonParsed_V04_01.aspx'
#         TEXAS_AM_REVERSE_BASE_URL = 'https://geoservices.tamu.edu/Services/ReverseGeocoding/WebService/v04_01/HTTP/default.aspx'


# Path: services/geolocation_service.py
from django.conf import settings
from lib import geocoder



def geolocate(**kwargs):
    try:
        geo = geocoder.Geocoder('TexasAm', {'apiKey': settings.CONFIG_DICT['api_keys']['texas_am']})
        geo.lookup(**kwargs)
        return geo.lat_long()
    except KeyError:
        raise
        # TODO robust error handling


def reverse_geolocate(lat, lng, state=''):
    try:

        geo = geocoder.Geocoder('TexasAm', {'apiKey': settings.CONFIG_DICT['api_keys']['texas_am']})