pdal

2024-12-12  本文已影响0人  hehehehe

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

上一篇 下一篇

猜你喜欢

热点阅读