A C# port of jasonlong/geo_pattern