[pdal] assign a constant class to las imported fra tiff

Kristian Evers kreve at sdfe.dk
Wed Oct 4 04:20:12 PDT 2017


Hi Andrew,

Try this:

{
    "pipeline":[
        {
            "type": "readers.gdal",
            "filename":"in.tif"
        },
        {
            "type": "filters.ferry",
            "dimensions": "band-1=Z, band-1=Classification"
        },
        {
            "type": "filters.assign",
            "assignment" : "Classification[:]=2"
        },
        {
            "type": "writers.las",
            "filename": "out.las"
        }
    ]
}

The problem with your first try is that "2" is not a known dimension to PDAL. In the second try you haven't yet created a "Classification" dimension. In the above pipeline I start by creating the Classification dimension with scratch data from the first raster band. Afterwards I overwrite the data in Classification an assign 2 to all points.


/Kristian

Fra: pdal [mailto:pdal-bounces at lists.osgeo.org] På vegne af Andrew Flatman
Sendt: 4. oktober 2017 12:55
Til: 'pdal at lists.osgeo.org' <pdal at lists.osgeo.org>
Emne: [pdal] assign a constant class to las imported fra tiff

Hi,
I am reading a DEM from a tiff file and writing it as las. My problem is that I cannot set the class. I have tried adding the dimension Classification in the filter.ferry part:

    {
        "type": "filters.ferry",
        "dimensions": "band-1=Z, 2=Classification"
    },
Which gives the error: PDAL: filters.ferry: Can't ferry dimension '2'. Dimension doesn't exist.

I have tried this: "dimensions": "band-1=Z, Classification[:]=2"

Which gives the error: PDAL: filters.ferry: Can't ferry dimension 'Classification[:]'. Dimension doesn't exist.


I have also tried assigning the classification using the filter.assign:
    {
          "type":"filters.assign",
          "assignment" : "Classification[:]=2"
    },

Which gives the error:  PDAL: filters.assign: Invalid dimension name in 'values' option: 'Classification'.


Any Ideas as to how I can set all the values to specific class?

Thanks,
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20171004/b75fd818/attachment-0001.html>


More information about the pdal mailing list