def get_location(cursor, lon, lat):
    """
    Query the database citydefs table to see if the point is within
    one. Return 1 (Unknown) if not
    """
    sql = (
        "SELECT citydef_uid FROM citydefs WHERE within(ST_GeomFromText('Point({0} {1})'), geom)"
        .format(lon, lat))
    cursor.execute(sql)
    try:
        loc_id = cursor.fetchone()[0]
    except TypeError:
        loc_id = 1
    return loc_id
