<div dir="ltr"><span style="font-family:courier new,monospace">Hi All,<br><br>Playing a bit with calculating heights in pointcloud. I have a couple questions.<br><br>First, is there a better way to get all the dimensions of a point cloud exploded as columns or an array than a bunch of PC_Get on the exploded patch? e.g. concatenated into text as follows:<br>
</span><div><span style="font-family:courier new,monospace"><br>WITH lraw AS (<br>    SELECT PC_Explode(pa) AS ex,  PC_PatchMin(pa, 'Z') AS min, id<br>    FROM test1 WHERE id < 10000<br>    )<br>SELECT PC_Get(ex, 'X') || ',' || PC_Get(ex, 'Y') || ',' || PC_Get(ex, 'Z') - min || ',' ||<br>
    PC_Get(ex, 'Intensity') || ',' || PC_Get(ex, 'ReturnNumber') || ',' || PC_Get(ex, 'NumberOfReturns') || ',' ||<br>    PC_Get(ex, 'ScanDirectionFlag') || ',' || PC_Get(ex, 'EdgeOfFlightLine') || ',' ||<br>
    PC_Get(ex, 'Classification') || ',' || PC_Get(ex, 'ScanAngleRank') || ',' || PC_Get(ex, 'UserData') || ',' ||<br>    PC_Get(ex, 'PointSourceId') || ',' || PC_Get(ex, 'Time') || ',' || PC_Get(ex, 'PointID') || ',' || PC_Get(ex, 'BlockID')<br>
    AS xyheight, id FROM lraw;<br><br></span></div><div><span style="font-family:courier new,monospace">My objective is to calculate heights as a difference between the current point and the min for the patch (quick and dirty, but works) and then converted back to a point cloud, but this feels very hackerish... :<br>
</span></div><div><span style="font-family:courier new,monospace"><br>WITH lraw AS (<br>    SELECT PC_Explode(pa) AS ex,  PC_PatchMin(pa, 'Z') AS min, id<br>    FROM test1 WHERE id < 10000<br>    ),<br>heights AS (<br>
    SELECT PC_Get(ex, 'X') || ',' || PC_Get(ex, 'Y') || ',' || PC_Get(ex, 'Z') - min || ',' ||<br>    PC_Get(ex, 'Intensity') || ',' || PC_Get(ex, 'ReturnNumber') || ',' || PC_Get(ex, 'NumberOfReturns') || ',' ||<br>
    PC_Get(ex, 'ScanDirectionFlag') || ',' || PC_Get(ex, 'EdgeOfFlightLine') || ',' ||<br>    PC_Get(ex, 'Classification') || ',' || PC_Get(ex, 'ScanAngleRank') || ',' || PC_Get(ex, 'UserData') || ',' ||<br>
    PC_Get(ex, 'PointSourceId') || ',' || PC_Get(ex, 'Time') || ',' || PC_Get(ex, 'PointID') || ',' || PC_Get(ex, 'BlockID')<br>    AS xyheight, id FROM lraw<br>    ),<br>
heightcloud AS (<br>    SELECT PC_MakePoint(1, string_to_array(xyheight, ',')::float8[]) pt, id FROM heights<br>    )<br>SELECT PC_Patch(pt) FROM heightcloud GROUP BY id / 20;<br><br></span></div><div><span style="font-family:courier new,monospace">Thoughts?<br>
</span></div><div><span style="font-family:courier new,monospace">Best,<br>Steve<br></span></div></div>