This is a Python port of jasonlong/geo_pattern