0

Is anyone aware of a method to set the bounds of a GTiff in the PDAL writers.raster similar to the method in writers.gdal? The idea is to ensure the output raster is the same bounds as the input las.

writers.raster example:

    {
    "pipeline": [
        {
            "type": "readers.las"
        },
        {
            "type": "filters.range",
            "limits": "Classification[2:2]"
        },
        {
            "type": "writers.raster"
        }
    ]
}

Example using writers.gdal:

 {
    "pipeline": [
        {
            "type": "readers.las"
        },
        {
            "type": "filters.range",
            "limits": "Classification[2:2]"
        },
        {

            "type": "writers.gdal",
            "gdaldriver": "GTiff",
            "output_type": "mean",
            "bounds": ***OUTPUT BOUNDS SET HERE***
        }
    ]
}

Writers.raster does not offer the same setting. Writers.gdal cannot be used in my case.

Ideally, setting the output bounds would happen in the pipeline and avoid a second external step like gdal.Translate.

Maybe I am missing something obvious?

1 Answer 1

1

Potential Solution.

Leverage filters.faceraster for bounds extents. Faceraster allows for setting an origin and users can work out a raster size based on pixel height and width. Ideally, the bounds could be set at the writers.raster stage, but this is the solution I have working at the moment to work around the use of writers.gdal.

{
    "pipeline": [
        {
            "type": "readers.las"
        },
        {
            "type": "filters.range",
            "limits": "Classification[2:2]"
        },
        {
            "type": "filters.delaunay"
        },
        {
            "type": "filters.faceraster"
            "resolution": ***SET RESO***,
            "origin_x": ***SET X ORIGIN***,
            "origin_y": ***SET Y ORIGIN***,
            "width": ***NUM OF PIXELS WIDE***,
            "height": ***NUM OF PIXELS HEIGHT***
        },
        {

            "type": "writers.raster"
        }
    ]
}

Maybe, setting the bounds at the filters.faceraster stage similar to writers.gdal could be a solution and avoids unforeseen errors when reconstructing the raster via the origin and bounds methods, but this is a good patch for my process for now.

1
  • It is possible to add bounds to filters.faceraster Commented Jan 29 at 17:58

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.