def loc2Dict(loc):
    """
	Convert a loc into a dictionary, for the consideration of maintainability.

	Parameters
	----------
	loc: list
		A location, in format of [lat, lon] or [lat, lon, alt]

	Return
	------
	dictionary
		A dictionary of location
	"""
    if len(loc) == 2:
        locDict = {'lat': loc[0], 'lon': loc[1], 'alt': 0}
    elif len(loc) == 3:
        locDict = {'lat': loc[0], 'lon': loc[1], 'alt': loc[2]}
    else:
        return
    return locDict
