qgis_hal.py 文件源码

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

项目:albion 作者: Oslandia 项目源码 文件源码
def create_memory_layer(geometry_type, crs, name, custom_properties=None):
    assert geometry_type in (QGis.Point, QGis.Line, QGis.Polygon)
    layer = QgsVectorLayer(
        "{}?crs={}&index=yes".format(
            {
                QGis.Point: "Point",
                QGis.Line: "LineString",
                QGis.Polygon: "Polygon"
            }[geometry_type],
            crs.authid()
            ), name, "memory")
    layer.setCrs(crs)
    if custom_properties:
        for key in custom_properties:
            layer.setCustomProperty(key, custom_properties[key])
    return layer
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号