pdal

作者: hehehehe | 来源:发表于2024-12-12 15:17 被阅读0次

    conda install --channel conda-forge pdal

    4326 -> 3857

    {
      "pipeline": [
        {
          "type": "readers.las",
          "filename": "epsg_4326.las"
        },
        {
          "type": "filters.reprojection",
          "in_srs": "EPSG:4326",   
          "out_srs": "EPSG:3857"   
        },
        {
          "type": "writers.las",
          "filename": "epsg_3857.las"
        }
      ]
    }
    
    (base) root@5d1e7d5f370e:/tmp/docker# pdal pipeline 4326-3857.json 
    
    import pdal
    
    # 定义 PDAL 管道
    pipeline = """
    [
        "input.las",
        {
            "type": "filters.reprojection",
            "in_srs": "EPSG:4326",
            "out_srs": "EPSG:3857"
        },
        "output.las"
    ]
    """
    
    # 创建并执行管道
    p = pdal.Pipeline(pipeline)
    p.execute()
    
    print("转换完成")
    
    

    filters.python

    {
      "pipeline": [
        {
          "type": "readers.las",
          "filename": "epsg_4326.las"
        },
        {
          "type": "filters.python",
          "script": "pdal_python_func.py",
          "function": "multiply_z",
          "module": "ss"
        },
        {
          "type": "writers.las",
          "filename": "epsg_3857_3.las"
        }
      ]
    }
    
    
    import numpy as np
    def multiply_z(ins,outs):
        print(sys.path)
        Z = ins['Z']
        Z = Z * 10.0
        outs['Z'] = Z
        return True
    
    

    pdal pipeline 4326-3857-py.json

    相关文章

      网友评论

          本文标题:pdal

          本文链接:https://www.haomeiwen.com/subject/phsxejtx.html