<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Are you sure you use pc_patch(your set of points) before inserting anything?<br></div><div class="gmail_default" style="font-family:monospace,monospace">It does not look to be the cas ein your sql example.<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">Even a 1 point patch as to be transformed into a patch!<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">Cheers,<br></div><div class="gmail_default" style="font-family:monospace,monospace">Rémi-C<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-07-22 8:14 GMT+02:00 Adam Steer <span dir="ltr"><<a href="mailto:Adam.Steer@anu.edu.au" target="_blank">Adam.Steer@anu.edu.au</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
OK - dropping the PCID option from my pipeline.xml did the trick, and I have points in a table of patches!<br>
<br>
I’d like to know why the schema didn’t work out - but I can tinker and figure that out later.<br>
<br>
Thanks everyone<br>
<br>
Adam<br>
<br>
> On 22 Jul 2016, at 11:32 AM, Andrew Bell <<a href="mailto:andrew.bell.ia@gmail.com">andrew.bell.ia@gmail.com</a>> wrote:<br>
><br>
> The PDAL pgpointcloud writer will create an appropriate schema automatically.<br>
<div class="HOEnZb"><div class="h5">><br>
> On Jul 21, 2016 8:24 PM, "Adam Steer" <<a href="mailto:Adam.Steer@anu.edu.au">Adam.Steer@anu.edu.au</a>> wrote:<br>
> Hi Remi, all<br>
><br>
> Moving on - I realised that my pipeline was not limiting the output of PDAL properly, so I made a new schema to fit all 16 dimensions. It works (with one mismatched data type), for example:<br>
><br>
> pcbm_pc=> insert into act_points (pt) select pc_makepoint(3, array[692236.790,6094672.340,615.530,93.000,1.000,2.000,1.000,0.000,5.000,-12.000,0.000,601.000,436302.342,0.000,0.000,0.000]) as values;<br>
> WARNING: Value -12 truncated to 0 to fit in uint16_t<br>
><br>
> …where the array of values is a direct copy and paste from pdal translate filename.las stdout | head. And I get the results back as expected:<br>
><br>
> pcbm_pc=> SELECT PC_AsText(pt) FROM act_points LIMIT 2;<br>
> pc_astext<br>
> -------------------------------------------------------------------------------<br>
> {"pcid":3,"pt":[692237,6.09466e+06,604.97,89,3,3,1,0,3,0,0,583,364567,0,0,0]}<br>
> {"pcid":3,"pt":[692237,6.09467e+06,615.53,93,1,2,1,0,5,0,0,601,436302,0,0,0]}<br>
> (2 rows)<br>
><br>
> ….but when I try to make a patch, I’m missing something:<br>
><br>
> pcbm_pc=> select * from act_points limit 1;<br>
> id | pt<br>
> ----+----------------------------------------------------------------------------------------------------------------------------<br>
> 1 | 010300000048E17A9419202541AE47E10AD23F5741F6285C8FC2E78240590003000300010000000300000000004702736891ED5B401641000000000000<br>
> (1 row)<br>
><br>
> pcbm_pc=> insert into act_patches (pa) values ('010300000048E17A9419202541AE47E10AD23F5741F6285C8FC2E78240590003000300010000000300000000004702736891ED5B401641000000000000');<br>
> ERROR: pc_patch_from_wkb: unknown compression '-1803886264' requested<br>
> LINE 1: insert into act_patches (pa) values ('010300000048E17A941920…<br>
><br>
> …which is sort of similar to the message I get back from my PDAL pipeline (?? well, unknown compression vs wkb and data size mismatch)<br>
><br>
> # pdal pipeline postgis_pc_pipeline.xml<br>
> PDAL: ERROR: pc_patch_uncompressed_from_wkb: wkb size and expected data size do not match<br>
> LINE 1: INSERT INTO "act_patches" ("pa") VALUES ('010300000000000000...<br>
><br>
> My schema says:<br>
><br>
> <pc:metadata><br>
> <Metadata name="compression">none</Metadata><br>
> </pc:metadata><br>
><br>
> So - I have an issue creating patches. Again, thanks in advance for any insight!<br>
><br>
> Regards<br>
> Adam<br>
><br>
><br>
><br>
> > On 21 Jul 2016, at 9:06 AM, Adam Steer <<a href="mailto:Adam.Steer@anu.edu.au">Adam.Steer@anu.edu.au</a>> wrote:<br>
> ><br>
> > Thanks Rémi,<br>
> ><br>
> > I will do some tests and report back. I had not even considered this approach!<br>
> ><br>
> > Regards<br>
> ><br>
> > Adam<br>
> ><br>
> >> On 20 Jul 2016, at 10:04 PM, Rémi Cura <<a href="mailto:remi.cura@gmail.com">remi.cura@gmail.com</a>> wrote:<br>
> >><br>
> >> Hey,<br>
> >> As you seem to discover this pgpointcloud world,<br>
> >> maybe you could do this step by step.<br>
> >> First create your point xml schema and test it within the database<br>
> >> (meaning creating a random point and patch using it).<br>
> >><br>
> >> Then you can use lastool to output a few actual points in text,<br>
> >> and manually create pgpoints from these values (casting point to text back to be sure your precision/offset and so is OK).<br>
> >><br>
> >> When you are sure everything works, then you can use pdal.<br>
> >><br>
> >> Cheers,<br>
> >> Rémi-C<br>
> >><br>
> >> 2016-07-20 2:52 GMT+02:00 Adam Steer <<a href="mailto:Adam.Steer@anu.edu.au">Adam.Steer@anu.edu.au</a>>:<br>
> >> Hi all<br>
> >><br>
> >> I am attempting to ingest some points into postGIS-pointcloud, and basically failing at the start:<br>
> >><br>
> >> - I want to ingest time,x,y,z,intensity,return number and classification<br>
> >> - I’ve used pdal info —schema to get the numeric types, sizes and field names of my .LAS file (v1.4)<br>
> >> - I’ve (maybe) built a format schema based on those (see below)<br>
> >> - …and used a PDAL pipeline to try to ingest them.<br>
> >><br>
> >> but I’ve managed to map something badly - PDAL returns:<br>
> >><br>
> >> #> pdal pipeline postgis_pc_pipeline.xml<br>
> >> PDAL: ERROR: pc_patch_uncompressed_from_wkb: wkb size and expected data size do not match<br>
> >> LINE 1: INSERT INTO "blocks" ("pa") VALUES ('01020000000000000087130...<br>
> >><br>
> >> While I’ve worked with points a lot, I’ve not used any clever things like postGIS pointcloud to manage them (because PhD, time, and triage between working with what exists and learning new things) - and now I’m learning on the fly (with a need to learn fast!)<br>
> >><br>
> >> PDAL tells me I’m clearly missing something about the relationship between the size of things in my schema, and the size of things PDAL is getting from my .LAS file.<br>
> >><br>
> >> Also I’m trying to be lazy - I should probably work out the scales and offsets correctly, and store XYZ as long integers. I wanted to try floating point storage (as real, which if I read correctly should be big enough).<br>
> >><br>
> >> Any help will be highly appreciated!<br>
> >><br>
> >> Thanks<br>
> >><br>
> >> Adam<br>
> >><br>
> >> ----<br>
> >> Here is my pipeline:<br>
> >><br>
> >> # cat postgis_pc_pipeline.xml<br>
> >><br>
> >> <?xml version="1.0" encoding="utf-8"?><br>
> >> <Pipeline version="1.0"><br>
> >> <Writer type="writers.pgpointcloud"><br>
> >> <Option name="connection">host='localhost' dbname=‘….' user=‘….' password=‘….'</Option><br>
> >> <Option name="table">blocks</Option><br>
> >> <Option name="srid">28355</Option><br>
> >> <Option name="pcid">2</Option><br>
> >> <Filter type="filters.chipper"><br>
> >> <Option name="capacity">5000</Option><br>
> >> <Reader type="readers.las"><br>
> >> <Option name="filename">./subsets/ACT2015-C3-ELL_6926094_55_0002_0002_7_12.las</Option><br>
> >> <Option name="spatialreference">EPSG:28355</Option><br>
> >> </Reader><br>
> >> </Filter><br>
> >> </Writer><br>
> >> </Pipeline><br>
> >><br>
> >> (notes here - should I use a filter to get *just* the fields I want - or does PDAL handle extracting only what exists in the schema?)<br>
> >><br>
> >> …and my schema SQL:<br>
> >><br>
> >> INSERT INTO pointcloud_formats (pcid, srid, schema) VALUES (2, 28335,<br>
> >> '<?xml version="1.0" encoding="UTF-8"?><br>
> >> <pc:PointCloudSchema xmlns:pc="<a href="http://pointcloud.org/schemas/PC/1.1" rel="noreferrer" target="_blank">http://pointcloud.org/schemas/PC/1.1</a>"<br>
> >> xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" rel="noreferrer" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"><br>
> >> <pc:dimension><br>
> >> <pc:position>1</pc:position><br>
> >> <pc:size>8</pc:size><br>
> >> <pc:description>Time as seconds of GPS week, as real<br>
> >> </pc:description><br>
> >> <pc:name>T</pc:name><br>
> >> <pc:interpretation>real</pc:interpretation><br>
> >> <pc:scale>1</pc:scale><br>
> >> </pc:dimension><br>
> >> <pc:dimension><br>
> >> <pc:position>2</pc:position><br>
> >> <pc:size>8</pc:size><br>
> >> <pc:description>X coordinate as real.</pc:description><br>
> >> <pc:name>X</pc:name><br>
> >> <pc:interpretation>real</pc:interpretation><br>
> >> <pc:scale>1</pc:scale><br>
> >> </pc:dimension><br>
> >> <pc:dimension><br>
> >> <pc:position>3</pc:position><br>
> >> <pc:size>8</pc:size><br>
> >> <pc:description>Y coordinate as real</pc:description><br>
> >> <pc:name>Y</pc:name><br>
> >> <pc:interpretation>real</pc:interpretation><br>
> >> <pc:scale>1</pc:scale><br>
> >> </pc:dimension><br>
> >> <pc:dimension><br>
> >> <pc:position>4</pc:position><br>
> >> <pc:size>8</pc:size><br>
> >> <pc:description>Z coordinate is ellipsoidal height as real<br>
> >> </pc:description><br>
> >> <pc:name>Z</pc:name><br>
> >> <pc:interpretation>real</pc:interpretation><br>
> >> <pc:scale>1</pc:scale><br>
> >> </pc:dimension><br>
> >> <pc:dimension><br>
> >> <pc:position>5</pc:position><br>
> >> <pc:size>6</pc:size><br>
> >> <pc:description>The intensity value is the integer representation<br>
> >> of the pulse return magnitude. This value is optional<br>
> >> and system specific. However, it should always be<br>
> >> included if available.</pc:description><br>
> >> <pc:name>Intensity</pc:name><br>
> >> <pc:interpretation>uint16_t</pc:interpretation><br>
> >> <pc:scale>1</pc:scale><br>
> >> </pc:dimension><br>
> >> <pc:dimension><br>
> >> <pc:position>6</pc:position><br>
> >> <pc:size>1</pc:size><br>
> >> <pc:description>Return number</pc:description><br>
> >> <pc:name>ReturnNumber</pc:name><br>
> >> <pc:interpretation>uint16_t</pc:interpretation><br>
> >> <pc:scale>1</pc:scale><br>
> >> </pc:dimension><br>
> >> <pc:dimension><br>
> >> <pc:position>7</pc:position><br>
> >> <pc:size>1</pc:size><br>
> >> <pc:description>Classification if supplied (ASPRS LAS guidelines)</pc:description><br>
> >> <pc:name>Class</pc:name><br>
> >> <pc:interpretation>uint16_t</pc:interpretation><br>
> >> <pc:scale>1</pc:scale><br>
> >> </pc:dimension><br>
> >> <pc:metadata><br>
> >> <Metadata name="compression">dimensional</Metadata><br>
> >> </pc:metadata><br>
> >> </pc:PointCloudSchema>');<br>
> >><br>
> >><br>
> >><br>
> >><br>
> >><br>
> >><br>
> >> --<br>
> >> _______________________________________________<br>
> >> pgpointcloud mailing list<br>
> >> <a href="mailto:pgpointcloud@lists.osgeo.org">pgpointcloud@lists.osgeo.org</a><br>
> >> <a href="http://lists.osgeo.org/mailman/listinfo/pgpointcloud" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgpointcloud</a><br>
> >><br>
> ><br>
> > _______________________________________________<br>
> > pgpointcloud mailing list<br>
> > <a href="mailto:pgpointcloud@lists.osgeo.org">pgpointcloud@lists.osgeo.org</a><br>
> > <a href="http://lists.osgeo.org/mailman/listinfo/pgpointcloud" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgpointcloud</a><br>
><br>
> _______________________________________________<br>
> pgpointcloud mailing list<br>
> <a href="mailto:pgpointcloud@lists.osgeo.org">pgpointcloud@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/pgpointcloud" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgpointcloud</a><br>
<br>
_______________________________________________<br>
pgpointcloud mailing list<br>
<a href="mailto:pgpointcloud@lists.osgeo.org">pgpointcloud@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgpointcloud" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgpointcloud</a></div></div></blockquote></div><br></div>