8
8
Copyright : (C) 2012 by Victor Olaya
9
9
Email : volayaf at gmail dot com
10
10
---------------------
11
- Date : April 2014
11
+ Date : April 2014 and May 2016
12
12
Copyright : (C) 2014 by Martin Isenburg
13
13
Email : martin near rapidlasso point com
14
14
***************************************************************************
@@ -70,12 +70,14 @@ class LAStoolsAlgorithm(GeoAlgorithm):
70
70
FILES_ARE_FLIGHTLINES = "FILES_ARE_FLIGHTLINES"
71
71
APPLY_FILE_SOURCE_ID = "APPLY_FILE_SOURCE_ID"
72
72
STEP = "STEP"
73
+
73
74
FILTER_RETURN_CLASS_FLAGS1 = "FILTER_RETURN_CLASS_FLAGS1"
74
75
FILTER_RETURN_CLASS_FLAGS2 = "FILTER_RETURN_CLASS_FLAGS2"
75
76
FILTER_RETURN_CLASS_FLAGS3 = "FILTER_RETURN_CLASS_FLAGS3"
76
77
FILTERS_RETURN_CLASS_FLAGS = ["---" , "keep_last" , "keep_first" , "keep_middle" , "keep_single" , "drop_single" ,
77
78
"keep_double" , "keep_class 2" , "keep_class 2 8" , "keep_class 8" , "keep_class 6" ,
78
- "keep_class 9" , "keep_class 3 4 5" , "keep_class 2 6" , "drop_class 7" , "drop_withheld" , "drop_synthetic" ]
79
+ "keep_class 9" , "keep_class 3 4 5" , "keep_class 3" , "keep_class 4" , "keep_class 5" ,
80
+ "keep_class 2 6" , "drop_class 7" , "drop_withheld" , "drop_synthetic" ]
79
81
FILTER_COORDS_INTENSITY1 = "FILTER_COORDS_INTENSITY1"
80
82
FILTER_COORDS_INTENSITY2 = "FILTER_COORDS_INTENSITY2"
81
83
FILTER_COORDS_INTENSITY3 = "FILTER_COORDS_INTENSITY3"
@@ -103,6 +105,10 @@ class LAStoolsAlgorithm(GeoAlgorithm):
103
105
"scale_scan_angle" , "translate_scan_angle" , "translate_gps_time" , "set_classification" , "set_user_data" ,
104
106
"set_point_source" , "scale_rgb_up" , "scale_rgb_down" , "repair_zero_returns" ]
105
107
108
+ IGNORE_CLASS1 = "IGNORE_CLASS1"
109
+ IGNORE_CLASS2 = "IGNORE_CLASS2"
110
+ IGNORE_CLASSES = ["---" , "unclassified (1)" , "ground (2)" , "veg low (3)" , "veg mid (4)" , "veg high (5)" , "buildings (6)" , "noise (7)" , "keypoint (8)" , "water (9)" ]
111
+
106
112
def getIcon (self ):
107
113
filepath = os .path .dirname (__file__ ) + "/../../../images/tool.png"
108
114
return QtGui .QIcon (filepath )
@@ -139,7 +145,7 @@ def addParametersPointInputCommands(self, commands):
139
145
input = self .getParameterValue (LAStoolsAlgorithm .INPUT_LASLAZ )
140
146
if input is not None :
141
147
commands .append ("-i" )
142
- commands .append (input )
148
+ commands .append ('"' + input + '"' )
143
149
144
150
def addParametersPointInputFolderGUI (self ):
145
151
self .addParameter (ParameterFile (LAStoolsAlgorithm .INPUT_DIRECTORY , self .tr ("input directory" ), True , False ))
@@ -232,7 +238,7 @@ def addParametersPointOutputCommands(self, commands):
232
238
output = self .getOutputValue (LAStoolsAlgorithm .OUTPUT_LASLAZ )
233
239
if output is not None :
234
240
commands .append ("-o" )
235
- commands .append (output )
241
+ commands .append ('"' + output + '"' )
236
242
237
243
def addParametersPointOutputFormatGUI (self ):
238
244
self .addParameter (ParameterSelection (LAStoolsAlgorithm .OUTPUT_POINT_FORMAT , self .tr ("output format" ), LAStoolsAlgorithm .OUTPUT_POINT_FORMATS , 0 ))
@@ -279,7 +285,7 @@ def addParametersOutputDirectoryCommands(self, commands):
279
285
commands .append (odir )
280
286
281
287
def addParametersOutputAppendixGUI (self ):
282
- self .addParameter (ParameterString (LAStoolsAlgorithm .OUTPUT_APPENDIX , self .tr ("output appendix" )))
288
+ self .addParameter (ParameterString (LAStoolsAlgorithm .OUTPUT_APPENDIX , self .tr ("output appendix" ), optional = True ))
283
289
284
290
def addParametersOutputAppendixCommands (self , commands ):
285
291
odix = self .getParameterValue (LAStoolsAlgorithm .OUTPUT_APPENDIX )
@@ -303,7 +309,7 @@ def addParametersTemporaryDirectoryAsInputFilesCommands(self, commands, files):
303
309
commands .append (idir + '\\ ' + files )
304
310
305
311
def addParametersAdditionalGUI (self ):
306
- self .addParameter (ParameterString (LAStoolsAlgorithm .ADDITIONAL_OPTIONS , self .tr ("additional command line parameter(s)" )) , optional = True )
312
+ self .addParameter (ParameterString (LAStoolsAlgorithm .ADDITIONAL_OPTIONS , self .tr ("additional command line parameter(s)" ), optional = True ) )
307
313
308
314
def addParametersAdditionalCommands (self , commands ):
309
315
additional_options = self .getParameterValue (LAStoolsAlgorithm .ADDITIONAL_OPTIONS ).split ()
@@ -413,3 +419,23 @@ def addParametersTransform2OtherCommands(self, commands):
413
419
commands .append ("-" + LAStoolsAlgorithm .TRANSFORM_OTHERS [transform2 ])
414
420
if transform2 < 11 and transform2_arg is not None :
415
421
commands .append (transform2_arg )
422
+
423
+ def addParametersIgnoreClass1GUI (self ):
424
+ self .addParameter (ParameterSelection (LAStoolsAlgorithm .IGNORE_CLASS1 ,
425
+ self .tr ("ignore points with this classification" ), LAStoolsAlgorithm .IGNORE_CLASSES , 0 ))
426
+
427
+ def addParametersIgnoreClass1Commands (self , commands ):
428
+ ignore1 = self .getParameterValue (LAStoolsAlgorithm .IGNORE_CLASS1 )
429
+ if ignore1 != 0 :
430
+ commands .append ("-ignore_class" )
431
+ commands .append (unicode (ignore1 ))
432
+
433
+ def addParametersIgnoreClass2GUI (self ):
434
+ self .addParameter (ParameterSelection (LAStoolsAlgorithm .IGNORE_CLASS2 ,
435
+ self .tr ("also ignore points with this classification" ), LAStoolsAlgorithm .IGNORE_CLASSES , 0 ))
436
+
437
+ def addParametersIgnoreClass2Commands (self , commands ):
438
+ ignore2 = self .getParameterValue (LAStoolsAlgorithm .IGNORE_CLASS2 )
439
+ if ignore2 != 0 :
440
+ commands .append ("-ignore_class" )
441
+ commands .append (unicode (ignore2 ))
0 commit comments