<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Hello,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0 ContentPasted2">
I am one of the maintainers of the Plugin <span style="background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted1">
(FUSION for Processing) </span>that makes is possible to use FUSION LVD LIDAR analysis and visualization software in QGIS on Windows computers. I am experiencing a very strange issue that I do not understand. It appears using PolyClipData64.exe via a the subprocess
 Python library.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0 ContentPasted2">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0 ContentPasted2">
With the test data I use I can run the tool via a command prompt using the command below: </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0 ContentPasted2">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0 ContentPasted2">
<b class="ContentPasted3" style="font-family: inherit; font-size: 12pt; font-style: inherit; font-variant-ligatures: inherit; font-variant-caps: inherit;">"C:/FUSION\PolyClipData64.exe" /class:1 "D:\LidarQGISFUSION\FastighetskartanVektor_1501_3006\by_get.shp"
 "D:/LidarQGISFUSION/tempfromscript/test.las" "D:\LidarQGISFUSION\tempfromscript\clippedLidar.las"</b><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0 ContentPasted2">
<div style="font-size:12pt;margin:0px;color:black;background-color:rgb(255, 255, 255)">
<br class="ContentPasted3">
</div>
<div style="font-size:12pt;margin:0px;color:black;background-color:rgb(255, 255, 255)">
Then I make use of the function Popen in subprocess in the Python console in QGIS without error:</div>
<div style="font-size:12pt;margin:0px;color:black;background-color:rgb(255, 255, 255)" class="ContentPasted4">
<b>fused_command = '"C:/FUSION\PolyClipData64.exe" "/class:1" "D:/LidarQGISFUSION/FastighetskartanVektor_1501_3006/by_get.shp" "D:/LidarQGISFUSION/tempfromscript/test11.las" "D:/LidarQGISFUSION/tempfromscript/clippedLidar.las"'<br class="ContentPasted4">
<br>
</b></div>
<div style="font-size:12pt;margin:0px;color:black;background-color:rgb(255, 255, 255)" class="ContentPasted4">
<b>subprocess.Popen(fused_command,shell=True,stdout=subprocess.PIPE, stdin=subprocess.DEVNULL,stderr=subprocess.STDOUT,universal_newlines=True)</b><br>
</div>
<div style="font-size:12pt;margin:0px;color:black;background-color:rgb(255, 255, 255)">
<br>
</div>
<div style="font-size:12pt;margin:0px;color:black;background-color:rgb(255, 255, 255)" class="ContentPasted3">
<span style="color: black; font-size: 12pt;">But when I use the same code snippet in my processing plugin it fails.</span><br>
</div>
<div style="font-size:12pt;margin:0px;color:black;background-color:rgb(255, 255, 255)" class="ContentPasted3">
<span style="color: black; font-size: 12pt;"><br>
</span></div>
<div style="font-size:12pt;margin:0px;color:black;background-color:rgb(255, 255, 255)" class="ContentPasted3">
Does anyone have an idea what might be going on here?</div>
<div style="font-size:12pt;margin:0px;color:black;background-color:rgb(255, 255, 255)" class="ContentPasted3">
<br>
</div>
<div style="font-size:12pt;margin:0px;color:black;background-color:rgb(255, 255, 255)" class="ContentPasted3">
Any suggestion highly appreciated!</div>
<div style="font-size:12pt;margin:0px;color:black;background-color:rgb(255, 255, 255)" class="ContentPasted3">
<br>
</div>
<div style="font-size:12pt;margin:0px;color:black;background-color:rgb(255, 255, 255)" class="ContentPasted3">
/Fredrik</div>
</div>
</body>
</html>