[pdal] pgpointcloud write incorrect wkb size

Lars laasunde at hotmail.com
Tue Apr 17 00:27:17 PDT 2018


Thanks for the feedback.


You are correct, PDAL does handle creation of table and inserting schema into correct table when pcid parameter is not specified in pipeline file.


Comparing the schema created by PDAL and schema found at https://github.com/pgpointcloud/pointcloud there are a few [minor] differences (namespace, double/int32, active, orientation, version).


Where is the PointCloudSchema .xsd file located? It would be convenient if the documentation https://www.pdal.io/stages/writers.pgpointcloud.html contained a link to schema file 😊


kind regards, Lars






________________________________
Fra: Andrew Bell <andrew.bell.ia at gmail.com>
Sendt: 12. april 2018 14:58
Til: Lars
Kopi: pdal at lists.osgeo.org
Emne: Re: [pdal] pgpointcloud write incorrect wkb size

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.

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 https://www.pdal.io/stages/writers.pgpointcloud.html for more info).  I think the issue is that the schema PDAL wants to use isn't the one you've created.

writers.pgpointcloud — pdal.io<https://www.pdal.io/stages/writers.pgpointcloud.html>
www.pdal.io
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.



If I have time I'll try to reproduce your steps so that I can give a more precise answer.

On Thu, Apr 12, 2018 at 6:14 AM, Lars <laasunde at hotmail.com<mailto:laasunde at hotmail.com>> wrote:

Hello

Using PDAL 1.5, PostgreSQL 9.5 and PostGIS bundle 2.3 on Windows 7.


We have followed the instructions found at https://github.com/pgpointcloud/pointcloud
(Created database, added extensions, created pcpoint and pcpatch tables).


We have inserted a schema into pointcloud_formats (samme as https://github.com/pgpointcloud/pointcloud but without Intensity).


We have successfully insert data into pcpoint table from sql shell.
INSERT INTO pcpoint(pa) VALUES(PC_MakePoint(1, ARRAY[1,2,3]));
This results in a data blob that is 17 bytes.


However using PDAL pipeline to insert data into table causes the following error;
pc_patch_uncompressed_from_wkb: wkb size and expected size does not match.


The sql log file shows that PDAL execute the following sql statement;
INSERT INTO pcpoint(pa) VALUES('0103000000........0840');
This data blob is 37 bytes and is very different to above test (17 bytes).


The pipeline script looks like this;
{
  "pipeline": [
    {
      "type": "readers.text",
      "filename": "data.txt",
      "separator": ";"
    },
    {
      "type":"filters.chipper",
      "capacity":100
    },
    {
      "type": "writers.pgpointcloud",
      "connection": "host='localhost' dbname='aaa' port='5433' user='aaa' password='aaa'",
      "table": "pcpoint",
      "pcid":"1",
      "compression": "none"
    }
  ]
}
The data.txt file looks like this;
X;Y;Z
1.00;2.00;3.00


What are we doing wrong? How can I can make PDAL pipeline produce the correct data blob that matches the schema used in db?


Thanks.


_______________________________________________
pdal mailing list
pdal at lists.osgeo.org<mailto:pdal at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/pdal



--
Andrew Bell
andrew.bell.ia at gmail.com<mailto:andrew.bell.ia at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20180417/fcdd4328/attachment.html>


More information about the pdal mailing list