1- import numpy as np
2- import laspy
3- from pathlib import Path
41import argparse
5- from pyproj import CRS
2+ from pathlib import Path
63from typing import List , Tuple
74
5+ import laspy
6+ import numpy as np
7+ from pyproj import CRS
8+
89
910def create_random_laz (
1011 output_file : str ,
@@ -27,7 +28,7 @@ def create_random_laz(
2728 (default: (650000, 6810000) ; around Paris)
2829 extra_dims: List of tuples (dimension_name, dimension_type) where type can be:
2930 'float32', 'float64', 'int8', 'int16', 'int32', 'int64', 'uint8', 'uint16', 'uint32', 'uint64'
30- classifications: Optional list of classification values.
31+ classifications: Optional list of classification values.
3132 """
3233
3334 # Create a new point cloud
@@ -103,7 +104,6 @@ def create_random_laz(
103104
104105
105106def test_output_file (result : dict , output_file : str ):
106-
107107 # Validate output file path
108108 output_path = Path (output_file )
109109 if not output_path .exists ():
@@ -126,12 +126,14 @@ def parse_args():
126126 )
127127 parser .add_argument ("--crs" , type = int , default = 2154 , help = "Projection code" )
128128 parser .add_argument (
129- "--center" , type = float , nargs = 2 , default = [650000.0 , 6810000.0 ],
130- help = "Center coordinates (x y) of the area to generate points in (space-separated)"
129+ "--center" ,
130+ type = float ,
131+ nargs = 2 ,
132+ default = [650000.0 , 6810000.0 ],
133+ help = "Center coordinates (x y) of the area to generate points in (space-separated)" ,
131134 )
132135 parser .add_argument (
133- "--classifications" , type = int , nargs = '+' ,
134- help = "List of classification values (space-separated)"
136+ "--classifications" , type = int , nargs = "+" , help = "List of classification values (space-separated)"
135137 )
136138 return parser .parse_args ()
137139
@@ -145,19 +147,13 @@ def main():
145147
146148 # Parse center
147149 center = tuple (args .center [:2 ]) # Only take first 2 values if more are provided
148-
150+
149151 # Parse classifications if provided
150152 classifications = args .classifications
151153
152154 # Call create_random_laz
153155 result = create_random_laz (
154- args .output_file ,
155- args .point_format ,
156- args .num_points ,
157- args .crs ,
158- center ,
159- extra_dims ,
160- classifications
156+ args .output_file , args .point_format , args .num_points , args .crs , center , extra_dims , classifications
161157 )
162158
163159 # Test output file
0 commit comments