<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 12pt;">
Eric,</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 12pt;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 12pt;">
Your suggestion was very helpful (as always). </div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 12pt;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 12pt;">
Much Appreciated <span>😊</span></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 12pt;">
<span><br>
</span></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size: 12pt;">
<span><br>
</span></div>
<hr tabindex="-1" style="display:inline-block;width:98%">
<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> 15. mai 2018 10:57<br>
<b>Til:</b> Lars; pgpointcloud@lists.osgeo.org<br>
<b>Emne:</b> Re: [pgpointcloud] Combine PC_Patch and PC_MakePoint</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On Tue, 2018-05-15 at 07:34 +0000, Lars wrote:<br>
> The pointcloud webpage shows how to insert data into a points table<br>
> and how to insert data from a points table into a patch table.<br>
> <br>
> How can I create a patch and insert it into a patch table without<br>
> using a points table?<br>
> <br>
> The below query produces the error message "function pc_patch(record)<br>
> does not exist".<br>
> <br>
> insert into dummy(pa) select PC_Patch(bar) from (select<br>
> PC_MakePoint(1, ARRAY[x,y,z] from (select val as x, val as y, val as<br>
> z from generate_series(1,10,1) as val) as foo) as bar;<br>
<br>
<br>
Not sure what you want to do exactly but here's a query that works:<br>
<br>
select pc_patch(pt) from (select pc_makepoint(1, array[v, v, v, 1]) pt<br>
from generate_series(1, 10) v) t;<br>
<br>
Which can also be written as:<br>
<br>
select pc_patch(pt) from generate_series(1, 10) v, pc_makepoint(1,<br>
array[v, v, v, 1]) pt;<br>
<br>
Now adding the insertion part:<br>
<br>
insert into dummy(pa) select pc_patch(pt) pa from generate_series(1,<br>
10) v, pc_makepoint(1, array[v, v, v, 1]) pt;<br>
<br>
Note that this will create (and insert) just one patch.<br>
<br>
Here's a new query that creates patches of 5 points:<br>
<br>
select pc_patch(pt) from (select pt, (row_number() over ()) - 1 num<br>
from generate_series(1, 10) v, pc_makepoint(1, array[v, v, v, 1]) pt) t<br>
group by num / 5;<br>
<br>
<br>
Hope this helps.<br>
<br>
-- <br>
Éric Lemoine<br>
Oslandia<br>
</div>
</span></font></div>
</body>
</html>