I guess it&#x27;s kind of beside the point of the article, but I wonder if the author considered using a library like Shapely[1].<p>[1] <a href="http:&#x2F;&#x2F;toblerity.org&#x2F;shapely&#x2F;manual.html" rel="nofollow">http:&#x2F;&#x2F;toblerity.org&#x2F;shapely&#x2F;manual.html</a>