Skip to content

Commit

Permalink
indentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed May 21, 2014
1 parent 470431d commit 5b2824f
Show file tree
Hide file tree
Showing 41 changed files with 254 additions and 245 deletions.
6 changes: 3 additions & 3 deletions python/core/contextmanagers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
@contextmanager
def qgisapp(args=None, guienabled=True, configpath=None, sysexit=True):
"""
Create a new QGIS Qt application.
Create a new QGIS Qt application.
You should use this before creating any Qt widgets or QGIS objects for
your custom QGIS based application.
usage:
from qgis.core.contextmanagers import qgisapp
Expand Down
6 changes: 3 additions & 3 deletions python/custom_widgets/qgis_customwidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@
# pluginType = CW_FILTER
# def getFilter():
# import qgis.gui
#
#
# QGIS_widgets = {}
# for pyClass in dir(qgis.gui):
# QGIS_widgets[pyClass] = 'qgis.gui'
#
#
# def _QGISfilter(widgetname, baseclassname, module):
# print widgetname, baseclassname, module
# if widgetname in QGIS_widgets:
# return (MATCH, (widgetname, baseclassname, QGIS_widgets[widgetname]))
# else:
# return (NO_MATCH, None)
#
#
# return _QGISfilter


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ def processAlgorithm(self, progress):
geomColumn = geomColumn.lower()
if dropStringLength:
options['dropStringConstraints'] = True

uri = QgsDataSourceURI()
uri.setConnection(host, str(port), database, username, password)
if primaryKeyField:
uri.setDataSource(schema, table, geomColumn, '', primaryKeyField)
else:
uri.setDataSource(schema, table, geomColumn, '')

layerUri = self.getParameterValue(self.INPUT)
layer = dataobjects.getObjectFromUri(layerUri)
(ret, errMsg) = QgsVectorLayerImport.importLayer(
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/ogr2ogr.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
'GPX',
'PGDump',
'GPSTrackMaker',
'ODS',
'ODS',
'XLSX',
'PDF',
]
Expand Down
64 changes: 32 additions & 32 deletions python/plugins/processing/algs/lidar/lastools/LAStoolsAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ class LAStoolsAlgorithm(GeoAlgorithm):
FILTER_RETURN_CLASS_FLAGS1 = "FILTER_RETURN_CLASS_FLAGS1"
FILTER_RETURN_CLASS_FLAGS2 = "FILTER_RETURN_CLASS_FLAGS2"
FILTER_RETURN_CLASS_FLAGS3 = "FILTER_RETURN_CLASS_FLAGS3"
FILTERS_RETURN_CLASS_FLAGS = ["---", "keep_last", "keep_first", "keep_middle", "keep_single", "drop_single",
"keep_double", "keep_class 2", "keep_class 2 8", "keep_class 8", "keep_class 6",
FILTERS_RETURN_CLASS_FLAGS = ["---", "keep_last", "keep_first", "keep_middle", "keep_single", "drop_single",
"keep_double", "keep_class 2", "keep_class 2 8", "keep_class 8", "keep_class 6",
"keep_class 9", "keep_class 3 4 5", "keep_class 2 6", "drop_class 7", "drop_withheld"]
FILTER_COORDS_INTENSITY1 = "FILTER_COORDS_INTENSITY1"
FILTER_COORDS_INTENSITY2 = "FILTER_COORDS_INTENSITY2"
FILTER_COORDS_INTENSITY3 = "FILTER_COORDS_INTENSITY3"
FILTER_COORDS_INTENSITY1_ARG = "FILTER_COORDS_INTENSITY1_ARG"
FILTER_COORDS_INTENSITY2_ARG = "FILTER_COORDS_INTENSITY2_ARG"
FILTER_COORDS_INTENSITY3_ARG = "FILTER_COORDS_INTENSITY3_ARG"
FILTERS_COORDS_INTENSITY = ["---", "clip_x_above", "clip_x_below", "clip_y_above", "clip_y_below", "clip_z_above",
"clip_z_below", "drop_intensity_above", "drop_intensity_below", "drop_gps_time_above",
"drop_gps_time_below", "drop_scan_angle_above", "drop_scan_angle_below", "keep_point_source",
"drop_point_source", "drop_point_source_above", "drop_point_source_below", "keep_user_data",
"drop_user_data", "drop_user_data_above", "drop_user_data_below", "keep_every_nth",
FILTERS_COORDS_INTENSITY = ["---", "clip_x_above", "clip_x_below", "clip_y_above", "clip_y_below", "clip_z_above",
"clip_z_below", "drop_intensity_above", "drop_intensity_below", "drop_gps_time_above",
"drop_gps_time_below", "drop_scan_angle_above", "drop_scan_angle_below", "keep_point_source",
"drop_point_source", "drop_point_source_above", "drop_point_source_below", "keep_user_data",
"drop_user_data", "drop_user_data_above", "drop_user_data_below", "keep_every_nth",
"keep_random_fraction", "thin_with_grid" ]

TRANSFORM_COORDINATE1 = "TRANSFORM_COORDINATE1"
Expand All @@ -95,8 +95,8 @@ class LAStoolsAlgorithm(GeoAlgorithm):
TRANSFORM_OTHER2 = "TRANSFORM_OTHER2"
TRANSFORM_OTHER1_ARG = "TRANSFORM_OTHER1_ARG"
TRANSFORM_OTHER2_ARG = "TRANSFORM_OTHER2_ARG"
TRANSFORM_OTHERS = ["---", "scale_intensity", "translate_intensity", "clamp_intensity_above", "clamp_intensity_below",
"scale_scan_angle", "translate_scan_angle", "translate_gps_time", "set_classification", "set_user_data",
TRANSFORM_OTHERS = ["---", "scale_intensity", "translate_intensity", "clamp_intensity_above", "clamp_intensity_below",
"scale_scan_angle", "translate_scan_angle", "translate_gps_time", "set_classification", "set_user_data",
"set_point_source", "scale_rgb_up", "scale_rgb_down", "repair_zero_returns" ]

def getIcon(self):
Expand All @@ -122,7 +122,7 @@ def addParametersCoresCommands(self, commands):
cores = self.getParameterValue(LAStoolsAlgorithm.CORES)
if cores != 1:
commands.append("-cores")
commands.append(str(cores))
commands.append(str(cores))

def addParametersPointInputGUI(self):
self.addParameter(ParameterFile(LAStoolsAlgorithm.INPUT_LASLAZ, "input LAS/LAZ file"))
Expand All @@ -132,7 +132,7 @@ def addParametersPointInputCommands(self, commands):
if input != None:
commands.append("-i")
commands.append(input)

def addParametersPointInputFolderGUI(self):
self.addParameter(ParameterFile(LAStoolsAlgorithm.INPUT_DIRECTORY, "input directory", True))
self.addParameter(ParameterString(LAStoolsAlgorithm.INPUT_WILDCARDS, "input wildcard(s)", "*.laz"))
Expand Down Expand Up @@ -168,7 +168,7 @@ def addParametersHorizontalAndVerticalFeetGUI(self):
def addParametersHorizontalAndVerticalFeetCommands(self, commands):
self.addParametersHorizontalFeetCommands(commands)
self.addParametersVerticalFeetCommands(commands)

def addParametersFilesAreFlightlinesGUI(self):
self.addParameter(ParameterBoolean(LAStoolsAlgorithm.FILES_ARE_FLIGHTLINES, "files are flightlines", True))

Expand All @@ -183,11 +183,11 @@ def addParametersStepCommands(self, commands):
step = self.getParameterValue(LAStoolsAlgorithm.STEP)
if step != 0.0:
commands.append("-step")
commands.append(str(step))
commands.append(str(step))

def getParametersStepValue(self):
step = self.getParameterValue(LAStoolsAlgorithm.STEP)
return step
return step

def addParametersPointOutputGUI(self):
self.addOutput(OutputFile(LAStoolsAlgorithm.OUTPUT_LASLAZ, "output LAS/LAZ file", "laz"))
Expand Down Expand Up @@ -275,7 +275,7 @@ def addParametersAdditionalCommands(self, commands):
commands.append(option)

def addParametersFilter1ReturnClassFlagsGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS1, "filter (by return, classification, flags)",
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS1, "filter (by return, classification, flags)",
LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS, 0))

def addParametersFilter1ReturnClassFlagsCommands(self, commands):
Expand All @@ -284,7 +284,7 @@ def addParametersFilter1ReturnClassFlagsCommands(self, commands):
commands.append("-" + LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS[filter1])

def addParametersFilter2ReturnClassFlagsGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS2, "second filter (by return, classification, flags)",
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS2, "second filter (by return, classification, flags)",
LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS, 0))

def addParametersFilter2ReturnClassFlagsCommands(self, commands):
Expand All @@ -293,7 +293,7 @@ def addParametersFilter2ReturnClassFlagsCommands(self, commands):
commands.append("-" + LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS[filter2])

def addParametersFilter3ReturnClassFlagsGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS3, "third filter (by return, classification, flags)",
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_RETURN_CLASS_FLAGS3, "third filter (by return, classification, flags)",
LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS, 0))

def addParametersFilter3ReturnClassFlagsCommands(self, commands):
Expand All @@ -302,9 +302,9 @@ def addParametersFilter3ReturnClassFlagsCommands(self, commands):
commands.append("-" + LAStoolsAlgorithm.FILTERS_RETURN_CLASS_FLAGS[filter3])

def addParametersFilter1CoordsIntensityGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1, "filter (by coordinate, intensity, GPS time, ...)",
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1, "filter (by coordinate, intensity, GPS time, ...)",
LAStoolsAlgorithm.FILTERS_COORDS_INTENSITY, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1_ARG, "value for filter (by coordinate, intensity, GPS time, ...)"))
self.addParameter(ParameterString(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1_ARG, "value for filter (by coordinate, intensity, GPS time, ...)"))

def addParametersFilter1CoordsIntensityCommands(self, commands):
filter1 = self.getParameterValue(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY1)
Expand All @@ -315,7 +315,7 @@ def addParametersFilter1CoordsIntensityCommands(self, commands):

def addParametersFilter2CoordsIntensityGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY2, "second filter (by coordinate, intensity, GPS time, ...)", LAStoolsAlgorithm.FILTERS_COORDS_INTENSITY, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY2_ARG, "value for second filter (by coordinate, intensity, GPS time, ...)"))
self.addParameter(ParameterString(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY2_ARG, "value for second filter (by coordinate, intensity, GPS time, ...)"))

def addParametersFilter2CoordsIntensityCommands(self, commands):
filter2 = self.getParameterValue(LAStoolsAlgorithm.FILTER_COORDS_INTENSITY2)
Expand All @@ -325,10 +325,10 @@ def addParametersFilter2CoordsIntensityCommands(self, commands):
commands.append(filter2_arg)

def addParametersTransform1CoordinateGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_COORDINATE1,
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_COORDINATE1,
"transform (coordinates)", LAStoolsAlgorithm.TRANSFORM_COORDINATES, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_COORDINATE1_ARG,
"value for transform (coordinates)"))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_COORDINATE1_ARG,
"value for transform (coordinates)"))

def addParametersTransform1CoordinateCommands(self, commands):
transform1 = self.getParameterValue(LAStoolsAlgorithm.TRANSFORM_COORDINATE1)
Expand All @@ -338,10 +338,10 @@ def addParametersTransform1CoordinateCommands(self, commands):
commands.append(transform1_arg)

def addParametersTransform2CoordinateGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_COORDINATE2,
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_COORDINATE2,
"second transform (coordinates)", LAStoolsAlgorithm.TRANSFORM_COORDINATES, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_COORDINATE2_ARG,
"value for second transform (coordinates)"))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_COORDINATE2_ARG,
"value for second transform (coordinates)"))

def addParametersTransform2CoordinateCommands(self, commands):
transform2 = self.getParameterValue(LAStoolsAlgorithm.TRANSFORM_COORDINATE2)
Expand All @@ -351,10 +351,10 @@ def addParametersTransform2CoordinateCommands(self, commands):
commands.append(transform2_arg)

def addParametersTransform1OtherGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_OTHER1,
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_OTHER1,
"transform (intensities, scan angles, GPS times, ...)", LAStoolsAlgorithm.TRANSFORM_OTHERS, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_OTHER1_ARG,
"value for transform (intensities, scan angles, GPS times, ...)"))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_OTHER1_ARG,
"value for transform (intensities, scan angles, GPS times, ...)"))

def addParametersTransform1OtherCommands(self, commands):
transform1 = self.getParameterValue(LAStoolsAlgorithm.TRANSFORM_OTHER1)
Expand All @@ -365,10 +365,10 @@ def addParametersTransform1OtherCommands(self, commands):
commands.append(transform1_arg)

def addParametersTransform2OtherGUI(self):
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_OTHER2,
self.addParameter(ParameterSelection(LAStoolsAlgorithm.TRANSFORM_OTHER2,
"second transform (intensities, scan angles, GPS times, ...)", LAStoolsAlgorithm.TRANSFORM_OTHERS, 0))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_OTHER2_ARG,
"value for second transform (intensities, scan angles, GPS times, ...)"))
self.addParameter(ParameterString(LAStoolsAlgorithm.TRANSFORM_OTHER2_ARG,
"value for second transform (intensities, scan angles, GPS times, ...)"))

def addParametersTransform2OtherCommands(self, commands):
transform2 = self.getParameterValue(LAStoolsAlgorithm.TRANSFORM_OTHER2)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/lidar/lastools/blast2iso.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def defineCharacteristics(self):
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "blast2iso.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersPointInputCommands(commands)
smooth = self.getParameterValue(blast2iso.SMOOTH)
if smooth != 0:
commands.append("-smooth")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def processAlgorithm(self, progress):
commands.append("h")
commands.append("-olaz")
self.addParametersCoresCommands(commands)

LAStoolsUtils.runLAStools(commands, progress)

# then we thin and splat the tiles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def processAlgorithm(self, progress):
commands.append("_g")
commands.append("-olaz")
self.addParametersCoresCommands(commands)

LAStoolsUtils.runLAStools(commands, progress)

# then we height-normalize the tiles
Expand All @@ -110,7 +110,7 @@ def processAlgorithm(self, progress):
commands.append("h")
commands.append("-olaz")
self.addParametersCoresCommands(commands)

LAStoolsUtils.runLAStools(commands, progress)

# then we thin and splat the tiles
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/lidar/lastools/las2iso.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def defineCharacteristics(self):
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2iso.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersPointInputCommands(commands)
smooth = self.getParameterValue(las2iso.SMOOTH)
if smooth != 0:
commands.append("-smooth")
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/processing/algs/lidar/lastools/las2las.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class las2las(LAStoolsAlgorithm):
STEP = "STEP"
OPERATION = "OPERATION"
OPERATIONS = ["---", "set_point_type", "set_point_size", "set_version_minor", "set_version_major",
"start_at_point", "stop_at_point", "remove_vlr", "auto_reoffset", "week_to_adjusted",
"adjusted_to_week", "scale_rgb_up", "scale_rgb_down", "remove_all_vlrs", "remove_extra",
"start_at_point", "stop_at_point", "remove_vlr", "auto_reoffset", "week_to_adjusted",
"adjusted_to_week", "scale_rgb_up", "scale_rgb_down", "remove_all_vlrs", "remove_extra",
"clip_to_bounding_box"]
OPERATIONARG = "OPERATIONARG"

Expand All @@ -63,7 +63,7 @@ def processAlgorithm(self, progress):
commands.append("-" + OPERATIONS[operation])
if operation > 7:
commands.append(self.getParameterValue(las2las.OPERATIONARG))

self.addParametersPointOutputCommands(commands)

LAStoolsUtils.runLAStools(commands, progress)
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def processAlgorithm(self, progress):
self.addParametersFilter2ReturnClassFlagsCommands(commands)
self.addParametersFilter1CoordsIntensityCommands(commands)
self.addParametersFilter2CoordsIntensityCommands(commands)

self.addParametersPointOutputCommands(commands)

LAStoolsUtils.runLAStools(commands, progress)
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def processAlgorithm(self, progress):
commands.append("-" + las2las_transform.OPERATIONS[operation])
if operation > 7:
commands.append(self.getParameterValue(las2las_transform.OPERATIONARG))

self.addParametersPointOutputCommands(commands)

LAStoolsUtils.runLAStools(commands, progress)
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/lidar/lastools/las2tin.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def defineCharacteristics(self):
def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "las2tin.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersFilter1ReturnClassFlagsCommands(commands)
self.addParametersVectorOutputCommands(commands)

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/lidar/lastools/lascanopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class lascanopy(LAStoolsAlgorithm):
PRODUCT7 = "PRODUCT7"
PRODUCT8 = "PRODUCT8"
PRODUCT9 = "PRODUCT9"
PRODUCTS = ["---", "min", "max", "avg", "std", "ske", "kur", "cov", "dns",
PRODUCTS = ["---", "min", "max", "avg", "std", "ske", "kur", "cov", "dns",
"p01", "p05", "p10", "p25", "p50", "p75", "p90", "p99"]
COUNTS = "COUNTS"
DENSITIES = "DENSITIES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def processAlgorithm(self, progress):
commands = [os.path.join(LAStoolsUtils.LAStoolsPath(), "bin", "lasclassify.exe")]
self.addParametersVerboseCommands(commands)
self.addParametersPointInputCommands(commands)
self.addParametersHorizontalAndVerticalFeetCommands(commands)
self.addParametersHorizontalAndVerticalFeetCommands(commands)
self.addParametersPointOutputCommands(commands)

LAStoolsUtils.runLAStools(commands, progress)

0 comments on commit 5b2824f

Please sign in to comment.