<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 id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top: 0px; margin-bottom: 0px;">Thanks for the feedback.</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p>You are correct, PDAL does handle creation of table and inserting schema into correct table when pcid parameter is not specified in pipeline file.</p>
<p><br>
</p>
<p>Comparing the schema created by PDAL and schema found at <a class="OWAAutoLink" id="LPlnk771333" href="https://github.com/pgpointcloud/pointcloud" previewremoved="true">
https://github.com/pgpointcloud/pointcloud</a> there are a few [minor] differences (namespace, double/int32, active, orientation, version).<br>
</p>
<p><br>
</p>
<p>Where is the PointCloudSchema .xsd file located? It would be <span>convenient</span> if the documentation
<a class="OWAAutoLink" id="LPlnk342962" href="https://www.pdal.io/stages/writers.pgpointcloud.html" previewremoved="true">
https://www.pdal.io/stages/writers.pgpointcloud.html</a> contained a link to schema file
<span>😊</span></p>
<p><br>
</p>
<p>kind regards, Lars</p>
<p></p>
<br>
<p><br>
</p>
<p></p>
<p></p>
<br>
<br>
<br>
<p></p>
<div style="color: rgb(0, 0, 0);">
<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> Andrew Bell <andrew.bell.ia@gmail.com><br>
<b>Sendt:</b> 12. april 2018 14:58<br>
<b>Til:</b> Lars<br>
<b>Kopi:</b> pdal@lists.osgeo.org<br>
<b>Emne:</b> Re: [pdal] pgpointcloud write incorrect wkb size</font>
<div> </div>
</div>
<div>
<div dir="ltr">I'd have to do some more work to figure out the discrepancy, but if your goal is to use PDAL to read/write to postgres, you don't need to do all the setup that you've done.  PDAL will handle this for you.  Simply point PDAL at your (empty) database
 and let it do the setup and writing for you.
