-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo_script.py
33 lines (24 loc) · 1010 Bytes
/
demo_script.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""Example python script used to demonstrate the usage of local python scripts inside the pdal_ign_plugin
docker image
"""
import argparse
import pdal
from pdal_ign_macro import version as pim_version
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"-i", "--input_file", type=str, help="Input las/laz file on which to run the script"
)
parser.add_argument("-o", "--output_file", type=str, help="Out las/laz file of the script")
return parser.parse_args()
def main(input_file, output_file):
print("Pdal version is:", pdal.__version__)
print("pdal_ign_macro version is:", pim_version.__version__)
print("Copy input file to output file as LAS1.4")
pipeline = pdal.Pipeline()
pipeline |= pdal.Reader.las(filename=input_file)
pipeline |= pdal.Writer.las(filename=output_file, major_version=1, minor_version=4)
pipeline.execute()
if __name__ == "__main__":
args = parse_args()
main(args.input_file, args.output_file)