def geoIsPointInPoly(loc, poly):
	"""
	Determine if a point is inside a polygon.  Points that are along the perimeter of the polygon (including vertices) are considered to be "inside".

	Parameters
	----------
	loc: list
		The coordinate of the point, in [lat, lon] format
	poly: list of lists
		The polygon to check if the point is inside, in [[lat, lon], [lat, lon], ..., [lat, lon]] format
	Returns
	-------
	boolean
		The point is inside the polygon or not
	"""

	if (loc in poly):
		return True

	x = loc[1]
	y = loc[0]
	inside = False
	j = len(poly) - 1
	for i in range(0,len(poly)):
		# Check if pt is in interior:
		xi = poly[i][1]
		yi = poly[i][0]
		xj = poly[j][1]
		yj = poly[j][0]
		intersect = (yi > y) != (yj > y)		
		if (intersect):
			intersect = (x < (xj - xi) * (y - yi) / float(yj - yi) + xi)
		if (intersect):
			inside = not inside
		j = i
		
	return inside