def in_us(lat, lon): p = Point(lon, lat) for state, poly in state_polygons.iteritems(): if poly.contains(p): return state return None