make_postcode_shapes.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:postcodes-mapit 作者: mhl 项目源码 文件源码
def polygon_requires_clipping(wgs84_polygon):
        geom_type = wgs84_polygon.geom_type
        if geom_type == 'MultiPolygon':
            polygons = wgs84_polygon.coords
        elif geom_type == 'Polygon':
            polygons = [wgs84_polygon.coords]
        else:
            raise Exception("Unknown geom_type {0}".format(geom_type))
        for polygon in polygons:
            for t in polygon:
                for x, y in t:
                    point = Point(x, y)
                    if not uk_multipolygon.contains(point):
                        return True
        return False

    # ------------------------------------------------------------------------

    # Make sure the output directory exists:
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号