<div><br>
</div>
<div>Normally PDAL will create a schema that writes X,Y and Z as double-precision values.  You can have it write 32-bit scaled integers by providing scaling factors (see
<a id="LPlnk806137" href="https://www.pdal.io/stages/writers.pgpointcloud.html" previewremoved="true">
https://www.pdal.io/stages/writers.pgpointcloud.html</a> for more info).  I think the issue is that the schema PDAL wants to use isn't the one you've created.</div>
<p></p>
<div id="LPBorder_GT_15239488141710.21401846355879717" style="width: 100%; text-indent: 0px; overflow: auto; margin-bottom: 20px; display: inline-block;">
<table id="LPContainer_15239488141520.15717115882821997" role="presentation" style="width: 90%; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top-color: rgb(200, 200, 200); border-bottom-color: rgb(200, 200, 200); border-top-width: 1px; border-bottom-width: 1px; border-top-style: dotted; border-bottom-style: dotted; position: relative; background-color: rgb(255, 255, 255);" cellspacing="0">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_15239488141550.5726795746014467" style="padding: 0px; vertical-align: top; display: table-cell; position: relative;" colspan="2">
<div id="LPRemovePreviewContainer_15239488141570.7923381114590555" style="float: right;">
</div>
<div id="LPTitle_15239488141590.32535668324240774" style="top: 0px; color: rgb(0, 120, 215); line-height: 21px; font-family: "wf_segoe-ui_light", "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 21px; font-weight: 400;">
<a id="LPUrlAnchor_15239488141620.2308417335243274" style="text-decoration: none;" href="https://www.pdal.io/stages/writers.pgpointcloud.html" target="_blank">writers.pgpointcloud â€” pdal.io</a></div>
<div id="LPMetadata_15239488141640.2359023032118981" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); line-height: 14px; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; font-weight: 400;">
www.pdal.io</div>
<div id="LPDescription_15239488141670.39013984844388555" style="color: rgb(102, 102, 102); line-height: 20px; overflow: hidden; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; font-weight: 400; display: block; max-height: 100px;">
writers.pgpointcloud¶. The PostgreSQL Pointcloud Writer allows you to write to PostgreSQL database that have the PostgreSQL Pointcloud extension enabled. The Pointcloud extension stores point cloud data in tables that contain rows of patches.</div>
</td>
</tr>
</tbody>
</table>
</div>
<p></p>
<br>
<div><br>
</div>
<div>If I have time I'll try to reproduce your steps so that I can give a more precise answer.</div>
</div>
<div class="x_gmail_extra"><br>
<div class="x_gmail_quote">On Thu, Apr 12, 2018 at 6:14 AM, Lars <span dir="ltr">
<<a id="LPlnk840823" href="mailto:laasunde@hotmail.com" target="_blank" previewremoved="true">laasunde@hotmail.com</a>></span> wrote:<br>
<blockquote class="x_gmail_quote" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">
<div dir="ltr">
<div id="x_m_-386678794954824380divtagdefaultwrapper" style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;" dir="ltr">
<p style="margin-top: 0px; margin-bottom: 0px;"><span>Hello</span></p>
<p>Using PDAL 1.5, PostgreSQL 9.5 and PostGIS bundle 2.3 on Windows 7.</p>
<p><br>
</p>
<p>We have followed the instructions found at <a id="LPlnk710301" href="https://github.com/pgpointcloud/pointcloud" target="_blank" previewremoved="true">
https://github.com/<wbr>pgpointcloud/pointcloud</a><br>
(Created database, added extensions, created pcpoint and pcpatch tables).</p>
<p><br>
</p>
<p>We have inserted a schema into pointcloud_formats (samme as <a id="LPlnk146931" href="https://github.com/pgpointcloud/pointcloud" target="_blank" previewremoved="true">
https://github.com/<wbr>pgpointcloud/pointcloud</a> but without Intensity).</p>
<p><br>
</p>
<p>We have successfully insert data into pcpoint table from sql shell.<br>
INSERT INTO pcpoint(pa) VALUES(PC_MakePoint(1, ARRAY[1,2,3])); <br>
This results in a data blob that is 17 bytes.</p>
<p><br>
</p>
<p>However using PDAL pipeline to insert data into table causes the following error;<br>
pc_patch_uncompressed_from_<wbr>wkb: wkb size and expected size does not match.</p>
<p><br>
</p>
<p>The sql log file shows that PDAL execute the following sql statement;<br>
INSERT INTO pcpoint(pa) VALUES('0103000000........<wbr>0840');<br>
This data blob is 37 bytes and is very different to above test (17 bytes).</p>
<p><br>
</p>
<p>The pipeline script looks like this;<br>
{<br>
  "pipeline": [<br>
    {<br>
      "type": "readers.text",<br>
      "filename": "data.txt",<br>
      "separator": ";"<br>
    },<br>
    {<br>
      "type":"filters.chipper",<br>
      "capacity":100<br>
    },<br>
    {<br>
      "type": "writers.pgpointcloud",<br>
      "connection": "host='localhost' dbname='aaa' port='5433' user='aaa' password='aaa'",<br>
      "table": "pcpoint",<br>
      "pcid":"1",<br>
      "compression": "none"<br>
    }<br>
  ]<br>
}<br>
The data.txt file looks like this;<br>
X;Y;Z<br>
1.00;2.00;3.00</p>
<p><br>
</p>
<p><span>What are we doing wrong? How can I can make PDAL pipeline produce the correct data blob that matches the schema used in db?
</span></p>
<p><span><br>
</span></p>
<p><span>Thanks.</span></p>
<p><br>
</p>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
pdal mailing list<br>
<a id="LPlnk496839" href="mailto:pdal@lists.osgeo.org" previewremoved="true">pdal@lists.osgeo.org</a><br>
<a id="LPlnk237489" href="https://lists.osgeo.org/mailman/listinfo/pdal" target="_blank" rel="noreferrer" previewremoved="true">https://lists.osgeo.org/<wbr>mailman/listinfo/pdal</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="x_gmail_signature">Andrew Bell<br>
<a id="LPlnk688839" href="mailto:andrew.bell.ia@gmail.com" target="_blank" previewremoved="true">andrew.bell.ia@gmail.com</a></div>
</div>
</div>
</div>
</div>
</body>
</html>