<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"Preformattato HTML Carattere";
        margin:0cm;
        font-size:10.0pt;
        font-family:"Courier New";}
span.PreformattatoHTMLCarattere
        {mso-style-name:"Preformattato HTML Carattere";
        mso-style-priority:99;
        mso-style-link:"Preformattato HTML";
        font-family:"Courier New";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="IT">
<div class="WordSection1">
<p class="MsoNormal">Hi Devs,</p>
<p class="MsoNormal">I’m contributing to the FUSION/LDV plugin and I have a couple of newbie questions related to the I/O parameters in Python.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">1. SELECT MULTIPLE INPUTS</p>
<p class="MsoNormal">I’m not a Pythonist (I can read it and only make copy-paste-wise modifications). Unfortunately, there's one thing I don't understand of the logic related to the input of multiple files: there should be the way to create a
<em><span style="font-family:"Calibri",sans-serif">.txt</span></em> file with a list in case more than one is selected...but I haven't been able to make it work. You can find an example in
<em><span style="font-family:"Calibri",sans-serif">xyz2dtm</span></em> :</p>
<pre><code><o:p> </o:p></code></pre>
<pre><code>self.addParameter(QgsProcessingParameterMultipleLayers(self.INPUT,<o:p></o:p></code></pre>
<pre><code>                                                       self.tr('XYZ files'),<o:p></o:p></code></pre>
<pre><code>                                                       QgsProcessing.TypeFile))<o:p></o:p></code></pre>
<p>and then calling:</p>
<pre><code>fileList = fusionUtils.layersToFile('xyzDataFiles.txt', self, parameters, self.INPUT, context)<o:p></o:p></code></pre>
<pre><code><o:p> </o:p></code></pre>
<pre><code>arguments.append(fileList)<o:p></o:p></code></pre>
<p><o:p> </o:p></p>
<p>When trying this with other files (.las, .laz), the txt file is created but it remains empty. This could be quite a big thing for users instead of working on mega files or file-by-file, but I have no idea ho to deal with it.</p>
<p><o:p> </o:p></p>
<p class="MsoNormal">2. GENERAL OUTPUT NAME WITHOUT EXTENSION<o:p></o:p></p>
<p class="MsoNormal">There are some tools (e.g. TreeSeg) that require just a general “file name” that will be applied to many different outputs.<br>
If I set just a simple name (e.g. "test_output") it doesn’t run the algo and returns an error such as “invalid name”.<o:p></o:p></p>
<p class="MsoNormal">In order to “fix” this, the user has to enter any kind of extension (i.e. "test_output.csv" and FUSION will strip it out using the basename for all the exports it provides.<br>
<br>
<br>
Any suggestion or best practice about dealing with such cases?<br>
<br>
Thanks in advance as usual,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Nic<o:p></o:p></p>
</div>
</body>
</html>