-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMergeLidarLas.py
More file actions
59 lines (52 loc) · 1.83 KB
/
MergeLidarLas.py
File metadata and controls
59 lines (52 loc) · 1.83 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
__version__ = "2.0"
from meshroom.core import desc
from meshroom.core.utils import VERBOSE_LEVEL
import os
from pathlib import Path
class MergeLidarLas(desc.CommandLineNode):
# On Windows, needs to avoid backslash for command line execution (as_posix needed)
currentFilePath = Path(__file__).absolute()
currentFileFolderPath = currentFilePath.parent
# Resolve venv Python if present, then MESHROOM_GEOLOC_PYTHON, then bare 'python'
_plugin_dir = (currentFileFolderPath / "../..").resolve()
_venv_python = next(
(p for p in [_plugin_dir / ".venv/Scripts/python.exe", _plugin_dir / ".venv/bin/python"] if p.exists()),
None
)
pythonPath = Path(os.environ.get("MESHROOM_GEOLOC_PYTHON", str(_venv_python) if _venv_python else "python"))
targetScriptPath = (currentFileFolderPath / "../../scripts/mergeLidarLas.py").resolve()
commandLine = pythonPath.as_posix() + ' -E ' + targetScriptPath.as_posix() + ' {allParams}'
category = 'Geolocation'
documentation = '''
This node allows to merge LAS files.
'''
inputs = [
desc.File(
name='folder',
label='Folder',
description='''Folder''',
value= "",
),
desc.File(
name='GPSFile',
label='GPS File',
description='''GPS file''',
value= "",
),
desc.ChoiceParam(
name='verboseLevel',
label='Verbose Level',
description='''verbosity level (critical, error, warning, info, debug).''',
value='info',
values=VERBOSE_LEVEL,
exclusive=True,
),
]
outputs = [
desc.File(
name='outputFolder',
label='Output Folder',
description='''Output folder.''',
value='{nodeCacheFolder}',
),
]