Exemple #1
0
def _is_geocode_in_db(address):
    db = db_connect()
    table = db['geocoding']
    row = table.find_one(address=address)
    if row:
        return True
    else:
        return False
Exemple #2
0
def _save_geocoding(address, lat, long):
    db = db_connect()
    table = db['geocoding']
    row = table.find_one(address=address)
    if not row:
        table.insert({'address': address, 'lat': lat, 'long': long})
Exemple #3
0
def _get_geocoding(address):
    db = db_connect()
    table = db['geocoding']
    row = table.find_one(address=address)
    if row:
        return row['lat'], row['long']