Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

How can I generate DEM DTM and CHM from point cloud #18

Open
nefuhhanrui opened this issue May 18, 2021 · 3 comments
Open

How can I generate DEM DTM and CHM from point cloud #18

nefuhhanrui opened this issue May 18, 2021 · 3 comments

Comments

@nefuhhanrui
Copy link

i hava point cloud data in .las format
and then how can I generate DEM DTM and CHM from point cloud?
Can someone tell me? Thank you very much

@smallpondtom
Copy link

@nefuhhanrui
Hi, this might be too late but what I did was use PDAL with python to generate a DSM and DTM, and then I used gdal_calc.py which comes with GDAL to take the difference between the DSM and DTM to generate a CHM.

I hope this answers your question.

@AmmarOkran
Copy link

Hi
I have las file, and I need to apply your algorithm but I need to generate the DSM and DTM, I used pdal as you mentioned but the result is different. I thought maybe the problem from my dataset but also the same with your las file.
Could you pass the pipeline that you used to generate the DSM and DTM TIF files

@AmmarOkran
Copy link

AmmarOkran commented Jul 8, 2021

@smallpondtom @zjans

I have taken your file POINTS.las to generate DEM, DSM, and CHM but what I got totally different for yours and when I applied Pycrown it gave me an exception:
File "fiona/ogrext.pyx", line 1285, in fiona.ogrext.WritingSession.writerecs fiona.errors.GeometryTypeValidationError: Record's geometry type does not match collection schema's geometry type: 'LineString' != 'Polygon'

The pipeline for DTM as follows:

creating_json = {
            "pipeline": [
            {
                "type": "readers.las",
                "filename": f"{lasfile}",
                "spatialreference": "EPSG:2193"
            },
            {
                "type":"filters.assign",
                "assignment":"Classification[:]=0"
            },
            {
                "type":"filters.elm"
            },
            {
                "type":"filters.outlier",
                "method":"statistical",
                "mean_k":8,
                "multiplier":3.0
            },
            {
                "type":"filters.smrf",
                "ignore":"Classification[7:7]",
                "slope":.15,
                "window":18,
                "threshold":0.30,
                "scalar":0.95
            },
            {
                "type":"filters.range",
                "limits":"Classification[2:2]"
            },
            {
                "type": "writers.gdal",
                "filename": f"{outputfile}",
                "output_type": "idw",
                "gdaldriver": "GTiff",
                "resolution": f"{resolution}", 
                "nodata":"-9999",
                "radius": 1,
                "data_type": "float32"
            }

            ]
    }

The pipeline for DSM as follows:

creating_json = {
            "pipeline": [
            {
                "type": "readers.las",
                "filename": f"{lasfile}",
                "spatialreference": "EPSG:2193"
            },
            {
                "type": "filters.range",
                "limits":"returnnumber[1:1]"
            },
            {
                "type": "writers.gdal",
                "filename": f"{outputfile}",
                "output_type": "idw",
                "gdaldriver": "GTiff",
                "resolution": f"{resolution}", 
                "nodata":"-9999",
                "radius":1,
                "data_type": "float32"
            }

            ]
    }

Any suggestion!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants