Beispiel #1
0
 def initializeSettings(self):
     AlgorithmProvider.initializeSettings(self)
     ProcessingConfig.addSetting(
         Setting(self.getDescription(), LAStoolsUtils.LASTOOLS_FOLDER,
                 'LAStools folder', LAStoolsUtils.LAStoolsPath()))
     ProcessingConfig.addSetting(
         Setting(self.getDescription(), FusionUtils.FUSION_FOLDER,
                 'Fusion folder', FusionUtils.FusionPath()))
 def initializeSettings(self):
     AlgorithmProvider.initializeSettings(self)
     ProcessingConfig.addSetting(Setting(
         self.getDescription(),
         LAStoolsUtils.LASTOOLS_FOLDER,
         self.tr('LAStools folder'), LAStoolsUtils.LAStoolsPath(),
         valuetype=Setting.FOLDER))
     ProcessingConfig.addSetting(Setting(
         self.getDescription(),
         FusionUtils.FUSION_FOLDER,
         self.tr('Fusion folder'), FusionUtils.FusionPath(),
         valuetype=Setting.FOLDER))
     ProcessingConfig.addSetting(Setting(
         self.getDescription(),
         LAStoolsUtils.WINE_FOLDER,
         self.tr('Wine folder'), '', valuetype=Setting.FOLDER))
    def __init__(self):
        AlgorithmProvider.__init__(self)
        self.activate = False
        self.algsList = []

        # LAStools for processing single files

        if (isWindows() or LAStoolsUtils.hasWine()):
            lastools = [
                lasground(), lasheight(), lasclassify(), lasclip(), lastile(),
                lascolor(), lasgrid(), las2dem(), blast2dem(), las2iso(), blast2iso(),
                lasview(), lasboundary(), lasinfo(), lasprecision(), las2tin(),
                lasvalidate(), lasduplicate(), las2txt(), txt2las(), laszip(),
                lasindex(), lasthin(), lassort(), lascanopy(), lasmerge(),
                las2shp(), shp2las(), lasnoise(), lassplit(), las2las_filter(),
                las2las_project(), las2las_transform(), lasoverage(), lasoverlap(),
                lasquery()
            ]
        else:
            lastools = [
                lasinfo(), lasprecision(), lasvalidate(), las2txt(), txt2las(),
                laszip(), lasindex(), lasmerge(), las2las_filter(), las2las_project(),
                las2las_transform(), lasquery()
            ]
        for alg in lastools:
            alg.group = 'LAStools'
        self.algsList.extend(lastools)

        # LAStools Production for processing folders of files

        if (isWindows() or LAStoolsUtils.hasWine()):
            lastoolsPro = [
                lastilePro(), lasgroundPro(), las2demPro(), lasheightPro(), laszipPro(),
                lasduplicatePro(), lasgridPro(), lassortPro(), lasclassifyPro(), lasthinPro(),
                lasnoisePro(), lasindexPro(), lascanopyPro(), blast2demPro(), lasboundaryPro(),
                lasinfoPro(), las2lasPro_filter(), las2lasPro_project(), las2lasPro_transform(),
                lasoveragePro(), txt2lasPro(), las2txtPro(), blast2isoPro(), lasvalidatePro(),
                lasmergePro(), lasviewPro(), lasoverlapPro()
            ]
        else:
            lastoolsPro = [
                laszipPro(), lasindexPro(), lasinfoPro(), las2lasPro_filter(), las2lasPro_project(),
                las2lasPro_transform(), txt2lasPro(), las2txtPro(), lasvalidatePro(), lasmergePro()
            ]
        for alg in lastoolsPro:
            alg.group = 'LAStools Production'
        self.algsList.extend(lastoolsPro)

        # some examples for LAStools Pipelines

        if (isWindows() or LAStoolsUtils.hasWine()):
            lastoolsPipe = [
                flightlinesToDTMandDSM(), flightlinesToCHM(), flightlinesToSingleCHMpitFree(), hugeFileClassify(),
                hugeFileGroundClassify(), hugeFileNormalize()
            ]
        else:
            lastoolsPipe = []
        for alg in lastoolsPipe:
            alg.group = 'LAStools Pipelines'
        self.algsList.extend(lastoolsPipe)

        # FUSION

        if isWindows():
            self.actions.append(OpenViewerAction())
            fusiontools = [
                Catalog(), CloudMetrics(), CanopyMaxima(), CanopyModel(), ClipData(),
                Csv2Grid(), Cover(), FilterData(), GridMetrics(), GroundFilter(),
                GridSurfaceCreate(), MergeData(), TinSurfaceCreate(), PolyClipData(),
				DTM2TIF(), FirstLastReturn(), ASCII2DTM(), DTM2ASCII()
            ]
            for alg in fusiontools:
                alg.group = 'Fusion'
            self.algsList.extend(fusiontools)
    def _loadAlgorithms(self):
        self.algs = []

        # LAStools for processing single files

        if (isWindows() or LAStoolsUtils.hasWine()):
            lastools = [
                lasground(),
                lasheight(),
                lasclassify(),
                lasclip(),
                lastile(),
                lascolor(),
                lasgrid(),
                las2dem(),
                blast2dem(),
                las2iso(),
                blast2iso(),
                lasview(),
                lasboundary(),
                lasinfo(),
                lasprecision(),
                las2tin(),
                lasvalidate(),
                lasduplicate(),
                las2txt(),
                txt2las(),
                laszip(),
                lasindex(),
                lasthin(),
                lassort(),
                lascanopy(),
                lasmerge(),
                las2shp(),
                shp2las(),
                lasnoise(),
                lassplit(),
                las2las_filter(),
                las2las_project(),
                las2las_transform(),
                lasoverage(),
                lasoverlap(),
                lasquery()
            ]
        else:
            lastools = [
                lasinfo(),
                lasprecision(),
                lasvalidate(),
                las2txt(),
                txt2las(),
                laszip(),
                lasindex(),
                lasmerge(),
                las2las_filter(),
                las2las_project(),
                las2las_transform(),
                lasquery()
            ]
        self.algs.extend(lastools)

        # LAStools Production for processing folders of files

        if (isWindows() or LAStoolsUtils.hasWine()):
            lastoolsPro = [
                lastilePro(),
                lasgroundPro(),
                las2demPro(),
                lasheightPro(),
                laszipPro(),
                lasduplicatePro(),
                lasgridPro(),
                lassortPro(),
                lasclassifyPro(),
                lasthinPro(),
                lasnoisePro(),
                lasindexPro(),
                lascanopyPro(),
                blast2demPro(),
                lasboundaryPro(),
                lasinfoPro(),
                las2lasPro_filter(),
                las2lasPro_project(),
                las2lasPro_transform(),
                lasoveragePro(),
                txt2lasPro(),
                las2txtPro(),
                blast2isoPro(),
                lasvalidatePro(),
                lasmergePro(),
                lasviewPro(),
                lasoverlapPro()
            ]
        else:
            lastoolsPro = [
                laszipPro(),
                lasindexPro(),
                lasinfoPro(),
                las2lasPro_filter(),
                las2lasPro_project(),
                las2lasPro_transform(),
                txt2lasPro(),
                las2txtPro(),
                lasvalidatePro(),
                lasmergePro()
            ]
        self.algs.extend(lastoolsPro)

        # some examples for LAStools Pipelines

        if (isWindows() or LAStoolsUtils.hasWine()):
            lastoolsPipe = [
                flightlinesToDTMandDSM(),
                flightlinesToCHM(),
                flightlinesToSingleCHMpitFree(),
                hugeFileClassify(),
                hugeFileGroundClassify(),
                hugeFileNormalize()
            ]
        else:
            lastoolsPipe = []
        self.algs.extend(lastoolsPipe)

        # FUSION

        if isWindows():
            self.actions.append(OpenViewerAction())
            fusiontools = [
                Catalog(),
                CloudMetrics(),
                CanopyMaxima(),
                CanopyModel(),
                ClipData(),
                Csv2Grid(),
                Cover(),
                FilterData(),
                GridMetrics(),
                GroundFilter(),
                GridSurfaceCreate(),
                MergeData(),
                TinSurfaceCreate(),
                PolyClipData(),
                DTM2TIF(),
                DTM2ASCII(),
                FirstLastReturn(),
                ASCII2DTM()
            ]
            for alg in fusiontools:
                alg.group, alg.i18n_group = alg.trAlgorithm('Fusion')
            self.algs.extend(fusiontools)