[pdal] How to calculate point cloud density?

Howard Butler howard at hobu.co
Sun Jan 7 19:28:32 PST 2024


* The 'density' option was added in PDAL 2.6 https://github.com/PDAL/PDAL/pull/4244
* For now, it only outputs GeoJSON, so my previous example wasn't quite right. The following 'pdal translate' would also work with 2.6:

> pdal translate myfile.las counts.tif --writers.gdal.resolution=10 --writers.gdal.binmode=true --writers.gdal.output_type="count" --filter hexbin --filters.hexbin.edge_length=10 --filters.hexbin.density=myfile.geojson --filters.hexbin.threshold=1



> On Jan 7, 2024, at 10:33 AM, Ulises Ibarra via pdal <pdal at lists.osgeo.org> wrote:
> 
> Hi Howard:
> I run some like this, and look like it works:
> [
>      {
>          "type":"readers.las",
>          "filename":"cloud6cb301139efa9d25_GGM2010_scale_offset_translated.las"
>      },
>      {
>          "type":"writers.gdal",   
>          "filename":"cloud6cb301139efa9d25_GGM2010_scale_offset_translated_densidad1m2.tif",
>          "dimension":"Z",
>          "data_type":"Float32",
>          "binmode":true,
>          "output_type":"count",
>          "resolution":1
>      }
>      ]
> 
> what do you think?
> 
> El dom, 7 ene 2024 a las 9:34, Ulises Ibarra (<ulisesmartinibarra at gmail.com <mailto:ulisesmartinibarra at gmail.com>>) escribió:
>> Hi Howard, thanks for replying.
>> When applying the pipeline that you show me, the result is on the one hand:
>> 1.- (pdal_2.6) C:\clouds\quarry>pdal pipeline pipeline_densidad_hexagonos.json
>> PDAL: filters.hexbin: Unexpected argument 'density'
>> 
>> I did something that is probably not right:
>> "pipeline": [
>>       {
>>           "type":"readers.las",
>>           "filename":"odm_georeferenced_model.laz"
>>       },
>>        {
>>           "type":"filters.hexbin.density",
>>           "edge_length":10,
>>           "filename":"hexagons-are-awesome.shp"
>>        }
>>        ]
>> 
>> And the result was:
>> "PDAL: Couldn't create filter stage of type 'filters.hexbin.density'.
>> You probably have a version of PDAL that didn't come with a plugin
>> you're trying to load. Please see the FAQ at https://pdal.io/faq.html"
>> 
>> On the other hand, using the same example pipeline that you kindly showed me:
>> 2.- The resulting TIF raster has 3 bands and apparently shows elevation, not density. Probably because the pipeline includes this: "dimension":"Z".
>> 
>> What could I do about it?
>> 
>> Cordially
>> 
>> Ulises Ibarra
>> 
>> El vie, 5 ene 2024 a las 15:55, Howard Butler (<howard at hobu.co <mailto:howard at hobu.co>>) escribió:
>>> 
>>> 
>>> > On Jan 4, 2024, at 4:50 PM, Ulises Ibarra via pdal <pdal at lists.osgeo.org <mailto:pdal at lists.osgeo.org>> wrote:
>>> 
>>> If you don't need the hexagons, use writers.gdal.binmode=true and then capture the 'count' band from that raster. It should run quickly and you can control the pixel size. 
>>> 
>>> The following pipeline does both:
>>> 
>>> > "pipeline":[
>>> >     {
>>> >         "type":"readers.las",
>>> >         "filename":"myfile.laz"
>>> >     },
>>> >     {
>>> >         "type":"filters.hexbin",
>>> >         "edge_length":10,
>>> >         "density":"hexagons-are-awesome.shp"
>>> >     },
>>> >     {
>>> >         "type":"writers.gdal",   
>>> >         "filename":"output.tif",
>>> >         "dimension":"Z",
>>> >         "data_type":"Float32",
>>> >         "binmode":true,
>>> >         "output_type":"count",
>>> >         "resolution": 1
>>> >     }
>>> >   ]
>>> > }
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
> _______________________________________________
> pdal mailing list
> pdal at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/pdal

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20240107/e41308b8/attachment.htm>


More information about the pdal mailing list