0

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"
    },
    {
        "type":"filters.range",
        "limits":"Classification[0:0], Classification[3:6]"
    },
    {
        "type":"filters.overlay",
        "dimension" : "Classification",
        "datasource": "buildings_small.shp",
        "column": "CLS"
    },
    {
        "type" : "writers.las",
        "filename" : "output.las"
    }

I have also tried to use a VRT file

<OGRVRTDataSource>
    <OGRVRTWarpedLayer>
        <OGRVRTLayer name="buildings_small">
            <SrcDataSource>buildings_small.shp</SrcDataSource>
            <LayerSRS>EPSG:4326</LayerSRS>
        </OGRVRTLayer>
        <TargetSRS>EPSG:4326</TargetSRS>
    </OGRVRTWarpedLayer>
</OGRVRTDataSource>

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.

4
  • 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. Commented Jul 18, 2019 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
    Commented Jul 18, 2019 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. Commented Jul 19, 2019 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. Commented Jul 22, 2019 at 20:03

1 Answer 1

0

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 and acknowledge you have read our privacy policy.

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