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

Andrew Flatman anfla at sdfe.dk
Wed Oct 4 04:59:49 PDT 2017


Hep,
And we have a solution!

"dimensions": "band-1=Z, Z=Classification"    does the trick.

Thanks guys!

/Andrew

Fra: pdal [mailto:pdal-bounces at lists.osgeo.org] På vegne af Kristian Evers
Sendt: 4. oktober 2017 13:56
Til: 'pdal at lists.osgeo.org' <pdal at lists.osgeo.org>
Emne: Re: [pdal] assign a constant class to las imported fra tiff

Ah, I didn't notice that. Instead try this:

            "dimensions": "band-1=Z, Z=Classification"

Seems to work for me.

/Kristian

Fra: Andrew Flatman
Sendt: 4. oktober 2017 13:46
Til: Kristian Evers <kreve at sdfe.dk<mailto:kreve at sdfe.dk>>; 'pdal at lists.osgeo.org' <pdal at lists.osgeo.org<mailto:pdal at lists.osgeo.org>>
Emne: SV: assign a constant class to las imported fra tiff

Hi guys,
Both good ideas, my problem is if I set it to:    "dimensions": "band-1=Z, band-2=Classification"
I get: PDAL: filters.ferry: Can't ferry dimension 'band-2'. Dimension doesn't exist.

If I set it to: "dimensions": "band-1=Z, band-1=Classification"
Then no elevations are passed to the LAS file, only classes.

/Andrew

Fra: pdal [mailto:pdal-bounces at lists.osgeo.org] På vegne af Kristian Evers
Sendt: 4. oktober 2017 13:20
Til: 'pdal at lists.osgeo.org' <pdal at lists.osgeo.org<mailto:pdal at lists.osgeo.org>>
Emne: Re: [pdal] assign a constant class to las imported fra tiff

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<mailto: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/3a1b8093/attachment.html>


More information about the pdal mailing list