I'm trying to create a pdal pipeline to adjust the classification values for all points inside polygons, but I can't seem to get it to work. The filters.range works correctly because the output file contains the filtered values. It's the filters.overlay that doesn't seem to be doing anything. I have an attribute called CLS on all the polygons in the shapefile.

        "type": "readers.las",
        "filename": "area_small.las"
        "limits":"Classification[0:0], Classification[3:6]"
        "dimension" : "Classification",
        "datasource": "buildings_small.shp",
        "column": "CLS"
        "type" : "writers.las",
        "filename" : "output.las"

I have also tried to use a VRT file

        <OGRVRTLayer name="buildings_small">

That doesn't work either. The las file does have a different projection, but they two files line up perfectly in GlobalMapper

Is there another way to do this? Using a filters.assign changes the Classification value, but I can't figure out how to make it only do that for points inside the polygons.

  • 1
    Can you try adding a "layer":"buildings_small" attribute to the filters.overlay filter? Shapefiles are kind of weird in that their layer name is implicit. pdal.io/workshop/exercises/analysis/clipping/clipping.html May also be instructive, but I think you're following that already. Especially the last filters.range, but if your CLS values are not getting set, maybe the layer name thing is the issue. – Howard Butler Jul 18 '19 at 3:24
  • Turns out it wasn't the layer, but the link you sent me did talk about ensuring that the projections of the las and the shp file should match. They did not explain why, or even say it was a problem, but after doing that it seems to have fixed my problem. So the projections of the two files absolutely must match. – Liz Jul 18 '19 at 22:03
  • Yes the projections must match. PDAL cannot automatically project for you in this instance. You can use OGR VRT to align the projections, however. I’d you have a suggestion to add to the docs to clarify this item, please make a ticket with language that helps do it. – Howard Butler Jul 19 '19 at 23:05
  • Please, add the solution as an answer (explaining exactly what you did to fix it). Otherwise, this Q will be closed as 'not reproducible' and with time, may end up deleted. See gis.stackexchange.com/help/self-answer. Tks. – Andre Silva Jul 22 '19 at 20:03

Thanks to the suggestion from 'Howard Butler' - in the documentation pdal clipping

We determined that the projections of the shp file and the las file must absolutely match. So simply reproject one of the files and rerun the algorithm, and everything works perfectly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.