grid_service.py 文件源码

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

项目:tasking-manager 作者: hotosm 项目源码 文件源码
def _update_feature(clip_to_aoi: bool, feature: dict, new_shape) -> dict:
        """
        Updates the feature with the new shape, and splittable property
        :param clip_to_aoi: value for feature's splittable property
        :param feature: feature to be updated
        :param new_shape: new shape to use for feature
        :return:
        """
        if clip_to_aoi:
            # update the feature with the clipped shape
            if new_shape.geom_type == 'Polygon':
                # shapely may return a POLYGON rather than a MULTIPOLYGON if there is just one intersection area
                new_shape = MultiPolygon([new_shape])
            feature['geometry'] = mapping(new_shape)
            feature['properties']['x'] = None
            feature['properties']['y'] = None
            feature['properties']['zoom'] = None
            feature['properties']['splittable'] = False
        return feature
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号