<div dir="ltr">Hi All,<div><br></div><div>I am in the process of testing a process I created using PyWPS 4.  I have found an odd issue with the LiteralInputs for my process.  So for example, my process takes an input parameter (stats) where I have a max_occurs=9 which should allow for any number of strings detailing the statistics I would like calculated for a given input file. When I issue a request with a number of values ('sum', 'median', 'std') for that particular parameter, my response contains the result for only 1 of the statistics for that parameter.  I traced the issue to service.py (create_literal_inputs), line 216 where a deque is created using the LiteralInput's max_occurs parameter to limit the size.  Unfortunately, it appears that this attribute is always 1.  When I do a describeProcess request, I notice that the max_occurs is also equal to 1 and this happens regardless of whatever value I change the max_occurs to on that or any other LiteralInputs for my process.  So my question is, has anyone come across this issue?  Am I doing something wrong?  Below is the code showing how I have defined the inputs.</div><div><br></div><div><pre style="color:rgb(0,0,0);font-family:"DejaVu Sans Mono";font-size:9pt"><span style="color:rgb(0,0,128);font-weight:bold">class </span>BasicZonalStats(Process):<br>    <span style="color:rgb(0,0,128);font-weight:bold">def </span><span style="color:rgb(178,0,178)">__init__</span>(<span style="color:rgb(148,85,141)">self</span>):<br>        inputs = [ComplexInput(<span style="color:rgb(0,128,128);font-weight:bold">'aoi_ndvi'</span>,<span style="color:rgb(0,128,128);font-weight:bold">'Raster ndvi'</span>,<br>                               <span style="color:rgb(102,0,153)">supported_formats</span>=[Format(<span style="color:rgb(0,128,128);font-weight:bold">'image/tiff'</span>), Format(<span style="color:rgb(0,128,128);font-weight:bold">'application/x-ogc-wcs'</span>)],<br>                               <span style="color:rgb(102,0,153)">min_occurs</span>=<span style="color:rgb(0,0,255)">1</span>, <span style="color:rgb(102,0,153)">max_occurs</span>=<span style="color:rgb(0,0,255)">1</span>, <span style="color:rgb(102,0,153)">mode</span>=MODE.NONE),<br>                  LiteralInput(<span style="color:rgb(0,128,128);font-weight:bold">'band'</span>,<span style="color:rgb(0,128,128);font-weight:bold">'the band to calculate stats for'</span>, <span style="color:rgb(102,0,153)">data_type</span>=<span style="color:rgb(0,128,128);font-weight:bold">'integer'</span>, <span style="color:rgb(102,0,153)">min_occurs</span>=<span style="color:rgb(0,0,255)">1</span>, <span style="color:rgb(102,0,153)">max_occurs</span>=<span style="color:rgb(0,0,255)">1</span>,<br>                               <span style="color:rgb(102,0,153)">mode</span>=MODE.SIMPLE),<br>                  LiteralInput(<span style="color:rgb(0,128,128);font-weight:bold">'stats'</span>, <span style="color:rgb(0,128,128);font-weight:bold">'Statistics to calculate'</span>, <span style="color:rgb(102,0,153)">data_type</span>=<span style="color:rgb(0,128,128);font-weight:bold">'string'</span>, <span style="color:rgb(102,0,153)">min_occurs</span>=<span style="color:rgb(0,0,255)">0</span>, <span style="color:rgb(102,0,153)">max_occurs</span>=<span style="color:rgb(0,0,255)">9</span>,<br>                               <span style="color:rgb(102,0,153)">allowed_values</span>=(<span style="color:rgb(0,128,128);font-weight:bold">'sum'</span>, <span style="color:rgb(0,128,128);font-weight:bold">'std'</span>, <span style="color:rgb(0,128,128);font-weight:bold">'median'</span>, <span style="color:rgb(0,128,128);font-weight:bold">'majority'</span>, <span style="color:rgb(0,128,128);font-weight:bold">'minority'</span>, <span style="color:rgb(0,128,128);font-weight:bold">'unique'</span>, <span style="color:rgb(0,128,128);font-weight:bold">'range'</span>,<br>                                               <span style="color:rgb(0,128,128);font-weight:bold">'nodata'</span>, <span style="color:rgb(0,128,128);font-weight:bold">'nan'</span>), <span style="color:rgb(102,0,153)">mode</span>=MODE.SIMPLE),<br>                  LiteralInput(<span style="color:rgb(0,128,128);font-weight:bold">'nodata'</span>,<span style="color:rgb(0,128,128);font-weight:bold">'Nodata value'</span>, <span style="color:rgb(102,0,153)">data_type</span>=<span style="color:rgb(0,128,128);font-weight:bold">'integer'</span>,<span style="color:rgb(102,0,153)">mode</span>=MODE.SIMPLE),<br>                  ComplexInput(<span style="color:rgb(0,128,128);font-weight:bold">'zones'</span>, <span style="color:rgb(0,128,128);font-weight:bold">'Vector polygons to calculate stats on.'</span>,<br>                               <span style="color:rgb(102,0,153)">supported_formats</span>=[Format(<span style="color:rgb(0,128,128);font-weight:bold">'application/json'</span>)],<br>                               <span style="color:rgb(102,0,153)">min_occurs</span>=<span style="color:rgb(0,0,255)">1</span>, <span style="color:rgb(102,0,153)">max_occurs</span>=<span style="color:rgb(0,0,255)">1</span>, <span style="color:rgb(102,0,153)">mode</span>=MODE.NONE)<br><br>                  ]<br>        outputs = [ComplexOutput(<span style="color:rgb(0,128,128);font-weight:bold">'zonal_stats'</span>, <span style="color:rgb(0,128,128);font-weight:bold">'Attribute Table'</span>,<br>                                 <span style="color:rgb(102,0,153)">supported_formats</span>=[Format(<span style="color:rgb(0,128,128);font-weight:bold">'application/json'</span>)],<br>                                 )]<br><br>        <span style="color:rgb(0,0,128)">super</span>(BasicZonalStats, <span style="color:rgb(148,85,141)">self</span>).<span style="color:rgb(178,0,178)">__init__</span>(<br>            <span style="color:rgb(148,85,141)">self</span>._handler,<br>            <span style="color:rgb(102,0,153)">identifier</span>=<span style="color:rgb(0,128,128);font-weight:bold">'zonal'</span>,<br>            <span style="color:rgb(102,0,153)">version</span>=<span style="color:rgb(0,128,128);font-weight:bold">'0.1'</span>,<br>            <span style="color:rgb(102,0,153)">title</span>=<span style="color:rgb(0,128,128);font-weight:bold">"Basic Zonal Statistics using Rasterstats"</span>,<br>            <span style="color:rgb(102,0,153)">abstract</span>=<span style="color:rgb(0,128,128);font-weight:bold">"This is a naive and basic WPS, it assumes that both vector and raster inputs are in the same"<br></span><span style="color:rgb(0,128,128);font-weight:bold">                     "projection and as such does not do any error checking.  This will be fixed at a later stage so f"<br></span><span style="color:rgb(0,128,128);font-weight:bold">                     "or now please ensure that the inputs are in the same projection."</span>,<br>            <span style="color:rgb(102,0,153)">profile</span>=<span style="color:rgb(0,128,128);font-weight:bold">''</span>,<br>            <span style="color:rgb(102,0,153)">inputs</span>=inputs,<br>            <span style="color:rgb(102,0,153)">outputs</span>=outputs,<br>            <span style="color:rgb(102,0,153)">store_supported</span>=<span style="color:rgb(0,0,128);font-weight:bold">True</span>,<br>            <span style="color:rgb(102,0,153)">status_supported</span>=<span style="color:rgb(0,0,128);font-weight:bold">True<br></span><span style="color:rgb(0,0,128);font-weight:bold">        </span>)<br></pre><div>Any help with this would be much appreciated. </div><div>Thanks,</div><div>Suzana</div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><p style="font:7.5pt/normal arial,sans-serif;color:gray;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;font-size-adjust:none;font-stretch:normal;background-color:rgb(255,255,255)"><b>Dr Suzana Barreto<br>Software Analyst<br>Environment Systems</b><br>Tel: <a style="color:rgb(17,85,204)" href="tel:%2B44%20%280%29%201970%20626688" value="+441970626688" target="_blank">+44 (0) 1970 626688</a><br><a style="color:rgb(17,85,204)" href="http://www.envsys.co.uk/" target="_blank">www.envsys.co.uk</a></p><p style="font:7.5pt/normal arial,sans-serif;color:gray;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;font-size-adjust:none;font-stretch:normal;background-color:rgb(255,255,255)">The information contained in this e-mail is intended only for the use of the person(s) to whom it is addressed and may contain confidential or privileged information. If you have received this e-mail in error please contact the sender and delete the material without copying, distributing or disclosing the content. All reasonable precautions have been taken to ensure that this e-mail is free from any virus, however, the recipient should verify this to be the case. Please 'think before you print'</p></div></div></div></div></div></div>