<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="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">
Thanks for your response.</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">
You are right about returning null. Will consider your proposal.</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">
<br>
</div>
<hr tabindex="-1" style="width: 98%; display: inline-block;">
<div id="divRplyFwdMsg" dir="ltr"><font color="#000000" face="Calibri, sans-serif" style="font-size: 11pt;"><b>Fra:</b> Éric Lemoine <eric.lemoine@oslandia.com><br>
<b>Sendt:</b> tirsdag 12. juni 2018 16.52<br>
<b>Til:</b> Lars; pgpointcloud@lists.osgeo.org<br>
<b>Emne:</b> Re: [pgpointcloud] PC_NumPoints</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size: 11pt;">
<div class="PlainText">On Tue, 2018-06-12 at 09:08 +0000, Lars wrote:<br>
> Hello list,<br>
> <br>
> The query (below) produces count equal 1  as expected.<br>
> select pc_numpoints(pc_filterbetween(pa, 'x', 100.4140, 100.4151)) as<br>
> count from testdata;<br>
> <br>
> Tweaking the query slightly and the query produces count equal " "<br>
> (no number displayed). The expected count is 0.<br>
> select pc_numpoints(pc_filterbetween(pa, 'x', 100.4140, 100.4150)) as<br>
> count from testdata;<br>
> <br>
> It looks like a bug that pc_numpoints is able to return a non-integer <br>
> value.<br>
<br>
I am not sure. In this case pc_filterbetween doesn't return an empty<br>
patch. It returns a NULL value instead. That is why pc_numpoints<br>
returns a NULL value.<br>
<br>
You can always use coalesce to change NULL to something else:<br>
<br>
select coalesce(pc_numpoints(pc_filterbetween(pa, 'x', 100.4140,<br>
100.4150)), 0) as count from testdata;<br>
<br>
> <br>
> This issue also applies to PC_PatchXXX functions that also return " "<br>
> (no number) in the case the input is empty. Not sure what the correct<br>
> return value should be in these cases.<br>
> <br>
> Just a minor thing, it would be nice if the documentation for<br>
> PC_FilterBetween made it clear that between means greater than value1<br>
> and less than values2. I made the mistake of thinking it was greater<br>
> than or equal to value1 and less than or equal to value2.<br>
<br>
Agree, I'll amend the doc for that.<br>
<br>
<br>
-- <br>
Éric Lemoine<br>
Oslandia<br>
+33 1 86 95 95 55</div>
</span></font></div>
</body>
</html>