[pdal] pgpointcloud selector filter and max_capacity

Oscar Martinez Rubi o.martinezrubi at tudelft.nl
Mon Feb 9 02:43:31 PST 2015


Hi Andrew,

I have been testing with the scale, selector and the new stuff and 
everything works perfectly! Thanks!

As an example for other people which may be interested in how to make it 
work:

createdb testdb
psql testdb -f init.sql
pdal pipeline pipeline.xml

This stores only x, y and z as int_32 with dimensional compression and 
block size of 3000 points

Regards,

O.

-----
where init.sql is:

CREATE EXTENSION postgis;
CREATE EXTENSION pointcloud;
CREATE EXTENSION pointcloud_postgis;
INSERT INTO pointcloud_formats (pcid, srid, schema) VALUES (1, 28992,
'<?xml version="1.0" encoding="UTF-8"?>
  <pc:PointCloudSchema xmlns:pc="http://pointcloud.org/schemas/PC/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<pc:dimension>
<pc:position>1</pc:position>
<pc:size>4</pc:size>
    <pc:description>X coordinate</pc:description>
<pc:scale>0.01</pc:scale>
<pc:offset>0</pc:offset>
<pc:name>X</pc:name>
<pc:interpretation>int32_t</pc:interpretation>
<pc:active>true</pc:active>
</pc:dimension>
<pc:dimension>
<pc:position>2</pc:position>
<pc:size>4</pc:size>
    <pc:description>Y coordinate</pc:description>
<pc:scale>0.01</pc:scale>
<pc:offset>0</pc:offset>
<pc:name>Y</pc:name>
<pc:interpretation>int32_t</pc:interpretation>
<pc:active>true</pc:active>
</pc:dimension>
<pc:dimension>
<pc:position>3</pc:position>
<pc:size>4</pc:size>
    <pc:description>Z coordinate</pc:description>
<pc:scale>0.01</pc:scale>
<pc:offset>0</pc:offset>
<pc:name>Z</pc:name>
<pc:interpretation>int32_t</pc:interpretation>
<pc:active>true</pc:active>
</pc:dimension>
<pc:metadata>
  <Metadata name="compression" 
type="string">dimensional</Metadata></pc:metadata>
<pc:orientation>point</pc:orientation>
  </pc:PointCloudSchema>');

CREATE TABLE patches (
     id SERIAL PRIMARY KEY,
     pa PCPATCH(1)
);

-----

and pipeline.xml is:

<?xml version="1.0" encoding="utf-8"?>
<Pipeline version="1.0">
     <Writer type="writers.pgpointcloud">
         <Option name="connection">dbname='testdb'</Option>
         <Option name="table">patches</Option>
         <Option name="column">pa</Option>
         <Option name="srid">28992</Option>
         <Option name="overwrite">false</Option>
         <Option name="pcid">1</Option>
         <Option name="capacity">3000</Option>
         <Option name="compression">dimensional</Option>
         <Option name="output_dims">X,Y,Z</Option>
         <Option name="offset_x">0</Option>
         <Option name="offset_y">0</Option>
         <Option name="offset_z">0</Option>
         <Option name="scale_x">0.01</Option>
         <Option name="scale_y">0.01</Option>
         <Option name="scale_z">0.01</Option>
         <Filter type="filters.chipper">
             <Option name="capacity">3000</Option>
             <Reader type="readers.las">
                 <Option 
name="filename">/home/oscar/ahn_minibench.laz</Option>
                 <Option name="spatialreference">EPSG:28992</Option>
             </Reader>
         </Filter>
     </Writer>
</Pipeline>


On 05-02-15 09:44, Oscar Martinez Rubi wrote:
> That was fast! Thanks
> I will pull latest pdal and give it a try.
> Let me know how the selector works and i will also try that one.
> Regards
> O.
>
>
> Enviado de Samsung Mobile
>
>
> -------- Mensaje original --------
> De: Andrew Bell
> Fecha:05/02/2015 00:12 (GMT+01:00)
> Para: Oscar Martinez Rubi
> Cc: pdal at lists.osgeo.org
> Asunto: Re: [pdal] pgpointcloud selector filter and max_capacity
>
> On Wed, Feb 4, 2015 at 10:02 AM, Oscar Martinez Rubi 
> <o.martinezrubi at tudelft.nl <mailto:o.martinezrubi at tudelft.nl>> wrote:
>
>     At some point I though that the selection of dimensions could be
>     done when I insert the point cloud format in the DB (I only insert
>     a format with X,Y,Z) but I found out that after running PDAL the
>     one I inserted is ignored and a new format with all the dimensions
>     is used. So, we definitively need a way to tell the writter which
>     columns are desired.
>
>     Just to be clear, the scale_x..., is supposed to be specified in
>     the PDAL pipeline XML or in the point cloud format inserted in the
>     DB or in both?
>
>
> You specify this in the pipeline and the values are stored as integers 
> with a scaling factor instead of as double.  I'll document.
>
>     Well, I attach the sql file I execute to set the DB
>     and the pipeline xml I am using to run pdal pipeline.
>
>     With these ones I get a PDAL: ERROR:  unterminated quoted string
>     at or near "....
>     Looks like mismatch between expected format and the actual block
>     format
>
>
> I fixed this bug and it has been merged to the master branch in github.
>
> Also, I have selector-type behavior working and I should have that in 
> for the database drivers tomorrow.
>
> Best,
>
> -- 
> Andrew Bell
> andrew.bell.ia at gmail.com <mailto:andrew.bell.ia at gmail.com>
>
>
> _______________________________________________
> pdal mailing list
> pdal at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pdal

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20150209/d83aa926/attachment.html>


More information about the pdal mailing list